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
onelogin/onelogin-java-sdk
src/main/java/com/onelogin/sdk/conn/Client.java
Client.getGroupsBatch
public OneLoginResponse<Group> getGroupsBatch(int batchSize, String afterCursor) throws OAuthSystemException, OAuthProblemException, URISyntaxException { """ Get a batch of Groups. @param batchSize Size of the Batch @param afterCursor Reference to continue collecting items of next page @return OneLoginRe...
java
public OneLoginResponse<Group> getGroupsBatch(int batchSize, String afterCursor) throws OAuthSystemException, OAuthProblemException, URISyntaxException { return getGroupsBatch(new HashMap<String, String>(), batchSize, afterCursor); }
[ "public", "OneLoginResponse", "<", "Group", ">", "getGroupsBatch", "(", "int", "batchSize", ",", "String", "afterCursor", ")", "throws", "OAuthSystemException", ",", "OAuthProblemException", ",", "URISyntaxException", "{", "return", "getGroupsBatch", "(", "new", "Hash...
Get a batch of Groups. @param batchSize Size of the Batch @param afterCursor Reference to continue collecting items of next page @return OneLoginResponse of Group @throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection @throws OAuthProblemException - if there are errors v...
[ "Get", "a", "batch", "of", "Groups", "." ]
train
https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L2272-L2275
google/closure-templates
java/src/com/google/template/soy/jssrc/internal/JsCodeBuilder.java
JsCodeBuilder.setOutputVarInited
public JsCodeBuilder setOutputVarInited() { """ Tells this CodeBuilder that the current output variable has already been initialized. This causes {@code initOutputVarIfNecessary} and {@code addToOutputVar} to not add initialization code even on the first use of the variable. """ outputVars.pop(); out...
java
public JsCodeBuilder setOutputVarInited() { outputVars.pop(); outputVars.push(new OutputVar(currOutputVar, /* initialized= */ true)); currOutputVarIsInited = true; return this; }
[ "public", "JsCodeBuilder", "setOutputVarInited", "(", ")", "{", "outputVars", ".", "pop", "(", ")", ";", "outputVars", ".", "push", "(", "new", "OutputVar", "(", "currOutputVar", ",", "/* initialized= */", "true", ")", ")", ";", "currOutputVarIsInited", "=", "...
Tells this CodeBuilder that the current output variable has already been initialized. This causes {@code initOutputVarIfNecessary} and {@code addToOutputVar} to not add initialization code even on the first use of the variable.
[ "Tells", "this", "CodeBuilder", "that", "the", "current", "output", "variable", "has", "already", "been", "initialized", ".", "This", "causes", "{" ]
train
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jssrc/internal/JsCodeBuilder.java#L248-L253
knowm/XChange
xchange-simulated/src/main/java/org/knowm/xchange/simulated/MatchingEngine.java
MatchingEngine.marketCostOrProceeds
public BigDecimal marketCostOrProceeds(OrderType orderType, BigDecimal amount) { """ Calculates the total cost or proceeds at market price of the specified bid/ask amount. @param orderType Ask or bid. @param amount The amount. @return The market cost/proceeds @throws ExchangeException If there is insufficien...
java
public BigDecimal marketCostOrProceeds(OrderType orderType, BigDecimal amount) { BigDecimal remaining = amount; BigDecimal cost = ZERO; List<BookLevel> orderbookSide = orderType.equals(BID) ? asks : bids; for (BookOrder order : FluentIterable.from(orderbookSide).transformAndConcat(BookLevel::get...
[ "public", "BigDecimal", "marketCostOrProceeds", "(", "OrderType", "orderType", ",", "BigDecimal", "amount", ")", "{", "BigDecimal", "remaining", "=", "amount", ";", "BigDecimal", "cost", "=", "ZERO", ";", "List", "<", "BookLevel", ">", "orderbookSide", "=", "ord...
Calculates the total cost or proceeds at market price of the specified bid/ask amount. @param orderType Ask or bid. @param amount The amount. @return The market cost/proceeds @throws ExchangeException If there is insufficient liquidity.
[ "Calculates", "the", "total", "cost", "or", "proceeds", "at", "market", "price", "of", "the", "specified", "bid", "/", "ask", "amount", "." ]
train
https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-simulated/src/main/java/org/knowm/xchange/simulated/MatchingEngine.java#L187-L201
powermock/powermock
powermock-modules/powermock-module-javaagent/src/main/java/sun/tools/attach/HotSpotVirtualMachine.java
HotSpotVirtualMachine.loadAgentLibrary
@Override public void loadAgentLibrary(String agentLibrary, String options) throws AgentLoadException, AgentInitializationException, IOException { """ /* Load agent library - library name will be expanded in target VM """ loadAgentLibrary(agentLibrary, false, options); }
java
@Override public void loadAgentLibrary(String agentLibrary, String options) throws AgentLoadException, AgentInitializationException, IOException { loadAgentLibrary(agentLibrary, false, options); }
[ "@", "Override", "public", "void", "loadAgentLibrary", "(", "String", "agentLibrary", ",", "String", "options", ")", "throws", "AgentLoadException", ",", "AgentInitializationException", ",", "IOException", "{", "loadAgentLibrary", "(", "agentLibrary", ",", "false", ",...
/* Load agent library - library name will be expanded in target VM
[ "/", "*", "Load", "agent", "library", "-", "library", "name", "will", "be", "expanded", "in", "target", "VM" ]
train
https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-modules/powermock-module-javaagent/src/main/java/sun/tools/attach/HotSpotVirtualMachine.java#L75-L80
alkacon/opencms-core
src/org/opencms/search/solr/CmsSolrDocumentXmlContent.java
CmsSolrDocumentXmlContent.extractXmlContent
public static CmsExtractionResult extractXmlContent(CmsObject cms, CmsResource resource, I_CmsSearchIndex index) throws CmsException { """ Extracts the content of a single XML content resource.<p> @param cms the cms context @param resource the resource @param index the used index @return the extraction...
java
public static CmsExtractionResult extractXmlContent(CmsObject cms, CmsResource resource, I_CmsSearchIndex index) throws CmsException { return extractXmlContent(cms, resource, index, null); }
[ "public", "static", "CmsExtractionResult", "extractXmlContent", "(", "CmsObject", "cms", ",", "CmsResource", "resource", ",", "I_CmsSearchIndex", "index", ")", "throws", "CmsException", "{", "return", "extractXmlContent", "(", "cms", ",", "resource", ",", "index", "...
Extracts the content of a single XML content resource.<p> @param cms the cms context @param resource the resource @param index the used index @return the extraction result @throws CmsException in case reading or unmarshalling the content fails
[ "Extracts", "the", "content", "of", "a", "single", "XML", "content", "resource", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/solr/CmsSolrDocumentXmlContent.java#L354-L358
looly/hutool
hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java
ImgUtil.pressImage
public static void pressImage(File srcImageFile, File destImageFile, Image pressImg, int x, int y, float alpha) { """ 给图片添加图片水印 @param srcImageFile 源图像文件 @param destImageFile 目标图像文件 @param pressImg 水印图片 @param x 修正值。 默认在中间,偏移量相对于中间偏移 @param y 修正值。 默认在中间,偏移量相对于中间偏移 @param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内...
java
public static void pressImage(File srcImageFile, File destImageFile, Image pressImg, int x, int y, float alpha) { pressImage(read(srcImageFile), destImageFile, pressImg, x, y, alpha); }
[ "public", "static", "void", "pressImage", "(", "File", "srcImageFile", ",", "File", "destImageFile", ",", "Image", "pressImg", ",", "int", "x", ",", "int", "y", ",", "float", "alpha", ")", "{", "pressImage", "(", "read", "(", "srcImageFile", ")", ",", "d...
给图片添加图片水印 @param srcImageFile 源图像文件 @param destImageFile 目标图像文件 @param pressImg 水印图片 @param x 修正值。 默认在中间,偏移量相对于中间偏移 @param y 修正值。 默认在中间,偏移量相对于中间偏移 @param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字
[ "给图片添加图片水印" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L876-L878
querydsl/querydsl
querydsl-core/src/main/java/com/querydsl/core/types/dsl/NumberExpression.java
NumberExpression.notBetween
public final <A extends Number & Comparable<?>> BooleanExpression notBetween(A from, A to) { """ Create a {@code this not between from and to} expression <p>Is equivalent to {@code this < from || this > to}</p> @param from inclusive start of range @param to inclusive end of range @return this not between f...
java
public final <A extends Number & Comparable<?>> BooleanExpression notBetween(A from, A to) { return between(from, to).not(); }
[ "public", "final", "<", "A", "extends", "Number", "&", "Comparable", "<", "?", ">", ">", "BooleanExpression", "notBetween", "(", "A", "from", ",", "A", "to", ")", "{", "return", "between", "(", "from", ",", "to", ")", ".", "not", "(", ")", ";", "}"...
Create a {@code this not between from and to} expression <p>Is equivalent to {@code this < from || this > to}</p> @param from inclusive start of range @param to inclusive end of range @return this not between from and to
[ "Create", "a", "{", "@code", "this", "not", "between", "from", "and", "to", "}", "expression" ]
train
https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/NumberExpression.java#L450-L452
pressgang-ccms/PressGangCCMSBuilder
src/main/java/org/jboss/pressgang/ccms/contentspec/builder/DocBookBuilder.java
DocBookBuilder.buildBookEntityFile
protected String buildBookEntityFile(final BuildData buildData) throws BuildProcessingException { """ Builds the book .ent file that is a basic requirement to build the book. @param buildData Information and data structures for the build. @return The book .ent file filled with content from the Content Spec. ...
java
protected String buildBookEntityFile(final BuildData buildData) throws BuildProcessingException { final ContentSpec contentSpec = buildData.getContentSpec(); final StringBuilder retValue = new StringBuilder(); if (!buildData.getBuildOptions().getUseOldBugLinks() && buildData.getBuildOptions()....
[ "protected", "String", "buildBookEntityFile", "(", "final", "BuildData", "buildData", ")", "throws", "BuildProcessingException", "{", "final", "ContentSpec", "contentSpec", "=", "buildData", ".", "getContentSpec", "(", ")", ";", "final", "StringBuilder", "retValue", "...
Builds the book .ent file that is a basic requirement to build the book. @param buildData Information and data structures for the build. @return The book .ent file filled with content from the Content Spec.
[ "Builds", "the", "book", ".", "ent", "file", "that", "is", "a", "basic", "requirement", "to", "build", "the", "book", "." ]
train
https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/DocBookBuilder.java#L2205-L2238
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java
SDBaseOps.squaredNorm
public SDVariable squaredNorm(String name, SDVariable x, int... dimensions) { """ Squared L2 norm: see {@link #norm2(String, SDVariable, int...)} """ return squaredNorm(name, x, false, dimensions); }
java
public SDVariable squaredNorm(String name, SDVariable x, int... dimensions) { return squaredNorm(name, x, false, dimensions); }
[ "public", "SDVariable", "squaredNorm", "(", "String", "name", ",", "SDVariable", "x", ",", "int", "...", "dimensions", ")", "{", "return", "squaredNorm", "(", "name", ",", "x", ",", "false", ",", "dimensions", ")", ";", "}" ]
Squared L2 norm: see {@link #norm2(String, SDVariable, int...)}
[ "Squared", "L2", "norm", ":", "see", "{" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java#L2506-L2508
xebia/Xebium
src/main/java/com/xebia/incubator/xebium/SeleniumDriverFixture.java
SeleniumDriverFixture.startBrowserOnUrlUsingRemoteServerOnHostOnPort
public void startBrowserOnUrlUsingRemoteServerOnHostOnPort(final String browser, final String browserUrl, final String serverHost, final int serverPort) { """ <p><code> | start browser | <i>firefox</i> | on url | <i>http://localhost</i> | using remote server on host | <i>localhost</i> | on port | <i>4444</i> | <...
java
public void startBrowserOnUrlUsingRemoteServerOnHostOnPort(final String browser, final String browserUrl, final String serverHost, final int serverPort) { setCommandProcessor(new HttpCommandProcessorAdapter(new HttpCommandProcessor(serverHost, serverPort, browser, removeAnchorTag(browserUrl)))); commandProcessor.st...
[ "public", "void", "startBrowserOnUrlUsingRemoteServerOnHostOnPort", "(", "final", "String", "browser", ",", "final", "String", "browserUrl", ",", "final", "String", "serverHost", ",", "final", "int", "serverPort", ")", "{", "setCommandProcessor", "(", "new", "HttpComm...
<p><code> | start browser | <i>firefox</i> | on url | <i>http://localhost</i> | using remote server on host | <i>localhost</i> | on port | <i>4444</i> | </code></p> @param browser @param browserUrl @param serverHost @param serverPort @deprecated This call requires a Selenium 1 server. It is advised to use WebDriver.
[ "<p", ">", "<code", ">", "|", "start", "browser", "|", "<i", ">", "firefox<", "/", "i", ">", "|", "on", "url", "|", "<i", ">", "http", ":", "//", "localhost<", "/", "i", ">", "|", "using", "remote", "server", "on", "host", "|", "<i", ">", "loca...
train
https://github.com/xebia/Xebium/blob/594f6d9e65622acdbd03dba0700b17645981da1f/src/main/java/com/xebia/incubator/xebium/SeleniumDriverFixture.java#L225-L230
riversun/bigdoc
src/main/java/org/riversun/bigdoc/bin/BigFileSearcher.java
BigFileSearcher.searchBigFile
public List<Long> searchBigFile(File f, byte[] searchBytes, OnProgressListener listener) { """ Search bytes from big file faster in a concurrent processing with progress callback @param f target file @param searchBytes sequence of bytes you want to search @param listener callback for progress @return ...
java
public List<Long> searchBigFile(File f, byte[] searchBytes, OnProgressListener listener) { this.onRealtimeResultListener = null; this.onProgressListener = listener; int numOfThreadsOptimized = (int) (f.length() / (long) blockSize); if (numOfThreadsOptimized == 0) { numOfThreadsOptimized = 1; } return...
[ "public", "List", "<", "Long", ">", "searchBigFile", "(", "File", "f", ",", "byte", "[", "]", "searchBytes", ",", "OnProgressListener", "listener", ")", "{", "this", ".", "onRealtimeResultListener", "=", "null", ";", "this", ".", "onProgressListener", "=", "...
Search bytes from big file faster in a concurrent processing with progress callback @param f target file @param searchBytes sequence of bytes you want to search @param listener callback for progress @return
[ "Search", "bytes", "from", "big", "file", "faster", "in", "a", "concurrent", "processing", "with", "progress", "callback" ]
train
https://github.com/riversun/bigdoc/blob/46bd7c9a8667be23acdb1ad8286027e4b08cff3a/src/main/java/org/riversun/bigdoc/bin/BigFileSearcher.java#L287-L299
alkacon/opencms-core
src/org/opencms/jsp/Messages.java
Messages.getLocalizedMessage
public static String getLocalizedMessage(CmsMessageContainer container, ServletRequest request) { """ Returns the String for the given CmsMessageContainer localized to the current user's locale if available or to the default locale else. <p> This method allows a static method ({@link CmsJspTagInfo#infoTagActi...
java
public static String getLocalizedMessage(CmsMessageContainer container, ServletRequest request) { CmsObject cms = CmsFlexController.getCmsObject(request); return getLocalizedMessage(container, cms); }
[ "public", "static", "String", "getLocalizedMessage", "(", "CmsMessageContainer", "container", ",", "ServletRequest", "request", ")", "{", "CmsObject", "cms", "=", "CmsFlexController", ".", "getCmsObject", "(", "request", ")", ";", "return", "getLocalizedMessage", "(",...
Returns the String for the given CmsMessageContainer localized to the current user's locale if available or to the default locale else. <p> This method allows a static method ({@link CmsJspTagInfo#infoTagAction(String, javax.servlet.http.HttpServletRequest)}) that has no <code>pageContext</code> in scope to lookup the...
[ "Returns", "the", "String", "for", "the", "given", "CmsMessageContainer", "localized", "to", "the", "current", "user", "s", "locale", "if", "available", "or", "to", "the", "default", "locale", "else", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/Messages.java#L336-L341
jnidzwetzki/bitfinex-v2-wss-api-java
src/main/java/com/github/jnidzwetzki/bitfinex/v2/symbol/BitfinexSymbols.java
BitfinexSymbols.rawOrderBook
public static BitfinexOrderBookSymbol rawOrderBook(final String currency, final String profitCurrency) { """ Returns symbol for raw order book channel @param currency of raw order book channel @param profitCurrency of raw order book channel @return symbol """ final String currencyNonNull = O...
java
public static BitfinexOrderBookSymbol rawOrderBook(final String currency, final String profitCurrency) { final String currencyNonNull = Objects.requireNonNull(currency).toUpperCase(); final String profitCurrencyNonNull = Objects.requireNonNull(profitCurrency).toUpperCase(); return rawOr...
[ "public", "static", "BitfinexOrderBookSymbol", "rawOrderBook", "(", "final", "String", "currency", ",", "final", "String", "profitCurrency", ")", "{", "final", "String", "currencyNonNull", "=", "Objects", ".", "requireNonNull", "(", "currency", ")", ".", "toUpperCas...
Returns symbol for raw order book channel @param currency of raw order book channel @param profitCurrency of raw order book channel @return symbol
[ "Returns", "symbol", "for", "raw", "order", "book", "channel" ]
train
https://github.com/jnidzwetzki/bitfinex-v2-wss-api-java/blob/2e6adf1eb6f8cd4c8722f1619f78ab2cc3c600ee/src/main/java/com/github/jnidzwetzki/bitfinex/v2/symbol/BitfinexSymbols.java#L118-L123
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java
ByteArrayUtil.readLong
public static long readLong(byte[] array, int offset) { """ Read a long from the byte array at the given offset. @param array Array to read from @param offset Offset to read at @return data """ // First make integers to resolve signed vs. unsigned issues. long b0 = array[offset + 0]; long b1 =...
java
public static long readLong(byte[] array, int offset) { // First make integers to resolve signed vs. unsigned issues. long b0 = array[offset + 0]; long b1 = array[offset + 1] & 0xFF; long b2 = array[offset + 2] & 0xFF; long b3 = array[offset + 3] & 0xFF; long b4 = array[offset + 4] & 0xFF; i...
[ "public", "static", "long", "readLong", "(", "byte", "[", "]", "array", ",", "int", "offset", ")", "{", "// First make integers to resolve signed vs. unsigned issues.", "long", "b0", "=", "array", "[", "offset", "+", "0", "]", ";", "long", "b1", "=", "array", ...
Read a long from the byte array at the given offset. @param array Array to read from @param offset Offset to read at @return data
[ "Read", "a", "long", "from", "the", "byte", "array", "at", "the", "given", "offset", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java#L223-L234
HsiangLeekwok/hlklib
hlklib/src/main/java/com/hlk/hlklib/etc/Cryptography.java
Cryptography.fileMessageDigest
private static String fileMessageDigest(String filePath, String algorithm) { """ 获取文件的指定信息 @param filePath 文件路径 @param algorithm 算法 @return 字符串 """ String result = null; try { result = new ComputeTask().exec(filePath, algorithm).get(); } catch (Exception e) { ...
java
private static String fileMessageDigest(String filePath, String algorithm) { String result = null; try { result = new ComputeTask().exec(filePath, algorithm).get(); } catch (Exception e) { e.printStackTrace(); } return result; }
[ "private", "static", "String", "fileMessageDigest", "(", "String", "filePath", ",", "String", "algorithm", ")", "{", "String", "result", "=", "null", ";", "try", "{", "result", "=", "new", "ComputeTask", "(", ")", ".", "exec", "(", "filePath", ",", "algori...
获取文件的指定信息 @param filePath 文件路径 @param algorithm 算法 @return 字符串
[ "获取文件的指定信息" ]
train
https://github.com/HsiangLeekwok/hlklib/blob/b122f6dcab7cec60c8e5455e0c31613d08bec6ad/hlklib/src/main/java/com/hlk/hlklib/etc/Cryptography.java#L90-L99
citrusframework/citrus
modules/citrus-jmx/src/main/java/com/consol/citrus/jmx/model/ManagedBeanDefinition.java
ManagedBeanDefinition.createObjectName
public ObjectName createObjectName() { """ Constructs proper object name either from given domain and name property or by evaluating the mbean type class information. @return """ try { if (StringUtils.hasText(objectName)) { return new ObjectName(objectDomain + ":" + obje...
java
public ObjectName createObjectName() { try { if (StringUtils.hasText(objectName)) { return new ObjectName(objectDomain + ":" + objectName); } if (type != null) { if (StringUtils.hasText(objectDomain)) { return new ObjectNam...
[ "public", "ObjectName", "createObjectName", "(", ")", "{", "try", "{", "if", "(", "StringUtils", ".", "hasText", "(", "objectName", ")", ")", "{", "return", "new", "ObjectName", "(", "objectDomain", "+", "\":\"", "+", "objectName", ")", ";", "}", "if", "...
Constructs proper object name either from given domain and name property or by evaluating the mbean type class information. @return
[ "Constructs", "proper", "object", "name", "either", "from", "given", "domain", "and", "name", "property", "or", "by", "evaluating", "the", "mbean", "type", "class", "information", "." ]
train
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-jmx/src/main/java/com/consol/citrus/jmx/model/ManagedBeanDefinition.java#L51-L69
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/analyzer/AssemblyAnalyzer.java
AssemblyAnalyzer.addMatchingValues
protected static void addMatchingValues(List<String> packages, String value, Dependency dep, EvidenceType type) { """ Cycles through the collection of class name information to see if parts of the package names are contained in the provided value. If found, it will be added as the HIGHEST confidence evidence bec...
java
protected static void addMatchingValues(List<String> packages, String value, Dependency dep, EvidenceType type) { if (value == null || value.isEmpty() || packages == null || packages.isEmpty()) { return; } for (String key : packages) { final int pos = StringUtils.indexOfI...
[ "protected", "static", "void", "addMatchingValues", "(", "List", "<", "String", ">", "packages", ",", "String", "value", ",", "Dependency", "dep", ",", "EvidenceType", "type", ")", "{", "if", "(", "value", "==", "null", "||", "value", ".", "isEmpty", "(", ...
Cycles through the collection of class name information to see if parts of the package names are contained in the provided value. If found, it will be added as the HIGHEST confidence evidence because we have more then one source corroborating the value. @param packages a collection of class name information @param val...
[ "Cycles", "through", "the", "collection", "of", "class", "name", "information", "to", "see", "if", "parts", "of", "the", "package", "names", "are", "contained", "in", "the", "provided", "value", ".", "If", "found", "it", "will", "be", "added", "as", "the",...
train
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/AssemblyAnalyzer.java#L480-L495
census-instrumentation/opencensus-java
impl_core/src/main/java/io/opencensus/implcore/internal/VarInt.java
VarInt.putVarInt
public static void putVarInt(int v, OutputStream outputStream) throws IOException { """ Encodes an integer in a variable-length encoding, 7 bits per byte, and writes it to the given OutputStream. @param v the value to encode @param outputStream the OutputStream to write to """ byte[] bytes = new byte[...
java
public static void putVarInt(int v, OutputStream outputStream) throws IOException { byte[] bytes = new byte[varIntSize(v)]; putVarInt(v, bytes, 0); outputStream.write(bytes); }
[ "public", "static", "void", "putVarInt", "(", "int", "v", ",", "OutputStream", "outputStream", ")", "throws", "IOException", "{", "byte", "[", "]", "bytes", "=", "new", "byte", "[", "varIntSize", "(", "v", ")", "]", ";", "putVarInt", "(", "v", ",", "by...
Encodes an integer in a variable-length encoding, 7 bits per byte, and writes it to the given OutputStream. @param v the value to encode @param outputStream the OutputStream to write to
[ "Encodes", "an", "integer", "in", "a", "variable", "-", "length", "encoding", "7", "bits", "per", "byte", "and", "writes", "it", "to", "the", "given", "OutputStream", "." ]
train
https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/impl_core/src/main/java/io/opencensus/implcore/internal/VarInt.java#L186-L190
yavijava/yavijava
src/main/java/com/vmware/vim25/ws/SoapClient.java
SoapClient.unMarshall
public Object unMarshall(String returnType, InputStream is) throws Exception { """ This method will unmarshall the response inputstream to Java Object of returnType type. @param returnType @param is @return Object - Converted Response inputstream """ return xmlGen.fromXML(returnType, is); }
java
public Object unMarshall(String returnType, InputStream is) throws Exception { return xmlGen.fromXML(returnType, is); }
[ "public", "Object", "unMarshall", "(", "String", "returnType", ",", "InputStream", "is", ")", "throws", "Exception", "{", "return", "xmlGen", ".", "fromXML", "(", "returnType", ",", "is", ")", ";", "}" ]
This method will unmarshall the response inputstream to Java Object of returnType type. @param returnType @param is @return Object - Converted Response inputstream
[ "This", "method", "will", "unmarshall", "the", "response", "inputstream", "to", "Java", "Object", "of", "returnType", "type", "." ]
train
https://github.com/yavijava/yavijava/blob/27fd2c5826115782d5eeb934f86e3e39240179cd/src/main/java/com/vmware/vim25/ws/SoapClient.java#L254-L256
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/FieldAnnotation.java
FieldAnnotation.isRead
public static FieldAnnotation isRead(Instruction ins, ConstantPoolGen cpg) { """ Is the given instruction a read of a field? @param ins the Instruction to check @param cpg ConstantPoolGen of the method containing the instruction @return the Field if the instruction is a read of a field, null otherwise "...
java
public static FieldAnnotation isRead(Instruction ins, ConstantPoolGen cpg) { if (ins instanceof GETFIELD || ins instanceof GETSTATIC) { FieldInstruction fins = (FieldInstruction) ins; String className = fins.getClassName(cpg); return new FieldAnnotation(className, fins.getNam...
[ "public", "static", "FieldAnnotation", "isRead", "(", "Instruction", "ins", ",", "ConstantPoolGen", "cpg", ")", "{", "if", "(", "ins", "instanceof", "GETFIELD", "||", "ins", "instanceof", "GETSTATIC", ")", "{", "FieldInstruction", "fins", "=", "(", "FieldInstruc...
Is the given instruction a read of a field? @param ins the Instruction to check @param cpg ConstantPoolGen of the method containing the instruction @return the Field if the instruction is a read of a field, null otherwise
[ "Is", "the", "given", "instruction", "a", "read", "of", "a", "field?" ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/FieldAnnotation.java#L231-L239
pietermartin/sqlg
sqlg-core/src/main/java/org/umlg/sqlg/structure/TransactionCache.java
TransactionCache.putVertexIfAbsent
SqlgVertex putVertexIfAbsent(SqlgGraph sqlgGraph, String schema, String table, Long id) { """ The recordId is not referenced in the SqlgVertex. It is important that the value of the WeakHashMap does not reference the key. @param sqlgGraph The graph @return the vertex. If cacheVertices is true and the vertex i...
java
SqlgVertex putVertexIfAbsent(SqlgGraph sqlgGraph, String schema, String table, Long id) { RecordId recordId = RecordId.from(SchemaTable.of(schema, table), id); SqlgVertex sqlgVertex; if (this.cacheVertices) { sqlgVertex = this.vertexCache.get(recordId); if (sqlgVertex == ...
[ "SqlgVertex", "putVertexIfAbsent", "(", "SqlgGraph", "sqlgGraph", ",", "String", "schema", ",", "String", "table", ",", "Long", "id", ")", "{", "RecordId", "recordId", "=", "RecordId", ".", "from", "(", "SchemaTable", ".", "of", "(", "schema", ",", "table", ...
The recordId is not referenced in the SqlgVertex. It is important that the value of the WeakHashMap does not reference the key. @param sqlgGraph The graph @return the vertex. If cacheVertices is true and the vertex is cached then the cached vertex will be returned else a the vertex will be instantiated.
[ "The", "recordId", "is", "not", "referenced", "in", "the", "SqlgVertex", ".", "It", "is", "important", "that", "the", "value", "of", "the", "WeakHashMap", "does", "not", "reference", "the", "key", "." ]
train
https://github.com/pietermartin/sqlg/blob/c1845a1b31328a5ffda646873b0369ee72af56a7/sqlg-core/src/main/java/org/umlg/sqlg/structure/TransactionCache.java#L105-L119
networknt/light-4j
utility/src/main/java/com/networknt/utility/RegExUtils.java
RegExUtils.replaceAll
public static String replaceAll(final String text, final Pattern regex, final String replacement) { """ <p>Replaces each substring of the text String that matches the given regular expression pattern with the given replacement.</p> This method is a {@code null} safe equivalent to: <ul> <li>{@code pattern.matc...
java
public static String replaceAll(final String text, final Pattern regex, final String replacement) { if (text == null || regex == null || replacement == null) { return text; } return regex.matcher(text).replaceAll(replacement); }
[ "public", "static", "String", "replaceAll", "(", "final", "String", "text", ",", "final", "Pattern", "regex", ",", "final", "String", "replacement", ")", "{", "if", "(", "text", "==", "null", "||", "regex", "==", "null", "||", "replacement", "==", "null", ...
<p>Replaces each substring of the text String that matches the given regular expression pattern with the given replacement.</p> This method is a {@code null} safe equivalent to: <ul> <li>{@code pattern.matcher(text).replaceAll(replacement)}</li> </ul> <p>A {@code null} reference passed to this method is a no-op.</p> ...
[ "<p", ">", "Replaces", "each", "substring", "of", "the", "text", "String", "that", "matches", "the", "given", "regular", "expression", "pattern", "with", "the", "given", "replacement", ".", "<", "/", "p", ">" ]
train
https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/utility/src/main/java/com/networknt/utility/RegExUtils.java#L258-L263
hypfvieh/java-utils
src/main/java/com/github/hypfvieh/system/NativeLibraryLoader.java
NativeLibraryLoader.loadFromStream
private Throwable loadFromStream(String _fileNameWithPath, InputStream _libAsStream) { """ Loads a library from the given stream, using the given filename (including path). @param _fileNameWithPath filename with path @param _libAsStream library is input stream @return {@link Throwable} if any Exception/Error ...
java
private Throwable loadFromStream(String _fileNameWithPath, InputStream _libAsStream) { String fileExt = getFileExtension(_fileNameWithPath); String prefix = _fileNameWithPath.replace(new File(_fileNameWithPath).getParent(), "").replace("." + fileExt, ""); // extract the library try { ...
[ "private", "Throwable", "loadFromStream", "(", "String", "_fileNameWithPath", ",", "InputStream", "_libAsStream", ")", "{", "String", "fileExt", "=", "getFileExtension", "(", "_fileNameWithPath", ")", ";", "String", "prefix", "=", "_fileNameWithPath", ".", "replace", ...
Loads a library from the given stream, using the given filename (including path). @param _fileNameWithPath filename with path @param _libAsStream library is input stream @return {@link Throwable} if any Exception/Error occurs, null otherwise
[ "Loads", "a", "library", "from", "the", "given", "stream", "using", "the", "given", "filename", "(", "including", "path", ")", "." ]
train
https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/system/NativeLibraryLoader.java#L153-L169
bluelinelabs/Conductor
conductor/src/main/java/com/bluelinelabs/conductor/Router.java
Router.popToTag
@SuppressWarnings("WeakerAccess") @UiThread public boolean popToTag(@NonNull String tag, @Nullable ControllerChangeHandler changeHandler) { """ Pops all {@link Controller}s until the {@link Controller} with the passed tag is at the top @param tag The tag being popped to @param changeHandler T...
java
@SuppressWarnings("WeakerAccess") @UiThread public boolean popToTag(@NonNull String tag, @Nullable ControllerChangeHandler changeHandler) { ThreadUtils.ensureMainThread(); for (RouterTransaction transaction : backstack) { if (tag.equals(transaction.tag())) { popToTra...
[ "@", "SuppressWarnings", "(", "\"WeakerAccess\"", ")", "@", "UiThread", "public", "boolean", "popToTag", "(", "@", "NonNull", "String", "tag", ",", "@", "Nullable", "ControllerChangeHandler", "changeHandler", ")", "{", "ThreadUtils", ".", "ensureMainThread", "(", ...
Pops all {@link Controller}s until the {@link Controller} with the passed tag is at the top @param tag The tag being popped to @param changeHandler The {@link ControllerChangeHandler} to handle this transaction @return Whether or not the {@link Controller} with the passed tag is now at the top
[ "Pops", "all", "{", "@link", "Controller", "}", "s", "until", "the", "{", "@link", "Controller", "}", "with", "the", "passed", "tag", "is", "at", "the", "top" ]
train
https://github.com/bluelinelabs/Conductor/blob/94c9121bb16f93b481954513a8e3905846829fb2/conductor/src/main/java/com/bluelinelabs/conductor/Router.java#L315-L327
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Path.java
Path.acceptVisitor
public void acceptVisitor(CFG cfg, PathVisitor visitor) { """ Accept a PathVisitor. @param cfg the control flow graph @param visitor a PathVisitor """ if (getLength() > 0) { BasicBlock startBlock = cfg.lookupBlockByLabel(getBlockIdAt(0)); acceptVisitorStartingFromLocation(...
java
public void acceptVisitor(CFG cfg, PathVisitor visitor) { if (getLength() > 0) { BasicBlock startBlock = cfg.lookupBlockByLabel(getBlockIdAt(0)); acceptVisitorStartingFromLocation(cfg, visitor, startBlock, startBlock.getFirstInstruction()); } }
[ "public", "void", "acceptVisitor", "(", "CFG", "cfg", ",", "PathVisitor", "visitor", ")", "{", "if", "(", "getLength", "(", ")", ">", "0", ")", "{", "BasicBlock", "startBlock", "=", "cfg", ".", "lookupBlockByLabel", "(", "getBlockIdAt", "(", "0", ")", ")...
Accept a PathVisitor. @param cfg the control flow graph @param visitor a PathVisitor
[ "Accept", "a", "PathVisitor", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Path.java#L134-L139
aws/aws-sdk-java
aws-java-sdk-connect/src/main/java/com/amazonaws/services/connect/model/StartOutboundVoiceContactRequest.java
StartOutboundVoiceContactRequest.withAttributes
public StartOutboundVoiceContactRequest withAttributes(java.util.Map<String, String> attributes) { """ <p> Specify a custom key-value pair using an attribute map. The attributes are standard Amazon Connect attributes, and can be accessed in contact flows just like any other contact attributes. </p> <p> There ...
java
public StartOutboundVoiceContactRequest withAttributes(java.util.Map<String, String> attributes) { setAttributes(attributes); return this; }
[ "public", "StartOutboundVoiceContactRequest", "withAttributes", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "attributes", ")", "{", "setAttributes", "(", "attributes", ")", ";", "return", "this", ";", "}" ]
<p> Specify a custom key-value pair using an attribute map. The attributes are standard Amazon Connect attributes, and can be accessed in contact flows just like any other contact attributes. </p> <p> There can be up to 32,768 UTF-8 bytes across all key-value pairs per contact. Attribute keys can include only alphanume...
[ "<p", ">", "Specify", "a", "custom", "key", "-", "value", "pair", "using", "an", "attribute", "map", ".", "The", "attributes", "are", "standard", "Amazon", "Connect", "attributes", "and", "can", "be", "accessed", "in", "contact", "flows", "just", "like", "...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-connect/src/main/java/com/amazonaws/services/connect/model/StartOutboundVoiceContactRequest.java#L533-L536
netty/netty
handler/src/main/java/io/netty/handler/traffic/TrafficCounter.java
TrafficCounter.writeTimeToWait
@Deprecated public long writeTimeToWait(final long size, final long limitTraffic, final long maxTime) { """ Returns the time to wait (if any) for the given length message, using the given limitTraffic and the max wait time. @param size the write size @param limitTraffic the traffic limit in bytes per se...
java
@Deprecated public long writeTimeToWait(final long size, final long limitTraffic, final long maxTime) { return writeTimeToWait(size, limitTraffic, maxTime, milliSecondFromNano()); }
[ "@", "Deprecated", "public", "long", "writeTimeToWait", "(", "final", "long", "size", ",", "final", "long", "limitTraffic", ",", "final", "long", "maxTime", ")", "{", "return", "writeTimeToWait", "(", "size", ",", "limitTraffic", ",", "maxTime", ",", "milliSec...
Returns the time to wait (if any) for the given length message, using the given limitTraffic and the max wait time. @param size the write size @param limitTraffic the traffic limit in bytes per second. @param maxTime the max time in ms to wait in case of excess of traffic. @return the current time to wait (in ms) if n...
[ "Returns", "the", "time", "to", "wait", "(", "if", "any", ")", "for", "the", "given", "length", "message", "using", "the", "given", "limitTraffic", "and", "the", "max", "wait", "time", "." ]
train
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/traffic/TrafficCounter.java#L555-L558
alkacon/opencms-core
src/org/opencms/acacia/shared/CmsEntity.java
CmsEntity.addAttributeValue
public void addAttributeValue(String attributeName, CmsEntity value) { """ Adds the given attribute value.<p> @param attributeName the attribute name @param value the attribute value """ if (m_simpleAttributes.containsKey(attributeName)) { throw new RuntimeException("Attribute alrea...
java
public void addAttributeValue(String attributeName, CmsEntity value) { if (m_simpleAttributes.containsKey(attributeName)) { throw new RuntimeException("Attribute already exists with a simple type value."); } if (m_entityAttributes.containsKey(attributeName)) { m_en...
[ "public", "void", "addAttributeValue", "(", "String", "attributeName", ",", "CmsEntity", "value", ")", "{", "if", "(", "m_simpleAttributes", ".", "containsKey", "(", "attributeName", ")", ")", "{", "throw", "new", "RuntimeException", "(", "\"Attribute already exists...
Adds the given attribute value.<p> @param attributeName the attribute name @param value the attribute value
[ "Adds", "the", "given", "attribute", "value", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/acacia/shared/CmsEntity.java#L226-L240
Alluxio/alluxio
core/common/src/main/java/alluxio/grpc/GrpcServerBuilder.java
GrpcServerBuilder.forAddress
public static GrpcServerBuilder forAddress(String hostName, SocketAddress address, AuthenticationServer authenticationServer, AlluxioConfiguration conf) { """ Create an new instance of {@link GrpcServerBuilder} with authentication support. @param hostName the host name @param address the address @param ...
java
public static GrpcServerBuilder forAddress(String hostName, SocketAddress address, AuthenticationServer authenticationServer, AlluxioConfiguration conf) { return new GrpcServerBuilder(hostName, address, authenticationServer, conf); }
[ "public", "static", "GrpcServerBuilder", "forAddress", "(", "String", "hostName", ",", "SocketAddress", "address", ",", "AuthenticationServer", "authenticationServer", ",", "AlluxioConfiguration", "conf", ")", "{", "return", "new", "GrpcServerBuilder", "(", "hostName", ...
Create an new instance of {@link GrpcServerBuilder} with authentication support. @param hostName the host name @param address the address @param authenticationServer the authentication server to use @param conf the Alluxio configuration @return a new instance of {@link GrpcServerBuilder}
[ "Create", "an", "new", "instance", "of", "{", "@link", "GrpcServerBuilder", "}", "with", "authentication", "support", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/grpc/GrpcServerBuilder.java#L88-L91
census-instrumentation/opencensus-java
api/src/main/java/io/opencensus/trace/BigendianEncoding.java
BigendianEncoding.longFromByteArray
static long longFromByteArray(byte[] bytes, int offset) { """ Returns the {@code long} value whose big-endian representation is stored in the first 8 bytes of {@code bytes} starting from the {@code offset}. @param bytes the byte array representation of the {@code long}. @param offset the starting offset in th...
java
static long longFromByteArray(byte[] bytes, int offset) { Utils.checkArgument(bytes.length >= offset + LONG_BYTES, "array too small"); return (bytes[offset] & 0xFFL) << 56 | (bytes[offset + 1] & 0xFFL) << 48 | (bytes[offset + 2] & 0xFFL) << 40 | (bytes[offset + 3] & 0xFFL) << 32 ...
[ "static", "long", "longFromByteArray", "(", "byte", "[", "]", "bytes", ",", "int", "offset", ")", "{", "Utils", ".", "checkArgument", "(", "bytes", ".", "length", ">=", "offset", "+", "LONG_BYTES", ",", "\"array too small\"", ")", ";", "return", "(", "byte...
Returns the {@code long} value whose big-endian representation is stored in the first 8 bytes of {@code bytes} starting from the {@code offset}. @param bytes the byte array representation of the {@code long}. @param offset the starting offset in the byte array. @return the {@code long} value whose big-endian represent...
[ "Returns", "the", "{", "@code", "long", "}", "value", "whose", "big", "-", "endian", "representation", "is", "stored", "in", "the", "first", "8", "bytes", "of", "{", "@code", "bytes", "}", "starting", "from", "the", "{", "@code", "offset", "}", "." ]
train
https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/api/src/main/java/io/opencensus/trace/BigendianEncoding.java#L59-L69
salesforce/Argus
ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/NamespaceResources.java
NamespaceResources.createNamespace
@POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Description("Creates a new namepsace.") public NamespaceDto createNamespace(@Context HttpServletRequest req, NamespaceDto namespaceDto) { """ Creates a new namespace. @param req The HTTP request. @p...
java
@POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Description("Creates a new namepsace.") public NamespaceDto createNamespace(@Context HttpServletRequest req, NamespaceDto namespaceDto) { if (namespaceDto == null) { throw new WebApplicationException("...
[ "@", "POST", "@", "Consumes", "(", "MediaType", ".", "APPLICATION_JSON", ")", "@", "Produces", "(", "MediaType", ".", "APPLICATION_JSON", ")", "@", "Description", "(", "\"Creates a new namepsace.\"", ")", "public", "NamespaceDto", "createNamespace", "(", "@", "Con...
Creates a new namespace. @param req The HTTP request. @param namespaceDto The namespace to create. @return The updated namespace DTO for the created namespace. @throws WebApplicationException If an error occurs.
[ "Creates", "a", "new", "namespace", "." ]
train
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/NamespaceResources.java#L102-L116
UrielCh/ovh-java-sdk
ovh-java-sdk-service/src/main/java/net/minidev/ovh/api/ApiOvhService.java
ApiOvhService.serviceId_PUT
public void serviceId_PUT(Long serviceId, OvhService body) throws IOException { """ Alter this object properties REST: PUT /service/{serviceId} @param body [required] New object properties @param serviceId [required] The internal ID of your service API beta """ String qPath = "/service/{serviceId}"; ...
java
public void serviceId_PUT(Long serviceId, OvhService body) throws IOException { String qPath = "/service/{serviceId}"; StringBuilder sb = path(qPath, serviceId); exec(qPath, "PUT", sb.toString(), body); }
[ "public", "void", "serviceId_PUT", "(", "Long", "serviceId", ",", "OvhService", "body", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/service/{serviceId}\"", ";", "StringBuilder", "sb", "=", "path", "(", "qPath", ",", "serviceId", ")", ";", "e...
Alter this object properties REST: PUT /service/{serviceId} @param body [required] New object properties @param serviceId [required] The internal ID of your service API beta
[ "Alter", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-service/src/main/java/net/minidev/ovh/api/ApiOvhService.java#L76-L80
jMotif/SAX
src/main/java/net/seninp/jmotif/sax/TSProcessor.java
TSProcessor.num2index
public int num2index(double value, double[] cuts) { """ Get mapping of number to cut index. @param value the value to map. @param cuts the array of intervals. @return character corresponding to numeric value. """ int count = 0; while ((count < cuts.length) && (cuts[count] <= value)) { cou...
java
public int num2index(double value, double[] cuts) { int count = 0; while ((count < cuts.length) && (cuts[count] <= value)) { count++; } return count; }
[ "public", "int", "num2index", "(", "double", "value", ",", "double", "[", "]", "cuts", ")", "{", "int", "count", "=", "0", ";", "while", "(", "(", "count", "<", "cuts", ".", "length", ")", "&&", "(", "cuts", "[", "count", "]", "<=", "value", ")",...
Get mapping of number to cut index. @param value the value to map. @param cuts the array of intervals. @return character corresponding to numeric value.
[ "Get", "mapping", "of", "number", "to", "cut", "index", "." ]
train
https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/TSProcessor.java#L427-L433
ist-dresden/composum
sling/core/commons/src/main/java/com/composum/sling/core/AbstractSlingBean.java
AbstractSlingBean.getParent
public ResourceHandle getParent(String resourceType, String path) { """ Use path instead of resource (e.g. if resource is synthetic or non existing) to determine a typed parent. """ ResourceResolver resolver = getResolver(); Resource resource; while (((resource = resolver.getResource(pa...
java
public ResourceHandle getParent(String resourceType, String path) { ResourceResolver resolver = getResolver(); Resource resource; while (((resource = resolver.getResource(path)) == null || !resource.isResourceType(resourceType)) && StringUtils.isNotBlank(path)) { int ...
[ "public", "ResourceHandle", "getParent", "(", "String", "resourceType", ",", "String", "path", ")", "{", "ResourceResolver", "resolver", "=", "getResolver", "(", ")", ";", "Resource", "resource", ";", "while", "(", "(", "(", "resource", "=", "resolver", ".", ...
Use path instead of resource (e.g. if resource is synthetic or non existing) to determine a typed parent.
[ "Use", "path", "instead", "of", "resource", "(", "e", ".", "g", ".", "if", "resource", "is", "synthetic", "or", "non", "existing", ")", "to", "determine", "a", "typed", "parent", "." ]
train
https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/AbstractSlingBean.java#L214-L227
cdk/cdk
base/core/src/main/java/org/openscience/cdk/config/AtomTypeFactory.java
AtomTypeFactory.getInstance
public static AtomTypeFactory getInstance(String configFile, IChemObjectBuilder builder) { """ Method to create a specialized AtomTypeFactory. Available lists in CDK are: <ul> <li>org/openscience/cdk/config/data/jmol_atomtypes.txt <li>org/openscience/cdk/config/data/mol2_atomtypes.xml <li>org/openscience/cdk/c...
java
public static AtomTypeFactory getInstance(String configFile, IChemObjectBuilder builder) { if (tables == null) { tables = new Hashtable<String, AtomTypeFactory>(); } if (!(tables.containsKey(configFile))) { tables.put(configFile, new AtomTypeFactory(configFile, builder));...
[ "public", "static", "AtomTypeFactory", "getInstance", "(", "String", "configFile", ",", "IChemObjectBuilder", "builder", ")", "{", "if", "(", "tables", "==", "null", ")", "{", "tables", "=", "new", "Hashtable", "<", "String", ",", "AtomTypeFactory", ">", "(", ...
Method to create a specialized AtomTypeFactory. Available lists in CDK are: <ul> <li>org/openscience/cdk/config/data/jmol_atomtypes.txt <li>org/openscience/cdk/config/data/mol2_atomtypes.xml <li>org/openscience/cdk/config/data/structgen_atomtypes.xml <li>org/openscience/cdk/config/data/mm2_atomtypes.xml <li>org/opensci...
[ "Method", "to", "create", "a", "specialized", "AtomTypeFactory", ".", "Available", "lists", "in", "CDK", "are", ":", "<ul", ">", "<li", ">", "org", "/", "openscience", "/", "cdk", "/", "config", "/", "data", "/", "jmol_atomtypes", ".", "txt", "<li", ">",...
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/config/AtomTypeFactory.java#L160-L168
dbracewell/mango
src/main/java/com/davidbracewell/json/JsonWriter.java
JsonWriter.value
public JsonWriter value(Map<String, ?> map) throws IOException { """ Writes a map @param map the map to be written @return This structured writer @throws IOException Something went wrong writing """ if (map == null) { nullValue(); } else { boolean inObject = inObject(); ...
java
public JsonWriter value(Map<String, ?> map) throws IOException { if (map == null) { nullValue(); } else { boolean inObject = inObject(); if (!inObject) beginObject(); for (Map.Entry<String, ?> entry : map.entrySet()) { property(entry.getKey(), entry.getValue()...
[ "public", "JsonWriter", "value", "(", "Map", "<", "String", ",", "?", ">", "map", ")", "throws", "IOException", "{", "if", "(", "map", "==", "null", ")", "{", "nullValue", "(", ")", ";", "}", "else", "{", "boolean", "inObject", "=", "inObject", "(", ...
Writes a map @param map the map to be written @return This structured writer @throws IOException Something went wrong writing
[ "Writes", "a", "map" ]
train
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/json/JsonWriter.java#L403-L416
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/modules/r/houghes/HoughCircles.java
HoughCircles.getCenterPoints
private Coordinate[] getCenterPoints( double[][][] houghValues, int maxCircles ) { """ Search for a fixed number of circles. @param maxCircles The number of circles that should be found. @param houghValues """ Coordinate[] centerPoints = new Coordinate[maxCircles]; int xMax = 0; in...
java
private Coordinate[] getCenterPoints( double[][][] houghValues, int maxCircles ) { Coordinate[] centerPoints = new Coordinate[maxCircles]; int xMax = 0; int yMax = 0; int rMax = 0; for( int c = 0; c < maxCircles; c++ ) { double counterMax = -1; for( int ...
[ "private", "Coordinate", "[", "]", "getCenterPoints", "(", "double", "[", "]", "[", "]", "[", "]", "houghValues", ",", "int", "maxCircles", ")", "{", "Coordinate", "[", "]", "centerPoints", "=", "new", "Coordinate", "[", "maxCircles", "]", ";", "int", "x...
Search for a fixed number of circles. @param maxCircles The number of circles that should be found. @param houghValues
[ "Search", "for", "a", "fixed", "number", "of", "circles", "." ]
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/r/houghes/HoughCircles.java#L315-L345
yangjm/winlet
utils/src/main/java/com/aggrepoint/utils/StringUtils.java
StringUtils.strFromUnicodeByteArray
public static String strFromUnicodeByteArray(byte[] ba, int len) { """ 将Unicode的Byte Array转换为Java字符串 @param ba byte[] Unicode的Byte Array @return String 转换结果 """ if (ba == null) { return ""; } byte[] newBa = new byte[len]; for (int i = 0; i < len; i++) newBa[i] = ba[i]; StringBuffer sb = ...
java
public static String strFromUnicodeByteArray(byte[] ba, int len) { if (ba == null) { return ""; } byte[] newBa = new byte[len]; for (int i = 0; i < len; i++) newBa[i] = ba[i]; StringBuffer sb = new StringBuffer(); DataInputStream dis = new DataInputStream(new ByteArrayInputStream( newBa)); whi...
[ "public", "static", "String", "strFromUnicodeByteArray", "(", "byte", "[", "]", "ba", ",", "int", "len", ")", "{", "if", "(", "ba", "==", "null", ")", "{", "return", "\"\"", ";", "}", "byte", "[", "]", "newBa", "=", "new", "byte", "[", "len", "]", ...
将Unicode的Byte Array转换为Java字符串 @param ba byte[] Unicode的Byte Array @return String 转换结果
[ "将Unicode的Byte", "Array转换为Java字符串" ]
train
https://github.com/yangjm/winlet/blob/2126236f56858e283fa6ad69fe9279ee30f47b67/utils/src/main/java/com/aggrepoint/utils/StringUtils.java#L268-L289
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/extras/DOMConfigurator.java
DOMConfigurator.configureAndWatch
static public void configureAndWatch(String configFilename, long delay) { """ Read the configuration file <code>configFilename</code> if it exists. Moreover, a thread will be created that will periodically check if <code>configFilename</code> has been created or modified. The period is determined by the <co...
java
static public void configureAndWatch(String configFilename, long delay) { XMLWatchdog xdog = new XMLWatchdog(configFilename); xdog.setDelay(delay); xdog.start(); }
[ "static", "public", "void", "configureAndWatch", "(", "String", "configFilename", ",", "long", "delay", ")", "{", "XMLWatchdog", "xdog", "=", "new", "XMLWatchdog", "(", "configFilename", ")", ";", "xdog", ".", "setDelay", "(", "delay", ")", ";", "xdog", ".",...
Read the configuration file <code>configFilename</code> if it exists. Moreover, a thread will be created that will periodically check if <code>configFilename</code> has been created or modified. The period is determined by the <code>delay</code> argument. If a change or file creation is detected, then <code>configFilen...
[ "Read", "the", "configuration", "file", "<code", ">", "configFilename<", "/", "code", ">", "if", "it", "exists", ".", "Moreover", "a", "thread", "will", "be", "created", "that", "will", "periodically", "check", "if", "<code", ">", "configFilename<", "/", "co...
train
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/extras/DOMConfigurator.java#L643-L649
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/FileUtil.java
FileUtil.symLink
public static int symLink(String target, String linkname) throws IOException { """ Create a soft link between a src and destination only on a local disk. HDFS does not support this @param target the target for symlink @param linkname the symlink @return value returned by the command """ String cmd = "l...
java
public static int symLink(String target, String linkname) throws IOException{ String cmd = "ln -s " + target + " " + linkname; Process p = Runtime.getRuntime().exec(cmd, null); int returnVal = -1; try{ returnVal = p.waitFor(); } catch(InterruptedException e){ //do nothing as of yet }...
[ "public", "static", "int", "symLink", "(", "String", "target", ",", "String", "linkname", ")", "throws", "IOException", "{", "String", "cmd", "=", "\"ln -s \"", "+", "target", "+", "\" \"", "+", "linkname", ";", "Process", "p", "=", "Runtime", ".", "getRun...
Create a soft link between a src and destination only on a local disk. HDFS does not support this @param target the target for symlink @param linkname the symlink @return value returned by the command
[ "Create", "a", "soft", "link", "between", "a", "src", "and", "destination", "only", "on", "a", "local", "disk", ".", "HDFS", "does", "not", "support", "this" ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FileUtil.java#L721-L731
before/quality-check
modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java
Check.notEmpty
@ArgumentsChecked @Throws( { """ Ensures that a passed map as a parameter of the calling method is not empty. <p> We recommend to use the overloaded method {@link Check#notEmpty(Collection, String)} and pass as second argument the name of the parameter to enhance the exception message. @param map a map w...
java
@ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalEmptyArgumentException.class }) public static <T extends Map<?, ?>> T notEmpty(@Nonnull final T map, @Nullable final String name) { notNull(map); notEmpty(map, map.isEmpty(), name); return map; }
[ "@", "ArgumentsChecked", "@", "Throws", "(", "{", "IllegalNullArgumentException", ".", "class", ",", "IllegalEmptyArgumentException", ".", "class", "}", ")", "public", "static", "<", "T", "extends", "Map", "<", "?", ",", "?", ">", ">", "T", "notEmpty", "(", ...
Ensures that a passed map as a parameter of the calling method is not empty. <p> We recommend to use the overloaded method {@link Check#notEmpty(Collection, String)} and pass as second argument the name of the parameter to enhance the exception message. @param map a map which should not be empty @param name name of o...
[ "Ensures", "that", "a", "passed", "map", "as", "a", "parameter", "of", "the", "calling", "method", "is", "not", "empty", "." ]
train
https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java#L2116-L2122
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceClient.java
AmazonWebServiceClient.setRegion
@Deprecated public void setRegion(Region region) throws IllegalArgumentException { """ An alternative to {@link AmazonWebServiceClient#setEndpoint(String)}, sets the regional endpoint for this client's service calls. Callers can use this method to control which AWS region they want to work with. <p> <b>Thi...
java
@Deprecated public void setRegion(Region region) throws IllegalArgumentException { checkMutability(); if (region == null) { throw new IllegalArgumentException("No region provided"); } final String serviceNameForEndpoint = getEndpointPrefix(); final String serviceN...
[ "@", "Deprecated", "public", "void", "setRegion", "(", "Region", "region", ")", "throws", "IllegalArgumentException", "{", "checkMutability", "(", ")", ";", "if", "(", "region", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"No regio...
An alternative to {@link AmazonWebServiceClient#setEndpoint(String)}, sets the regional endpoint for this client's service calls. Callers can use this method to control which AWS region they want to work with. <p> <b>This method is not threadsafe. A region should be configured when the client is created and before any ...
[ "An", "alternative", "to", "{", "@link", "AmazonWebServiceClient#setEndpoint", "(", "String", ")", "}", "sets", "the", "regional", "endpoint", "for", "this", "client", "s", "service", "calls", ".", "Callers", "can", "use", "this", "method", "to", "control", "w...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceClient.java#L486-L502
raydac/java-binary-block-parser
jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPTextWriter.java
JBBPTextWriter.Int
public JBBPTextWriter Int(final int[] values, int off, int len) throws IOException { """ Print values from integer array. @param values integer array, must not be null @param off offset to the first element in array @param len number of elements to print @return the context @throws IOException it will...
java
public JBBPTextWriter Int(final int[] values, int off, int len) throws IOException { while (len-- > 0) { this.Int(values[off++]); } return this; }
[ "public", "JBBPTextWriter", "Int", "(", "final", "int", "[", "]", "values", ",", "int", "off", ",", "int", "len", ")", "throws", "IOException", "{", "while", "(", "len", "--", ">", "0", ")", "{", "this", ".", "Int", "(", "values", "[", "off", "++",...
Print values from integer array. @param values integer array, must not be null @param off offset to the first element in array @param len number of elements to print @return the context @throws IOException it will be thrown for transport error
[ "Print", "values", "from", "integer", "array", "." ]
train
https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPTextWriter.java#L1050-L1055
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroup.java
CommandGroup.createButtonBar
public JComponent createButtonBar(Size minimumButtonSize) { """ Create a button bar with buttons for all the commands in this group. Adds a border top and bottom of 2 spaces. @param minimumButtonSize if null, then there is no minimum size @return never null """ return createButtonBar(minimumButtonSize...
java
public JComponent createButtonBar(Size minimumButtonSize) { return createButtonBar(minimumButtonSize, GuiStandardUtils.createTopAndBottomBorder(UIConstants.TWO_SPACES)); }
[ "public", "JComponent", "createButtonBar", "(", "Size", "minimumButtonSize", ")", "{", "return", "createButtonBar", "(", "minimumButtonSize", ",", "GuiStandardUtils", ".", "createTopAndBottomBorder", "(", "UIConstants", ".", "TWO_SPACES", ")", ")", ";", "}" ]
Create a button bar with buttons for all the commands in this group. Adds a border top and bottom of 2 spaces. @param minimumButtonSize if null, then there is no minimum size @return never null
[ "Create", "a", "button", "bar", "with", "buttons", "for", "all", "the", "commands", "in", "this", "group", ".", "Adds", "a", "border", "top", "and", "bottom", "of", "2", "spaces", "." ]
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroup.java#L434-L436
vanilladb/vanillacore
src/main/java/org/vanilladb/core/storage/index/hash/HashIndex.java
HashIndex.getDataRecordId
@Override public RecordId getDataRecordId() { """ Retrieves the data record ID from the current index record. @see Index#getDataRecordId() """ long blkNum = (Long) rf.getVal(SCHEMA_RID_BLOCK).asJavaVal(); int id = (Integer) rf.getVal(SCHEMA_RID_ID).asJavaVal(); return new RecordId(new BlockId(dat...
java
@Override public RecordId getDataRecordId() { long blkNum = (Long) rf.getVal(SCHEMA_RID_BLOCK).asJavaVal(); int id = (Integer) rf.getVal(SCHEMA_RID_ID).asJavaVal(); return new RecordId(new BlockId(dataFileName, blkNum), id); }
[ "@", "Override", "public", "RecordId", "getDataRecordId", "(", ")", "{", "long", "blkNum", "=", "(", "Long", ")", "rf", ".", "getVal", "(", "SCHEMA_RID_BLOCK", ")", ".", "asJavaVal", "(", ")", ";", "int", "id", "=", "(", "Integer", ")", "rf", ".", "g...
Retrieves the data record ID from the current index record. @see Index#getDataRecordId()
[ "Retrieves", "the", "data", "record", "ID", "from", "the", "current", "index", "record", "." ]
train
https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/index/hash/HashIndex.java#L162-L167
alkacon/opencms-core
src/org/opencms/i18n/CmsLocaleManager.java
CmsLocaleManager.getDefaultLocale
public Locale getDefaultLocale(CmsObject cms, String resourceName) { """ Returns the "the" default locale for the given resource.<p> It's possible to override the system default (see {@link #getDefaultLocale()}) by setting the property <code>{@link CmsPropertyDefinition#PROPERTY_LOCALE}</code> to a comma separ...
java
public Locale getDefaultLocale(CmsObject cms, String resourceName) { List<Locale> defaultLocales = getDefaultLocales(cms, resourceName); Locale result; if (defaultLocales.size() > 0) { result = defaultLocales.get(0); } else { result = getDefaultLocale(); ...
[ "public", "Locale", "getDefaultLocale", "(", "CmsObject", "cms", ",", "String", "resourceName", ")", "{", "List", "<", "Locale", ">", "defaultLocales", "=", "getDefaultLocales", "(", "cms", ",", "resourceName", ")", ";", "Locale", "result", ";", "if", "(", "...
Returns the "the" default locale for the given resource.<p> It's possible to override the system default (see {@link #getDefaultLocale()}) by setting the property <code>{@link CmsPropertyDefinition#PROPERTY_LOCALE}</code> to a comma separated list of locale names. This property is inherited from the parent folders. Th...
[ "Returns", "the", "the", "default", "locale", "for", "the", "given", "resource", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/i18n/CmsLocaleManager.java#L764-L774
aws/aws-sdk-java
aws-java-sdk-cloudwatchmetrics/src/main/java/com/amazonaws/metrics/internal/cloudwatch/RequestMetricCollectorSupport.java
RequestMetricCollectorSupport.collectMetrics
@Override public void collectMetrics(Request<?> request, Response<?> response) { """ Collects the metrics at the end of a request/response cycle, transforms the metric data points into a cloud watch metric datum representation, and then adds it to a memory queue so it will get summarized into the necessary ...
java
@Override public void collectMetrics(Request<?> request, Response<?> response) { try { collectMetrics0(request, response); } catch(Exception ex) { // defensive code if (log.isDebugEnabled()) { log.debug("Ignoring unexpected failure", ex); } ...
[ "@", "Override", "public", "void", "collectMetrics", "(", "Request", "<", "?", ">", "request", ",", "Response", "<", "?", ">", "response", ")", "{", "try", "{", "collectMetrics0", "(", "request", ",", "response", ")", ";", "}", "catch", "(", "Exception",...
Collects the metrics at the end of a request/response cycle, transforms the metric data points into a cloud watch metric datum representation, and then adds it to a memory queue so it will get summarized into the necessary statistics and uploaded to Amazon CloudWatch.
[ "Collects", "the", "metrics", "at", "the", "end", "of", "a", "request", "/", "response", "cycle", "transforms", "the", "metric", "data", "points", "into", "a", "cloud", "watch", "metric", "datum", "representation", "and", "then", "adds", "it", "to", "a", "...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cloudwatchmetrics/src/main/java/com/amazonaws/metrics/internal/cloudwatch/RequestMetricCollectorSupport.java#L55-L64
alkacon/opencms-core
src-setup/org/opencms/setup/xml/CmsSetupXmlHelper.java
CmsSetupXmlHelper.setValue
public static int setValue(Document document, String xPath, String value) { """ Sets the given value in all nodes identified by the given xpath of the given xml file.<p> If value is <code>null</code>, all nodes identified by the given xpath will be deleted.<p> If the node identified by the given xpath does n...
java
public static int setValue(Document document, String xPath, String value) { return setValue(document, xPath, value, null); }
[ "public", "static", "int", "setValue", "(", "Document", "document", ",", "String", "xPath", ",", "String", "value", ")", "{", "return", "setValue", "(", "document", ",", "xPath", ",", "value", ",", "null", ")", ";", "}" ]
Sets the given value in all nodes identified by the given xpath of the given xml file.<p> If value is <code>null</code>, all nodes identified by the given xpath will be deleted.<p> If the node identified by the given xpath does not exists, the missing nodes will be created (if <code>value</code> not <code>null</code>...
[ "Sets", "the", "given", "value", "in", "all", "nodes", "identified", "by", "the", "given", "xpath", "of", "the", "given", "xml", "file", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/xml/CmsSetupXmlHelper.java#L187-L190
threerings/narya
core/src/main/java/com/threerings/presents/dobj/DObject.java
DObject.changeAttribute
public void changeAttribute (String name, Object value) { """ Requests that the specified attribute be changed to the specified value. Normally the generated setter methods should be used but in rare cases a caller may wish to update distributed fields in a generic manner. """ Accessor acc = getAcces...
java
public void changeAttribute (String name, Object value) { Accessor acc = getAccessor(name); requestAttributeChange(name, value, acc.get(this)); acc.set(this, value); }
[ "public", "void", "changeAttribute", "(", "String", "name", ",", "Object", "value", ")", "{", "Accessor", "acc", "=", "getAccessor", "(", "name", ")", ";", "requestAttributeChange", "(", "name", ",", "value", ",", "acc", ".", "get", "(", "this", ")", ")"...
Requests that the specified attribute be changed to the specified value. Normally the generated setter methods should be used but in rare cases a caller may wish to update distributed fields in a generic manner.
[ "Requests", "that", "the", "specified", "attribute", "be", "changed", "to", "the", "specified", "value", ".", "Normally", "the", "generated", "setter", "methods", "should", "be", "used", "but", "in", "rare", "cases", "a", "caller", "may", "wish", "to", "upda...
train
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L470-L475
guardtime/ksi-java-sdk
ksi-common/src/main/java/com/guardtime/ksi/tlv/TLVInputStream.java
TLVInputStream.readHeader
private TlvHeader readHeader() throws IOException { """ Reads the TLV header form input stream. Reads two (TLV8 encoding is used) or four (TLV16 encoding is used) bytes from underlying stream. @return Instance of {@link TlvHeader}, always present. @throws IOException when reading from underlying stream fai...
java
private TlvHeader readHeader() throws IOException { int firstByte = in.read(); if (firstByte < 0) { // no data to read throw new EOFException(); } boolean tlv16 = (firstByte & TLV16_FLAG) != 0; boolean nonCritical = (firstByte & NON_CRITICAL_FLAG) != 0; ...
[ "private", "TlvHeader", "readHeader", "(", ")", "throws", "IOException", "{", "int", "firstByte", "=", "in", ".", "read", "(", ")", ";", "if", "(", "firstByte", "<", "0", ")", "{", "// no data to read", "throw", "new", "EOFException", "(", ")", ";", "}",...
Reads the TLV header form input stream. Reads two (TLV8 encoding is used) or four (TLV16 encoding is used) bytes from underlying stream. @return Instance of {@link TlvHeader}, always present. @throws IOException when reading from underlying stream fails.
[ "Reads", "the", "TLV", "header", "form", "input", "stream", ".", "Reads", "two", "(", "TLV8", "encoding", "is", "used", ")", "or", "four", "(", "TLV16", "encoding", "is", "used", ")", "bytes", "from", "underlying", "stream", "." ]
train
https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-common/src/main/java/com/guardtime/ksi/tlv/TLVInputStream.java#L138-L164
esigate/esigate
esigate-core/src/main/java/org/esigate/extension/surrogate/Surrogate.java
Surrogate.processSurrogateControlContent
private static void processSurrogateControlContent(HttpResponse response, boolean keepHeader) { """ Remove Surrogate-Control header or replace by its new value. @param response backend HTTP response. @param keepHeader should the Surrogate-Control header be forwarded to the client. """ if (!respon...
java
private static void processSurrogateControlContent(HttpResponse response, boolean keepHeader) { if (!response.containsHeader(H_SURROGATE_CONTROL)) { return; } if (!keepHeader) { response.removeHeaders(H_SURROGATE_CONTROL); return; } MoveRespo...
[ "private", "static", "void", "processSurrogateControlContent", "(", "HttpResponse", "response", ",", "boolean", "keepHeader", ")", "{", "if", "(", "!", "response", ".", "containsHeader", "(", "H_SURROGATE_CONTROL", ")", ")", "{", "return", ";", "}", "if", "(", ...
Remove Surrogate-Control header or replace by its new value. @param response backend HTTP response. @param keepHeader should the Surrogate-Control header be forwarded to the client.
[ "Remove", "Surrogate", "-", "Control", "header", "or", "replace", "by", "its", "new", "value", "." ]
train
https://github.com/esigate/esigate/blob/50421fb224f16e1ec42715425109a72b3b55527b/esigate-core/src/main/java/org/esigate/extension/surrogate/Surrogate.java#L509-L520
cycorp/api-suite
core-api/src/main/java/com/cyc/session/exception/SessionServiceException.java
SessionServiceException.fromThrowable
public static SessionServiceException fromThrowable(Class interfaceClass, String message, Throwable cause) { """ Converts a Throwable to a SessionServiceException with the specified detail message. If the Throwable is a SessionServiceException and if the Throwable's message is identical to the one supplied, the ...
java
public static SessionServiceException fromThrowable(Class interfaceClass, String message, Throwable cause) { return (cause instanceof SessionServiceException && Objects.equals(interfaceClass, ((SessionServiceException) cause).getInterfaceClass()) && Objects.equals(message, cause.getMessage(...
[ "public", "static", "SessionServiceException", "fromThrowable", "(", "Class", "interfaceClass", ",", "String", "message", ",", "Throwable", "cause", ")", "{", "return", "(", "cause", "instanceof", "SessionServiceException", "&&", "Objects", ".", "equals", "(", "inte...
Converts a Throwable to a SessionServiceException with the specified detail message. If the Throwable is a SessionServiceException and if the Throwable's message is identical to the one supplied, the Throwable will be passed through unmodified; otherwise, it will be wrapped in a new SessionServiceException with the det...
[ "Converts", "a", "Throwable", "to", "a", "SessionServiceException", "with", "the", "specified", "detail", "message", ".", "If", "the", "Throwable", "is", "a", "SessionServiceException", "and", "if", "the", "Throwable", "s", "message", "is", "identical", "to", "t...
train
https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/session/exception/SessionServiceException.java#L64-L70
Alluxio/alluxio
core/common/src/main/java/alluxio/util/CommonUtils.java
CommonUtils.argsToString
public static <T> String argsToString(String separator, T... args) { """ Converts varargs of objects to a string. @param separator separator string @param args variable arguments @param <T> type of the objects @return concatenation of the string representation returned by Object#toString of the individual o...
java
public static <T> String argsToString(String separator, T... args) { StringBuilder sb = new StringBuilder(); for (T s : args) { if (sb.length() != 0) { sb.append(separator); } sb.append(s); } return sb.toString(); }
[ "public", "static", "<", "T", ">", "String", "argsToString", "(", "String", "separator", ",", "T", "...", "args", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "T", "s", ":", "args", ")", "{", "if", "(", "...
Converts varargs of objects to a string. @param separator separator string @param args variable arguments @param <T> type of the objects @return concatenation of the string representation returned by Object#toString of the individual objects
[ "Converts", "varargs", "of", "objects", "to", "a", "string", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/CommonUtils.java#L132-L141
lucee/Lucee
core/src/main/java/lucee/runtime/reflection/Reflector.java
Reflector.setProperty
public static void setProperty(Object obj, String prop, Object value) throws PageException { """ assign a value to a visible Property (Field or Setter) of a object @param obj Object to assign value to his property @param prop name of property @param value Value to assign @throws PageException """ boolea...
java
public static void setProperty(Object obj, String prop, Object value) throws PageException { boolean done = false; try { if (setField(obj, prop, value)) done = true; } catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); } if (!done) callSetter(obj, prop, value); }
[ "public", "static", "void", "setProperty", "(", "Object", "obj", ",", "String", "prop", ",", "Object", "value", ")", "throws", "PageException", "{", "boolean", "done", "=", "false", ";", "try", "{", "if", "(", "setField", "(", "obj", ",", "prop", ",", ...
assign a value to a visible Property (Field or Setter) of a object @param obj Object to assign value to his property @param prop name of property @param value Value to assign @throws PageException
[ "assign", "a", "value", "to", "a", "visible", "Property", "(", "Field", "or", "Setter", ")", "of", "a", "object" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/reflection/Reflector.java#L1247-L1256
sdl/Testy
src/main/java/com/sdl/selenium/extjs6/button/DownloadButton.java
DownloadButton.downloadFromMenu
public boolean downloadFromMenu(String name, String fileName) { """ if WebDriverConfig.isSilentDownload() is true, se face silentDownload, is is false se face download with AutoIT. @param name e.g. TBX @param fileName e.g. "TestSet.tmx" @return true if the downloaded file is the same one that is meant to ...
java
public boolean downloadFromMenu(String name, String fileName) { clickOnMenu(name); return executor.download(fileName, 10000L); }
[ "public", "boolean", "downloadFromMenu", "(", "String", "name", ",", "String", "fileName", ")", "{", "clickOnMenu", "(", "name", ")", ";", "return", "executor", ".", "download", "(", "fileName", ",", "10000L", ")", ";", "}" ]
if WebDriverConfig.isSilentDownload() is true, se face silentDownload, is is false se face download with AutoIT. @param name e.g. TBX @param fileName e.g. "TestSet.tmx" @return true if the downloaded file is the same one that is meant to be downloaded, otherwise returns false.
[ "if", "WebDriverConfig", ".", "isSilentDownload", "()", "is", "true", "se", "face", "silentDownload", "is", "is", "false", "se", "face", "download", "with", "AutoIT", "." ]
train
https://github.com/sdl/Testy/blob/b3ae061554016f926f04694a39ff00dab7576609/src/main/java/com/sdl/selenium/extjs6/button/DownloadButton.java#L47-L50
BioPAX/Paxtools
sbgn-converter/src/main/java/org/biopax/paxtools/io/sbgn/SBGNLayoutManager.java
SBGNLayoutManager.populateCompartmentOccurencesMap
private void populateCompartmentOccurencesMap(Glyph targetGlyph, HashMap<String, Integer> compartmentIDandOccurenceMap) { """ Updates a hashmap by incrementing the number of nodes in the compartment glyph that includes targetGlyph. It is assumed that given hashmap includes compartment ids' as keys and number of ...
java
private void populateCompartmentOccurencesMap(Glyph targetGlyph, HashMap<String, Integer> compartmentIDandOccurenceMap) { String rootID = "root"; // if compartment ref of targetGlyph node is not null, increment its occurence by 1 if(targetGlyph.getCompartmentRef() != null) { ...
[ "private", "void", "populateCompartmentOccurencesMap", "(", "Glyph", "targetGlyph", ",", "HashMap", "<", "String", ",", "Integer", ">", "compartmentIDandOccurenceMap", ")", "{", "String", "rootID", "=", "\"root\"", ";", "// if compartment ref of targetGlyph node is not null...
Updates a hashmap by incrementing the number of nodes in the compartment glyph that includes targetGlyph. It is assumed that given hashmap includes compartment ids' as keys and number of nodes as values.This method is an utility method that will be used to populate a hashmap while determining the compartment node of a ...
[ "Updates", "a", "hashmap", "by", "incrementing", "the", "number", "of", "nodes", "in", "the", "compartment", "glyph", "that", "includes", "targetGlyph", ".", "It", "is", "assumed", "that", "given", "hashmap", "includes", "compartment", "ids", "as", "keys", "an...
train
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/sbgn-converter/src/main/java/org/biopax/paxtools/io/sbgn/SBGNLayoutManager.java#L311-L341
strator-dev/greenpepper
greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/macros/AbstractGreenPepperMacro.java
AbstractGreenPepperMacro.isExpanded
protected boolean isExpanded(Map<String,String> parameters) { """ <p>isExpanded.</p> @param parameters a {@link java.util.Map} object. @return a boolean. """ String all = parameters.get("expanded"); return all != null && Boolean.valueOf(all); }
java
protected boolean isExpanded(Map<String,String> parameters) { String all = parameters.get("expanded"); return all != null && Boolean.valueOf(all); }
[ "protected", "boolean", "isExpanded", "(", "Map", "<", "String", ",", "String", ">", "parameters", ")", "{", "String", "all", "=", "parameters", ".", "get", "(", "\"expanded\"", ")", ";", "return", "all", "!=", "null", "&&", "Boolean", ".", "valueOf", "(...
<p>isExpanded.</p> @param parameters a {@link java.util.Map} object. @return a boolean.
[ "<p", ">", "isExpanded", ".", "<", "/", "p", ">" ]
train
https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/macros/AbstractGreenPepperMacro.java#L251-L255
johncarl81/transfuse
transfuse-core/src/main/java/org/androidtransfuse/analysis/InjectionPointFactory.java
InjectionPointFactory.buildInjectionNode
public InjectionNode buildInjectionNode(ASTType astType, AnalysisContext context) { """ Build a InjectionPoint directly from the given ASTType @param astType required type @param context analysis context @return Injection Node """ return buildInjectionNode(Collections.EMPTY_LIST, astType, astType,...
java
public InjectionNode buildInjectionNode(ASTType astType, AnalysisContext context) { return buildInjectionNode(Collections.EMPTY_LIST, astType, astType, context); }
[ "public", "InjectionNode", "buildInjectionNode", "(", "ASTType", "astType", ",", "AnalysisContext", "context", ")", "{", "return", "buildInjectionNode", "(", "Collections", ".", "EMPTY_LIST", ",", "astType", ",", "astType", ",", "context", ")", ";", "}" ]
Build a InjectionPoint directly from the given ASTType @param astType required type @param context analysis context @return Injection Node
[ "Build", "a", "InjectionPoint", "directly", "from", "the", "given", "ASTType" ]
train
https://github.com/johncarl81/transfuse/blob/a5f837504797a6c4f8628f7e1dde09b8e6368c8b/transfuse-core/src/main/java/org/androidtransfuse/analysis/InjectionPointFactory.java#L137-L139
BioPAX/Paxtools
paxtools-core/src/main/java/org/biopax/paxtools/controller/AbstractPropertyEditor.java
AbstractPropertyEditor.invokeMethod
protected void invokeMethod(Method method, D bean, R value) { """ Calls the <em>method</em> onto <em>bean</em> with the <em>value</em> as its parameter. In this context <em>method</em> can be one of these three: set, add, or remove. @param method method that is going to be called @param bean bean onto which the...
java
protected void invokeMethod(Method method, D bean, R value) { assert bean != null; try { method.invoke(domain.cast(bean), value); } catch (ClassCastException e) { String message = "Failed to set property: " + property; if (!domain.isAssignableFrom(bean.getClass())) { message += " Invalid d...
[ "protected", "void", "invokeMethod", "(", "Method", "method", ",", "D", "bean", ",", "R", "value", ")", "{", "assert", "bean", "!=", "null", ";", "try", "{", "method", ".", "invoke", "(", "domain", ".", "cast", "(", "bean", ")", ",", "value", ")", ...
Calls the <em>method</em> onto <em>bean</em> with the <em>value</em> as its parameter. In this context <em>method</em> can be one of these three: set, add, or remove. @param method method that is going to be called @param bean bean onto which the method is going to be applied @param value the value which is going to be...
[ "Calls", "the", "<em", ">", "method<", "/", "em", ">", "onto", "<em", ">", "bean<", "/", "em", ">", "with", "the", "<em", ">", "value<", "/", "em", ">", "as", "its", "parameter", ".", "In", "this", "context", "<em", ">", "method<", "/", "em", ">"...
train
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/controller/AbstractPropertyEditor.java#L385-L414
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/yaml/YamlUtil.java
YamlUtil.constructPath
public static String constructPath(YamlNode parent, String childName) { """ Constructs the path of the node with the provided {@code parent} node and {@code nodeName}. @param parent The parent node @param childName The name of the node the path is constructed for @return the constructed path of the node ...
java
public static String constructPath(YamlNode parent, String childName) { if (childName != null) { childName = NAME_APOSTROPHE_PATTERN.matcher(childName).replaceAll("\"$1\""); } if (parent != null && parent.path() != null) { return parent.path() + "/" + childName; ...
[ "public", "static", "String", "constructPath", "(", "YamlNode", "parent", ",", "String", "childName", ")", "{", "if", "(", "childName", "!=", "null", ")", "{", "childName", "=", "NAME_APOSTROPHE_PATTERN", ".", "matcher", "(", "childName", ")", ".", "replaceAll...
Constructs the path of the node with the provided {@code parent} node and {@code nodeName}. @param parent The parent node @param childName The name of the node the path is constructed for @return the constructed path of the node
[ "Constructs", "the", "path", "of", "the", "node", "with", "the", "provided", "{", "@code", "parent", "}", "node", "and", "{", "@code", "nodeName", "}", "." ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/yaml/YamlUtil.java#L112-L122
looly/hutool
hutool-extra/src/main/java/cn/hutool/extra/ssh/JschUtil.java
JschUtil.openSession
public static Session openSession(String sshHost, int sshPort, String sshUser, String sshPass) { """ 打开一个新的SSH会话 @param sshHost 主机 @param sshPort 端口 @param sshUser 用户名 @param sshPass 密码 @return SSH会话 """ final Session session = createSession(sshHost, sshPort, sshUser, sshPass); try { session.c...
java
public static Session openSession(String sshHost, int sshPort, String sshUser, String sshPass) { final Session session = createSession(sshHost, sshPort, sshUser, sshPass); try { session.connect(); } catch (JSchException e) { throw new JschRuntimeException(e); } return session; }
[ "public", "static", "Session", "openSession", "(", "String", "sshHost", ",", "int", "sshPort", ",", "String", "sshUser", ",", "String", "sshPass", ")", "{", "final", "Session", "session", "=", "createSession", "(", "sshHost", ",", "sshPort", ",", "sshUser", ...
打开一个新的SSH会话 @param sshHost 主机 @param sshPort 端口 @param sshUser 用户名 @param sshPass 密码 @return SSH会话
[ "打开一个新的SSH会话" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/ssh/JschUtil.java#L69-L77
Bandwidth/java-bandwidth
src/main/java/com/bandwidth/sdk/BandwidthClient.java
BandwidthClient.requestJson
protected RestResponse requestJson(final String path, final String method, final String param) throws IOException, AppPlatformException { """ Helper method to build the request to the server. @param path the path @param method the method @param param payload json string @return the response. @thro...
java
protected RestResponse requestJson(final String path, final String method, final String param) throws IOException, AppPlatformException { final HttpUriRequest request = setupRequestJson(path, method, param); return performRequest(request); }
[ "protected", "RestResponse", "requestJson", "(", "final", "String", "path", ",", "final", "String", "method", ",", "final", "String", "param", ")", "throws", "IOException", ",", "AppPlatformException", "{", "final", "HttpUriRequest", "request", "=", "setupRequestJso...
Helper method to build the request to the server. @param path the path @param method the method @param param payload json string @return the response. @throws IOException unexpected exception. @throws AppPlatformException unexpected exception.
[ "Helper", "method", "to", "build", "the", "request", "to", "the", "server", "." ]
train
https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/BandwidthClient.java#L498-L502
facebookarchive/hadoop-20
src/core/org/apache/hadoop/util/LineReader.java
LineReader.readLine
public int readLine(Text str) throws IOException { """ Read from the InputStream into the given Text. @param str the object to store the given line @return the number of bytes read including the newline @throws IOException if the underlying stream throws """ return readLine(str, Integer.MAX_VALUE, Integ...
java
public int readLine(Text str) throws IOException { return readLine(str, Integer.MAX_VALUE, Integer.MAX_VALUE); }
[ "public", "int", "readLine", "(", "Text", "str", ")", "throws", "IOException", "{", "return", "readLine", "(", "str", ",", "Integer", ".", "MAX_VALUE", ",", "Integer", ".", "MAX_VALUE", ")", ";", "}" ]
Read from the InputStream into the given Text. @param str the object to store the given line @return the number of bytes read including the newline @throws IOException if the underlying stream throws
[ "Read", "from", "the", "InputStream", "into", "the", "given", "Text", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/LineReader.java#L311-L313
katharsis-project/katharsis-framework
katharsis-jpa/src/main/java/io/katharsis/jpa/JpaModule.java
JpaModule.newServerModule
public static JpaModule newServerModule(EntityManagerFactory emFactory, EntityManager em, TransactionRunner transactionRunner) { """ Creates a new JpaModule for a Katharsis server. All entities managed by the provided EntityManagerFactory are registered to the module and exposed as JSON API resources if not late...
java
public static JpaModule newServerModule(EntityManagerFactory emFactory, EntityManager em, TransactionRunner transactionRunner) { return new JpaModule(emFactory, em, transactionRunner); }
[ "public", "static", "JpaModule", "newServerModule", "(", "EntityManagerFactory", "emFactory", ",", "EntityManager", "em", ",", "TransactionRunner", "transactionRunner", ")", "{", "return", "new", "JpaModule", "(", "emFactory", ",", "em", ",", "transactionRunner", ")",...
Creates a new JpaModule for a Katharsis server. All entities managed by the provided EntityManagerFactory are registered to the module and exposed as JSON API resources if not later configured otherwise. @param emFactory to retrieve the managed entities. @param em to use @param transactionRunner to use @return created...
[ "Creates", "a", "new", "JpaModule", "for", "a", "Katharsis", "server", ".", "All", "entities", "managed", "by", "the", "provided", "EntityManagerFactory", "are", "registered", "to", "the", "module", "and", "exposed", "as", "JSON", "API", "resources", "if", "no...
train
https://github.com/katharsis-project/katharsis-framework/blob/73d1a8763c49c5cf4643d43e2dbfedb647630c46/katharsis-jpa/src/main/java/io/katharsis/jpa/JpaModule.java#L203-L205
apache/groovy
src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java
ResourceGroovyMethods.withOutputStream
public static Object withOutputStream(File file, @ClosureParams(value = SimpleType.class, options = "java.io.OutputStream") Closure closure) throws IOException { """ Creates a new OutputStream for this file and passes it into the closure. This method ensures the stream is closed after the closure returns. @par...
java
public static Object withOutputStream(File file, @ClosureParams(value = SimpleType.class, options = "java.io.OutputStream") Closure closure) throws IOException { return IOGroovyMethods.withStream(newOutputStream(file), closure); }
[ "public", "static", "Object", "withOutputStream", "(", "File", "file", ",", "@", "ClosureParams", "(", "value", "=", "SimpleType", ".", "class", ",", "options", "=", "\"java.io.OutputStream\"", ")", "Closure", "closure", ")", "throws", "IOException", "{", "retur...
Creates a new OutputStream for this file and passes it into the closure. This method ensures the stream is closed after the closure returns. @param file a File @param closure a closure @return the value returned by the closure @throws IOException if an IOException occurs. @see IOGroovyMethods#withStream(java.io.Out...
[ "Creates", "a", "new", "OutputStream", "for", "this", "file", "and", "passes", "it", "into", "the", "closure", ".", "This", "method", "ensures", "the", "stream", "is", "closed", "after", "the", "closure", "returns", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L1827-L1829
Mozu/mozu-java
mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/orders/OrderNoteUrl.java
OrderNoteUrl.deleteOrderNoteUrl
public static MozuUrl deleteOrderNoteUrl(String noteId, String orderId) { """ Get Resource Url for DeleteOrderNote @param noteId Unique identifier of a particular note to retrieve. @param orderId Unique identifier of the order. @return String Resource Url """ UrlFormatter formatter = new UrlFormatter("...
java
public static MozuUrl deleteOrderNoteUrl(String noteId, String orderId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/notes/{noteId}"); formatter.formatUrl("noteId", noteId); formatter.formatUrl("orderId", orderId); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLo...
[ "public", "static", "MozuUrl", "deleteOrderNoteUrl", "(", "String", "noteId", ",", "String", "orderId", ")", "{", "UrlFormatter", "formatter", "=", "new", "UrlFormatter", "(", "\"/api/commerce/orders/{orderId}/notes/{noteId}\"", ")", ";", "formatter", ".", "formatUrl", ...
Get Resource Url for DeleteOrderNote @param noteId Unique identifier of a particular note to retrieve. @param orderId Unique identifier of the order. @return String Resource Url
[ "Get", "Resource", "Url", "for", "DeleteOrderNote" ]
train
https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/orders/OrderNoteUrl.java#L80-L86
UrielCh/ovh-java-sdk
ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java
ApiOvhTelephony.billingAccount_serviceInfos_PUT
public void billingAccount_serviceInfos_PUT(String billingAccount, OvhService body) throws IOException { """ Alter this object properties REST: PUT /telephony/{billingAccount}/serviceInfos @param body [required] New object properties @param billingAccount [required] The name of your billingAccount """ S...
java
public void billingAccount_serviceInfos_PUT(String billingAccount, OvhService body) throws IOException { String qPath = "/telephony/{billingAccount}/serviceInfos"; StringBuilder sb = path(qPath, billingAccount); exec(qPath, "PUT", sb.toString(), body); }
[ "public", "void", "billingAccount_serviceInfos_PUT", "(", "String", "billingAccount", ",", "OvhService", "body", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/telephony/{billingAccount}/serviceInfos\"", ";", "StringBuilder", "sb", "=", "path", "(", "qPa...
Alter this object properties REST: PUT /telephony/{billingAccount}/serviceInfos @param body [required] New object properties @param billingAccount [required] The name of your billingAccount
[ "Alter", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L8386-L8390
apache/incubator-druid
core/src/main/java/org/apache/druid/java/util/emitter/core/HttpPostEmitter.java
HttpPostEmitter.onSealExclusive
void onSealExclusive(Batch batch, long elapsedTimeMillis) { """ Called from {@link Batch} only once for each Batch in existence. """ try { doOnSealExclusive(batch, elapsedTimeMillis); } catch (Throwable t) { try { if (!concurrentBatch.compareAndSet(batch, batch.batchNumber)) { ...
java
void onSealExclusive(Batch batch, long elapsedTimeMillis) { try { doOnSealExclusive(batch, elapsedTimeMillis); } catch (Throwable t) { try { if (!concurrentBatch.compareAndSet(batch, batch.batchNumber)) { log.error("Unexpected failure to set currentBatch to the failed Batch.b...
[ "void", "onSealExclusive", "(", "Batch", "batch", ",", "long", "elapsedTimeMillis", ")", "{", "try", "{", "doOnSealExclusive", "(", "batch", ",", "elapsedTimeMillis", ")", ";", "}", "catch", "(", "Throwable", "t", ")", "{", "try", "{", "if", "(", "!", "c...
Called from {@link Batch} only once for each Batch in existence.
[ "Called", "from", "{" ]
train
https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/core/src/main/java/org/apache/druid/java/util/emitter/core/HttpPostEmitter.java#L304-L321
carewebframework/carewebframework-core
org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.core/src/main/java/org/carewebframework/maven/plugin/core/BaseMojo.java
BaseMojo.appendVersionPiece
private void appendVersionPiece(StringBuilder sb, String pc) { """ Append the version piece to the version # under construction. @param sb String builder receiving the version under construction. @param pc The version piece to add. If null, it is ignored. If non-numeric, a value of "0" is used. """ ...
java
private void appendVersionPiece(StringBuilder sb, String pc) { if ((pc != null) && !pc.isEmpty()) { pc = pc.trim(); if (sb.length() > 0) { sb.append("."); } sb.append(StringUtils.isNumeric(pc) ? pc : "0"); } }
[ "private", "void", "appendVersionPiece", "(", "StringBuilder", "sb", ",", "String", "pc", ")", "{", "if", "(", "(", "pc", "!=", "null", ")", "&&", "!", "pc", ".", "isEmpty", "(", ")", ")", "{", "pc", "=", "pc", ".", "trim", "(", ")", ";", "if", ...
Append the version piece to the version # under construction. @param sb String builder receiving the version under construction. @param pc The version piece to add. If null, it is ignored. If non-numeric, a value of "0" is used.
[ "Append", "the", "version", "piece", "to", "the", "version", "#", "under", "construction", "." ]
train
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.core/src/main/java/org/carewebframework/maven/plugin/core/BaseMojo.java#L197-L207
zxing/zxing
core/src/main/java/com/google/zxing/qrcode/detector/FinderPattern.java
FinderPattern.aboutEquals
boolean aboutEquals(float moduleSize, float i, float j) { """ <p>Determines if this finder pattern "about equals" a finder pattern at the stated position and size -- meaning, it is at nearly the same center with nearly the same size.</p> """ if (Math.abs(i - getY()) <= moduleSize && Math.abs(j - getX()) <...
java
boolean aboutEquals(float moduleSize, float i, float j) { if (Math.abs(i - getY()) <= moduleSize && Math.abs(j - getX()) <= moduleSize) { float moduleSizeDiff = Math.abs(moduleSize - estimatedModuleSize); return moduleSizeDiff <= 1.0f || moduleSizeDiff <= estimatedModuleSize; } return false; }
[ "boolean", "aboutEquals", "(", "float", "moduleSize", ",", "float", "i", ",", "float", "j", ")", "{", "if", "(", "Math", ".", "abs", "(", "i", "-", "getY", "(", ")", ")", "<=", "moduleSize", "&&", "Math", ".", "abs", "(", "j", "-", "getX", "(", ...
<p>Determines if this finder pattern "about equals" a finder pattern at the stated position and size -- meaning, it is at nearly the same center with nearly the same size.</p>
[ "<p", ">", "Determines", "if", "this", "finder", "pattern", "about", "equals", "a", "finder", "pattern", "at", "the", "stated", "position", "and", "size", "--", "meaning", "it", "is", "at", "nearly", "the", "same", "center", "with", "nearly", "the", "same"...
train
https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/qrcode/detector/FinderPattern.java#L61-L67
voldemort/voldemort
src/java/voldemort/utils/JmxUtils.java
JmxUtils.extractParameterInfo
public static MBeanParameterInfo[] extractParameterInfo(Method m) { """ Extract the parameters from a method using the Jmx annotation if present, or just the raw types otherwise @param m The method to extract parameters from @return An array of parameter infos """ Class<?>[] types = m.getParameter...
java
public static MBeanParameterInfo[] extractParameterInfo(Method m) { Class<?>[] types = m.getParameterTypes(); Annotation[][] annotations = m.getParameterAnnotations(); MBeanParameterInfo[] params = new MBeanParameterInfo[types.length]; for(int i = 0; i < params.length; i++) { ...
[ "public", "static", "MBeanParameterInfo", "[", "]", "extractParameterInfo", "(", "Method", "m", ")", "{", "Class", "<", "?", ">", "[", "]", "types", "=", "m", ".", "getParameterTypes", "(", ")", ";", "Annotation", "[", "]", "[", "]", "annotations", "=", ...
Extract the parameters from a method using the Jmx annotation if present, or just the raw types otherwise @param m The method to extract parameters from @return An array of parameter infos
[ "Extract", "the", "parameters", "from", "a", "method", "using", "the", "Jmx", "annotation", "if", "present", "or", "just", "the", "raw", "types", "otherwise" ]
train
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/JmxUtils.java#L207-L229
foundation-runtime/service-directory
2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/Configurations.java
Configurations.getString
public static String getString(String name, String defaultVal) { """ Get the property object as String, or return defaultVal if property is not defined. @param name property name. @param defaultVal default property value. @return property value as String, return defaultVal if property is undefined. """...
java
public static String getString(String name, String defaultVal){ if(getConfiguration().containsKey(name)){ return getConfiguration().getString(name); } else { return defaultVal; } }
[ "public", "static", "String", "getString", "(", "String", "name", ",", "String", "defaultVal", ")", "{", "if", "(", "getConfiguration", "(", ")", ".", "containsKey", "(", "name", ")", ")", "{", "return", "getConfiguration", "(", ")", ".", "getString", "(",...
Get the property object as String, or return defaultVal if property is not defined. @param name property name. @param defaultVal default property value. @return property value as String, return defaultVal if property is undefined.
[ "Get", "the", "property", "object", "as", "String", "or", "return", "defaultVal", "if", "property", "is", "not", "defined", "." ]
train
https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/Configurations.java#L98-L104
alkacon/opencms-core
src/org/opencms/search/CmsSearchIndex.java
CmsSearchIndex.getDocument
public I_CmsSearchDocument getDocument(String field, String term) { """ Returns the first document where the given term matches the selected index field.<p> Use this method to search for documents which have unique field values, like a unique id.<p> @param field the field to search in @param term the term t...
java
public I_CmsSearchDocument getDocument(String field, String term) { Document result = null; IndexSearcher searcher = getSearcher(); if (searcher != null) { // search for an exact match on the selected field Term resultTerm = new Term(field, term); try { ...
[ "public", "I_CmsSearchDocument", "getDocument", "(", "String", "field", ",", "String", "term", ")", "{", "Document", "result", "=", "null", ";", "IndexSearcher", "searcher", "=", "getSearcher", "(", ")", ";", "if", "(", "searcher", "!=", "null", ")", "{", ...
Returns the first document where the given term matches the selected index field.<p> Use this method to search for documents which have unique field values, like a unique id.<p> @param field the field to search in @param term the term to search for @return the first document where the given term matches the selected...
[ "Returns", "the", "first", "document", "where", "the", "given", "term", "matches", "the", "selected", "index", "field", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsSearchIndex.java#L613-L633
SourcePond/fileobserver
fileobserver-impl/src/main/java/ch/sourcepond/io/fileobserver/impl/directory/RootDirectory.java
RootDirectory.relativizeAgainstRoot
@Override Path relativizeAgainstRoot(final WatchedDirectory pWatchedDirectory, final Path pPath) { """ /* Relativizes the path specified against the path of this directory. """ // Because we are on the last root directory possible we can ignore the // directory key here. return get...
java
@Override Path relativizeAgainstRoot(final WatchedDirectory pWatchedDirectory, final Path pPath) { // Because we are on the last root directory possible we can ignore the // directory key here. return getPath().relativize(pPath); }
[ "@", "Override", "Path", "relativizeAgainstRoot", "(", "final", "WatchedDirectory", "pWatchedDirectory", ",", "final", "Path", "pPath", ")", "{", "// Because we are on the last root directory possible we can ignore the", "// directory key here.", "return", "getPath", "(", ")", ...
/* Relativizes the path specified against the path of this directory.
[ "/", "*", "Relativizes", "the", "path", "specified", "against", "the", "path", "of", "this", "directory", "." ]
train
https://github.com/SourcePond/fileobserver/blob/dfb3055ed35759a47f52f6cfdea49879c415fd6b/fileobserver-impl/src/main/java/ch/sourcepond/io/fileobserver/impl/directory/RootDirectory.java#L93-L98
intuit/QuickBooks-V3-Java-SDK
ipp-v3-java-devkit/src/main/java/com/intuit/ipp/util/Config.java
Config.getBooleanProperty
public static Boolean getBooleanProperty(String key, Boolean defaultValue) { """ Returns boolean value for specified property and default value @param key @param defaultValue @return """ String value = getProperty(key); if((null == value) || value.isEmpty() ) { return (null == de...
java
public static Boolean getBooleanProperty(String key, Boolean defaultValue) { String value = getProperty(key); if((null == value) || value.isEmpty() ) { return (null == defaultValue) ? false : defaultValue; } if("null".equals(value.toLowerCase()) && (null != defaultValue) ) { ...
[ "public", "static", "Boolean", "getBooleanProperty", "(", "String", "key", ",", "Boolean", "defaultValue", ")", "{", "String", "value", "=", "getProperty", "(", "key", ")", ";", "if", "(", "(", "null", "==", "value", ")", "||", "value", ".", "isEmpty", "...
Returns boolean value for specified property and default value @param key @param defaultValue @return
[ "Returns", "boolean", "value", "for", "specified", "property", "and", "default", "value" ]
train
https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/util/Config.java#L272-L281
sniggle/simple-pgp
simple-pgp-java/src/main/java/me/sniggle/pgp/crypt/PGPMessageSigner.java
PGPMessageSigner.signMessage
@Override public boolean signMessage(InputStream privateKeyOfSender, final String userIdForPrivateKey, String passwordOfPrivateKey, InputStream message, OutputStream signature) { """ @see MessageSigner#signMessage(InputStream, String, String, InputStream, OutputStream) @param privateKeyOfSender the private k...
java
@Override public boolean signMessage(InputStream privateKeyOfSender, final String userIdForPrivateKey, String passwordOfPrivateKey, InputStream message, OutputStream signature) { LOGGER.trace("signMessage(InputStream, String, String, InputStream, OutputStream)"); LOGGER.trace("Private Key: {}, User ID: {}, Pa...
[ "@", "Override", "public", "boolean", "signMessage", "(", "InputStream", "privateKeyOfSender", ",", "final", "String", "userIdForPrivateKey", ",", "String", "passwordOfPrivateKey", ",", "InputStream", "message", ",", "OutputStream", "signature", ")", "{", "LOGGER", "....
@see MessageSigner#signMessage(InputStream, String, String, InputStream, OutputStream) @param privateKeyOfSender the private key of the sender @param userIdForPrivateKey the user id of the sender @param passwordOfPrivateKey the password for the private key @param message the message / data to verify @param signature t...
[ "@see", "MessageSigner#signMessage", "(", "InputStream", "String", "String", "InputStream", "OutputStream", ")" ]
train
https://github.com/sniggle/simple-pgp/blob/2ab83e4d370b8189f767d8e4e4c7e6020e60fbe3/simple-pgp-java/src/main/java/me/sniggle/pgp/crypt/PGPMessageSigner.java#L106-L152
mike10004/common-helper
native-helper/src/main/java/com/github/mike10004/nativehelper/subprocess/StreamConduit.java
StreamConduit.createPump
private Thread createPump(InputStream is, OutputStream os, boolean closeWhenExhausted) { """ Creates a stream pumper to copy the given input stream to the given output stream. @param is the input stream to copy from. @param os the output stream to copy to. @param closeWhenExhaus...
java
private Thread createPump(InputStream is, OutputStream os, boolean closeWhenExhausted) { BlockingStreamPumper pumper = new BlockingStreamPumper(is, os, closeWhenExhausted); // pumper.setAutoflush(true); // always auto-flush final Thread result = new ThreadWithPump...
[ "private", "Thread", "createPump", "(", "InputStream", "is", ",", "OutputStream", "os", ",", "boolean", "closeWhenExhausted", ")", "{", "BlockingStreamPumper", "pumper", "=", "new", "BlockingStreamPumper", "(", "is", ",", "os", ",", "closeWhenExhausted", ")", ";",...
Creates a stream pumper to copy the given input stream to the given output stream. @param is the input stream to copy from. @param os the output stream to copy to. @param closeWhenExhausted if true close the inputstream. @return a thread object that does the pumping, subclasses should return an instance of {@code PumpS...
[ "Creates", "a", "stream", "pumper", "to", "copy", "the", "given", "input", "stream", "to", "the", "given", "output", "stream", "." ]
train
https://github.com/mike10004/common-helper/blob/744f82d9b0768a9ad9c63a57a37ab2c93bf408f4/native-helper/src/main/java/com/github/mike10004/nativehelper/subprocess/StreamConduit.java#L213-L220
nyla-solutions/nyla
nyla.solutions.core/src/main/java/nyla/solutions/core/io/FileMonitor.java
FileMonitor.monitor
public synchronized void monitor(String directory, String fileNameFilter, boolean processCurrentFiles) { """ Add file to observer for. File may be any java.io.File (including a directory) and may well be a non-existing file in the case where the creating of the file is to be trepped. <p> More than one file can...
java
public synchronized void monitor(String directory, String fileNameFilter, boolean processCurrentFiles) { timer.schedule( new FileMonitorNotifier(this, directory, fileNameFilter, processCurrentFiles) , 0, pollingInterval); }
[ "public", "synchronized", "void", "monitor", "(", "String", "directory", ",", "String", "fileNameFilter", ",", "boolean", "processCurrentFiles", ")", "{", "timer", ".", "schedule", "(", "new", "FileMonitorNotifier", "(", "this", ",", "directory", ",", "fileNameFil...
Add file to observer for. File may be any java.io.File (including a directory) and may well be a non-existing file in the case where the creating of the file is to be trepped. <p> More than one file can be listened for. When the specified file is created, modified or deleted, listeners are notified. @param directory t...
[ "Add", "file", "to", "observer", "for", ".", "File", "may", "be", "any", "java", ".", "io", ".", "File", "(", "including", "a", "directory", ")", "and", "may", "well", "be", "a", "non", "-", "existing", "file", "in", "the", "case", "where", "the", ...
train
https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/io/FileMonitor.java#L98-L105
couchbase/CouchbaseMock
src/main/java/com/couchbase/mock/httpio/HandlerUtil.java
HandlerUtil.make400Response
public static void make400Response(HttpResponse response, String msg) { """ Sets a 404 not found response with a message @param response The response object @param msg The message """ makeResponse(response, msg, HttpStatus.SC_BAD_REQUEST); }
java
public static void make400Response(HttpResponse response, String msg) { makeResponse(response, msg, HttpStatus.SC_BAD_REQUEST); }
[ "public", "static", "void", "make400Response", "(", "HttpResponse", "response", ",", "String", "msg", ")", "{", "makeResponse", "(", "response", ",", "msg", ",", "HttpStatus", ".", "SC_BAD_REQUEST", ")", ";", "}" ]
Sets a 404 not found response with a message @param response The response object @param msg The message
[ "Sets", "a", "404", "not", "found", "response", "with", "a", "message" ]
train
https://github.com/couchbase/CouchbaseMock/blob/2085bbebade1d5b6356480e7bf335139d08383da/src/main/java/com/couchbase/mock/httpio/HandlerUtil.java#L170-L172
Alluxio/alluxio
integration/checker/src/main/java/alluxio/checker/MapReduceIntegrationChecker.java
MapReduceIntegrationChecker.run
private int run(String[] args) throws Exception { """ Implements MapReduce with Alluxio integration checker. @return 0 for success, 2 for unable to find Alluxio classes, 1 otherwise """ Configuration conf = new Configuration(); String numMaps = new GenericOptionsParser(conf, args).getRemainingArgs(...
java
private int run(String[] args) throws Exception { Configuration conf = new Configuration(); String numMaps = new GenericOptionsParser(conf, args).getRemainingArgs()[0]; conf.set(MRJobConfig.NUM_MAPS, numMaps); createHdfsFilesystem(conf); Job job = Job.getInstance(conf, "MapReduceIntegrationChecker...
[ "private", "int", "run", "(", "String", "[", "]", "args", ")", "throws", "Exception", "{", "Configuration", "conf", "=", "new", "Configuration", "(", ")", ";", "String", "numMaps", "=", "new", "GenericOptionsParser", "(", "conf", ",", "args", ")", ".", "...
Implements MapReduce with Alluxio integration checker. @return 0 for success, 2 for unable to find Alluxio classes, 1 otherwise
[ "Implements", "MapReduce", "with", "Alluxio", "integration", "checker", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/checker/src/main/java/alluxio/checker/MapReduceIntegrationChecker.java#L267-L296
google/error-prone
check_api/src/main/java/com/google/errorprone/matchers/Description.java
Description.applySeverityOverride
@CheckReturnValue public Description applySeverityOverride(SeverityLevel severity) { """ Internal-only. Has no effect if applied to a Description within a BugChecker. """ return new Description(position, checkName, rawMessage, linkUrl, fixes, severity); }
java
@CheckReturnValue public Description applySeverityOverride(SeverityLevel severity) { return new Description(position, checkName, rawMessage, linkUrl, fixes, severity); }
[ "@", "CheckReturnValue", "public", "Description", "applySeverityOverride", "(", "SeverityLevel", "severity", ")", "{", "return", "new", "Description", "(", "position", ",", "checkName", ",", "rawMessage", ",", "linkUrl", ",", "fixes", ",", "severity", ")", ";", ...
Internal-only. Has no effect if applied to a Description within a BugChecker.
[ "Internal", "-", "only", ".", "Has", "no", "effect", "if", "applied", "to", "a", "Description", "within", "a", "BugChecker", "." ]
train
https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/matchers/Description.java#L126-L129
google/error-prone
core/src/main/java/com/google/errorprone/bugpatterns/ModifiedButNotUsed.java
ModifiedButNotUsed.newFluentChain
private static boolean newFluentChain(ExpressionTree tree, VisitorState state) { """ Whether this is a chain of method invocations terminating in a new proto or collection builder. """ while (tree instanceof MethodInvocationTree && FLUENT_CHAIN.matches(tree, state)) { tree = getReceiver(tree); } ...
java
private static boolean newFluentChain(ExpressionTree tree, VisitorState state) { while (tree instanceof MethodInvocationTree && FLUENT_CHAIN.matches(tree, state)) { tree = getReceiver(tree); } return tree != null && FLUENT_CONSTRUCTOR.matches(tree, state); }
[ "private", "static", "boolean", "newFluentChain", "(", "ExpressionTree", "tree", ",", "VisitorState", "state", ")", "{", "while", "(", "tree", "instanceof", "MethodInvocationTree", "&&", "FLUENT_CHAIN", ".", "matches", "(", "tree", ",", "state", ")", ")", "{", ...
Whether this is a chain of method invocations terminating in a new proto or collection builder.
[ "Whether", "this", "is", "a", "chain", "of", "method", "invocations", "terminating", "in", "a", "new", "proto", "or", "collection", "builder", "." ]
train
https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/ModifiedButNotUsed.java#L299-L304
baratine/baratine
kraken/src/main/java/com/caucho/v5/kelp/segment/OutSegment.java
OutSegment.fsyncImpl
private void fsyncImpl(Result<Boolean> result, FsyncType fsyncType) { """ Syncs the segment to the disk. After the segment's data is synced, the headers can be written. A second sync is needed to complete the header writes. """ try { flushData(); ArrayList<SegmentFsyncCallback> fsyncLi...
java
private void fsyncImpl(Result<Boolean> result, FsyncType fsyncType) { try { flushData(); ArrayList<SegmentFsyncCallback> fsyncListeners = new ArrayList<>(_fsyncListeners); _fsyncListeners.clear(); Result<Boolean> resultNext = result.then((v,r)-> afterDataFsync...
[ "private", "void", "fsyncImpl", "(", "Result", "<", "Boolean", ">", "result", ",", "FsyncType", "fsyncType", ")", "{", "try", "{", "flushData", "(", ")", ";", "ArrayList", "<", "SegmentFsyncCallback", ">", "fsyncListeners", "=", "new", "ArrayList", "<>", "("...
Syncs the segment to the disk. After the segment's data is synced, the headers can be written. A second sync is needed to complete the header writes.
[ "Syncs", "the", "segment", "to", "the", "disk", ".", "After", "the", "segment", "s", "data", "is", "synced", "the", "headers", "can", "be", "written", ".", "A", "second", "sync", "is", "needed", "to", "complete", "the", "header", "writes", "." ]
train
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/segment/OutSegment.java#L476-L507
jbundle/jbundle
base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HPopupBox.java
HPopupBox.init
public void init(ScreenComponent model, boolean bEditableControl) { """ Constructor. @param model The model object for this view object. @param bEditableControl Is this control editable? """ super.init(model, bEditableControl); if (m_vDisplays == null) if (model.getConverter().get...
java
public void init(ScreenComponent model, boolean bEditableControl) { super.init(model, bEditableControl); if (m_vDisplays == null) if (model.getConverter().getString() == null) this.scanTableItems(); }
[ "public", "void", "init", "(", "ScreenComponent", "model", ",", "boolean", "bEditableControl", ")", "{", "super", ".", "init", "(", "model", ",", "bEditableControl", ")", ";", "if", "(", "m_vDisplays", "==", "null", ")", "if", "(", "model", ".", "getConver...
Constructor. @param model The model object for this view object. @param bEditableControl Is this control editable?
[ "Constructor", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HPopupBox.java#L61-L67
Azure/azure-sdk-for-java
containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ContainerServicesInner.java
ContainerServicesInner.getByResourceGroup
public ContainerServiceInner getByResourceGroup(String resourceGroupName, String containerServiceName) { """ Gets the properties of the specified container service. Gets the properties of the specified container service in the specified subscription and resource group. The operation returns the properties includi...
java
public ContainerServiceInner getByResourceGroup(String resourceGroupName, String containerServiceName) { return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerServiceName).toBlocking().single().body(); }
[ "public", "ContainerServiceInner", "getByResourceGroup", "(", "String", "resourceGroupName", ",", "String", "containerServiceName", ")", "{", "return", "getByResourceGroupWithServiceResponseAsync", "(", "resourceGroupName", ",", "containerServiceName", ")", ".", "toBlocking", ...
Gets the properties of the specified container service. Gets the properties of the specified container service in the specified subscription and resource group. The operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. @param resourceGroupName Th...
[ "Gets", "the", "properties", "of", "the", "specified", "container", "service", ".", "Gets", "the", "properties", "of", "the", "specified", "container", "service", "in", "the", "specified", "subscription", "and", "resource", "group", ".", "The", "operation", "ret...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ContainerServicesInner.java#L407-L409
exoplatform/jcr
exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/Utils.java
Utils.composeMembershipId
String composeMembershipId(Node groupNode, Node refUserNode, Node refTypeNode) throws RepositoryException { """ Compose membership identifier. For more information see {@link MembershipImpl} """ return groupNode.getUUID() + ',' + refUserNode.getName() + ',' + (refTypeN...
java
String composeMembershipId(Node groupNode, Node refUserNode, Node refTypeNode) throws RepositoryException { return groupNode.getUUID() + ',' + refUserNode.getName() + ',' + (refTypeNode.getName().equals(JCROrganizationServiceImpl.JOS_MEMBERSHIP_TYPE_ANY) ? Member...
[ "String", "composeMembershipId", "(", "Node", "groupNode", ",", "Node", "refUserNode", ",", "Node", "refTypeNode", ")", "throws", "RepositoryException", "{", "return", "groupNode", ".", "getUUID", "(", ")", "+", "'", "'", "+", "refUserNode", ".", "getName", "(...
Compose membership identifier. For more information see {@link MembershipImpl}
[ "Compose", "membership", "identifier", ".", "For", "more", "information", "see", "{" ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/Utils.java#L118-L126
threerings/nenya
core/src/main/java/com/threerings/miso/tile/FringeConfiguration.java
FringeConfiguration.fringesOn
public int fringesOn (int first, int second) { """ If the first base tileset fringes upon the second, return the fringe priority of the first base tileset, otherwise return -1. """ FringeRecord f1 = _frecs.get(first); // we better have a fringe record for the first if (null != f1) { ...
java
public int fringesOn (int first, int second) { FringeRecord f1 = _frecs.get(first); // we better have a fringe record for the first if (null != f1) { // it had better have some tilesets defined if (f1.tilesets.size() > 0) { FringeRecord f2 = _frecs....
[ "public", "int", "fringesOn", "(", "int", "first", ",", "int", "second", ")", "{", "FringeRecord", "f1", "=", "_frecs", ".", "get", "(", "first", ")", ";", "// we better have a fringe record for the first", "if", "(", "null", "!=", "f1", ")", "{", "// it had...
If the first base tileset fringes upon the second, return the fringe priority of the first base tileset, otherwise return -1.
[ "If", "the", "first", "base", "tileset", "fringes", "upon", "the", "second", "return", "the", "fringe", "priority", "of", "the", "first", "base", "tileset", "otherwise", "return", "-", "1", "." ]
train
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/tile/FringeConfiguration.java#L119-L140
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/PoolInfo.java
PoolInfo.createPoolInfo
public static PoolInfo createPoolInfo(String poolInfoString) { """ Create PoolInfo object from a properly formatted string <poolgroup>.<pool> or return null @param poolInfoString String to parse @return Valid PoolInfo object or null if unable to parse """ if (poolInfoString == null || poolInfoString.i...
java
public static PoolInfo createPoolInfo(String poolInfoString) { if (poolInfoString == null || poolInfoString.isEmpty()) { LOG.warn("createPoolInfo: Null or empty input " + poolInfoString); return null; } String[] poolInfoSplitString = poolInfoString.split("[.]"); if (poolInfoSplitString.leng...
[ "public", "static", "PoolInfo", "createPoolInfo", "(", "String", "poolInfoString", ")", "{", "if", "(", "poolInfoString", "==", "null", "||", "poolInfoString", ".", "isEmpty", "(", ")", ")", "{", "LOG", ".", "warn", "(", "\"createPoolInfo: Null or empty input \"",...
Create PoolInfo object from a properly formatted string <poolgroup>.<pool> or return null @param poolInfoString String to parse @return Valid PoolInfo object or null if unable to parse
[ "Create", "PoolInfo", "object", "from", "a", "properly", "formatted", "string", "<poolgroup", ">", ".", "<pool", ">", "or", "return", "null" ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/PoolInfo.java#L111-L124
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/AbstractCachedGenerator.java
AbstractCachedGenerator.checkResourcesModified
protected boolean checkResourcesModified(GeneratorContext context, List<FilePathMapping> fMappings) { """ Checks if the resources have been modified @param context the generator context @param fMappings the list of resources to check @return true if the resources have been modified """ boolean resourc...
java
protected boolean checkResourcesModified(GeneratorContext context, List<FilePathMapping> fMappings) { boolean resourceModified = false; for (Iterator<FilePathMapping> iter = fMappings.iterator(); iter.hasNext() && !resourceModified;) { FilePathMapping fMapping = iter.next(); resourceModified = fMapping.getLa...
[ "protected", "boolean", "checkResourcesModified", "(", "GeneratorContext", "context", ",", "List", "<", "FilePathMapping", ">", "fMappings", ")", "{", "boolean", "resourceModified", "=", "false", ";", "for", "(", "Iterator", "<", "FilePathMapping", ">", "iter", "=...
Checks if the resources have been modified @param context the generator context @param fMappings the list of resources to check @return true if the resources have been modified
[ "Checks", "if", "the", "resources", "have", "been", "modified" ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/AbstractCachedGenerator.java#L435-L443
apiman/apiman
gateway/engine/core/src/main/java/io/apiman/gateway/engine/policy/PolicyFactoryImpl.java
PolicyFactoryImpl.doLoadFromPlugin
private void doLoadFromPlugin(final String policyImpl, final IAsyncResultHandler<IPolicy> handler) { """ Loads a policy from a plugin. @param policyImpl @param handler """ PluginCoordinates coordinates = PluginCoordinates.fromPolicySpec(policyImpl); if (coordinates == null) { hand...
java
private void doLoadFromPlugin(final String policyImpl, final IAsyncResultHandler<IPolicy> handler) { PluginCoordinates coordinates = PluginCoordinates.fromPolicySpec(policyImpl); if (coordinates == null) { handler.handle(AsyncResultImpl.<IPolicy>create(new PolicyNotFoundException(policyImpl)...
[ "private", "void", "doLoadFromPlugin", "(", "final", "String", "policyImpl", ",", "final", "IAsyncResultHandler", "<", "IPolicy", ">", "handler", ")", "{", "PluginCoordinates", "coordinates", "=", "PluginCoordinates", ".", "fromPolicySpec", "(", "policyImpl", ")", "...
Loads a policy from a plugin. @param policyImpl @param handler
[ "Loads", "a", "policy", "from", "a", "plugin", "." ]
train
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/policy/PolicyFactoryImpl.java#L152-L190
youseries/urule
urule-console/src/main/java/com/bstek/urule/console/repository/database/DbPersistenceManager.java
DbPersistenceManager.createCheckSchemaOperation
protected CheckSchemaOperation createCheckSchemaOperation() { """ This method is called from {@link #init(PMContext)} after the {@link #createConnectionHelper(DataSource)} method, and returns a default {@link CheckSchemaOperation}. Subclasses can overrride this implementation to get a customized implementation. ...
java
protected CheckSchemaOperation createCheckSchemaOperation() { InputStream in = AbstractBundlePersistenceManager.class.getResourceAsStream( databaseType + ".ddl"); return new CheckSchemaOperation(conHelper, in, schemaObjectPrefix + "BUNDLE").addVariableReplacement( ...
[ "protected", "CheckSchemaOperation", "createCheckSchemaOperation", "(", ")", "{", "InputStream", "in", "=", "AbstractBundlePersistenceManager", ".", "class", ".", "getResourceAsStream", "(", "databaseType", "+", "\".ddl\"", ")", ";", "return", "new", "CheckSchemaOperation...
This method is called from {@link #init(PMContext)} after the {@link #createConnectionHelper(DataSource)} method, and returns a default {@link CheckSchemaOperation}. Subclasses can overrride this implementation to get a customized implementation. @return a new {@link CheckSchemaOperation} instance
[ "This", "method", "is", "called", "from", "{", "@link", "#init", "(", "PMContext", ")", "}", "after", "the", "{", "@link", "#createConnectionHelper", "(", "DataSource", ")", "}", "method", "and", "returns", "a", "default", "{", "@link", "CheckSchemaOperation",...
train
https://github.com/youseries/urule/blob/3fa0eb4439e97aa292e744bcbd88a9faa36661d8/urule-console/src/main/java/com/bstek/urule/console/repository/database/DbPersistenceManager.java#L577-L583
undertow-io/undertow
servlet/src/main/java/io/undertow/servlet/Servlets.java
Servlets.multipartConfig
public static MultipartConfigElement multipartConfig(String location, long maxFileSize, long maxRequestSize, int fileSizeThreshold) { """ Creates a new multipart config element @param location the directory location where files will be stored @param maxFileSize the maximum size allowed for uploa...
java
public static MultipartConfigElement multipartConfig(String location, long maxFileSize, long maxRequestSize, int fileSizeThreshold) { return new MultipartConfigElement(location, maxFileSize, maxRequestSize, fileSizeThreshold); }
[ "public", "static", "MultipartConfigElement", "multipartConfig", "(", "String", "location", ",", "long", "maxFileSize", ",", "long", "maxRequestSize", ",", "int", "fileSizeThreshold", ")", "{", "return", "new", "MultipartConfigElement", "(", "location", ",", "maxFileS...
Creates a new multipart config element @param location the directory location where files will be stored @param maxFileSize the maximum size allowed for uploaded files @param maxRequestSize the maximum size allowed for multipart/form-data requests @param fileSizeThreshold the size threshold after whi...
[ "Creates", "a", "new", "multipart", "config", "element" ]
train
https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/servlet/src/main/java/io/undertow/servlet/Servlets.java#L159-L161
sailthru/sailthru-java-client
src/main/com/sailthru/client/SailthruClient.java
SailthruClient.cancelSend
public JsonResponse cancelSend(String sendId) throws IOException { """ Cancel a send that was scheduled for a future time. @param sendId @return JsonResponse @throws IOException """ Map<String, Object> data = new HashMap<String, Object>(); data.put(Send.PARAM_SEND_ID, sendId); return...
java
public JsonResponse cancelSend(String sendId) throws IOException { Map<String, Object> data = new HashMap<String, Object>(); data.put(Send.PARAM_SEND_ID, sendId); return apiDelete(ApiAction.send, data); }
[ "public", "JsonResponse", "cancelSend", "(", "String", "sendId", ")", "throws", "IOException", "{", "Map", "<", "String", ",", "Object", ">", "data", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ";", "data", ".", "put", "(", "Sen...
Cancel a send that was scheduled for a future time. @param sendId @return JsonResponse @throws IOException
[ "Cancel", "a", "send", "that", "was", "scheduled", "for", "a", "future", "time", "." ]
train
https://github.com/sailthru/sailthru-java-client/blob/62b491f6a39b41b836bfc021779200d29b6d2069/src/main/com/sailthru/client/SailthruClient.java#L133-L137
m-m-m/util
exception/src/main/java/net/sf/mmm/util/exception/api/NlsRuntimeException.java
NlsRuntimeException.printStackTraceCause
private static void printStackTraceCause(Throwable cause, Locale locale, Appendable buffer) throws IOException { """ @see NlsThrowable#printStackTrace(Locale, Appendable) @param cause is the {@link Throwable} to print. @param locale is the {@link Locale} to translate to. @param buffer is where to write the st...
java
private static void printStackTraceCause(Throwable cause, Locale locale, Appendable buffer) throws IOException { if (cause instanceof NlsThrowable) { ((NlsThrowable) cause).printStackTrace(locale, buffer); } else { if (buffer instanceof PrintStream) { cause.printStackTrace((PrintStream) buf...
[ "private", "static", "void", "printStackTraceCause", "(", "Throwable", "cause", ",", "Locale", "locale", ",", "Appendable", "buffer", ")", "throws", "IOException", "{", "if", "(", "cause", "instanceof", "NlsThrowable", ")", "{", "(", "(", "NlsThrowable", ")", ...
@see NlsThrowable#printStackTrace(Locale, Appendable) @param cause is the {@link Throwable} to print. @param locale is the {@link Locale} to translate to. @param buffer is where to write the stack trace to. @throws IOException if caused by {@code buffer}.
[ "@see", "NlsThrowable#printStackTrace", "(", "Locale", "Appendable", ")" ]
train
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/exception/src/main/java/net/sf/mmm/util/exception/api/NlsRuntimeException.java#L229-L246
zaproxy/zaproxy
src/org/zaproxy/zap/utils/LocaleUtils.java
LocaleUtils.createResourceFilesRegex
public static String createResourceFilesRegex(String fileName, String fileExtension) { """ Returns a regular expression to match source and translated resource filenames with the given {@code fileName} and {@code fileExtension}. <p> For example, with {@code fileName} as "Messages" and {@code fileExtension} as "...
java
public static String createResourceFilesRegex(String fileName, String fileExtension) { if (fileName == null) { throw new IllegalArgumentException("Parameter fileName must not be null."); } if (fileExtension == null) { throw new IllegalArgumentException("Parameter fileExtension must not be null."); }...
[ "public", "static", "String", "createResourceFilesRegex", "(", "String", "fileName", ",", "String", "fileExtension", ")", "{", "if", "(", "fileName", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Parameter fileName must not be null.\"", "...
Returns a regular expression to match source and translated resource filenames with the given {@code fileName} and {@code fileExtension}. <p> For example, with {@code fileName} as "Messages" and {@code fileExtension} as ".properties" the returned pattern would match: <ul> <li>Messages.properties</li> <li>Messages_en.pr...
[ "Returns", "a", "regular", "expression", "to", "match", "source", "and", "translated", "resource", "filenames", "with", "the", "given", "{", "@code", "fileName", "}", "and", "{", "@code", "fileExtension", "}", ".", "<p", ">", "For", "example", "with", "{", ...
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/utils/LocaleUtils.java#L301-L317
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java
MappedParametrizedObjectEntry.getParameterLong
public Long getParameterLong(String name) throws RepositoryConfigurationException { """ Parse named parameter as Long. @param name parameter name @return Long value @throws RepositoryConfigurationException """ try { return StringNumberParser.parseLong(getParameterValue(name)); ...
java
public Long getParameterLong(String name) throws RepositoryConfigurationException { try { return StringNumberParser.parseLong(getParameterValue(name)); } catch (NumberFormatException e) { throw new RepositoryConfigurationException(name + ": unparseable Long. " + e, e);...
[ "public", "Long", "getParameterLong", "(", "String", "name", ")", "throws", "RepositoryConfigurationException", "{", "try", "{", "return", "StringNumberParser", ".", "parseLong", "(", "getParameterValue", "(", "name", ")", ")", ";", "}", "catch", "(", "NumberForma...
Parse named parameter as Long. @param name parameter name @return Long value @throws RepositoryConfigurationException
[ "Parse", "named", "parameter", "as", "Long", "." ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java#L226-L236
telly/groundy
library/src/main/java/com/telly/groundy/Groundy.java
Groundy.arg
public Groundy arg(String key, Parcelable value) { """ Inserts a Parcelable value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null. @param key a String, or null @param value a Parcelable object, or null """ mArgs.putParcelable(key, value...
java
public Groundy arg(String key, Parcelable value) { mArgs.putParcelable(key, value); return this; }
[ "public", "Groundy", "arg", "(", "String", "key", ",", "Parcelable", "value", ")", "{", "mArgs", ".", "putParcelable", "(", "key", ",", "value", ")", ";", "return", "this", ";", "}" ]
Inserts a Parcelable value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null. @param key a String, or null @param value a Parcelable object, or null
[ "Inserts", "a", "Parcelable", "value", "into", "the", "mapping", "of", "this", "Bundle", "replacing", "any", "existing", "value", "for", "the", "given", "key", ".", "Either", "key", "or", "value", "may", "be", "null", "." ]
train
https://github.com/telly/groundy/blob/e90baf9901a8be20b348bd1575d5ad782560cec8/library/src/main/java/com/telly/groundy/Groundy.java#L536-L539
joaovicente/Tracy
src/main/java/com/apm4all/tracy/TracyFutureTask.java
TracyFutureTask.get
@Override public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { """ When called from the parent thread to retrieve callable result, it will merge the worker TracyThreadContext into the parent TracyThreadContext """ V v = super.get(timeout, un...
java
@Override public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { V v = super.get(timeout, unit); this.mergeWorkerTracyTheadContext(); return v; }
[ "@", "Override", "public", "V", "get", "(", "long", "timeout", ",", "TimeUnit", "unit", ")", "throws", "InterruptedException", ",", "ExecutionException", ",", "TimeoutException", "{", "V", "v", "=", "super", ".", "get", "(", "timeout", ",", "unit", ")", ";...
When called from the parent thread to retrieve callable result, it will merge the worker TracyThreadContext into the parent TracyThreadContext
[ "When", "called", "from", "the", "parent", "thread", "to", "retrieve", "callable", "result", "it", "will", "merge", "the", "worker", "TracyThreadContext", "into", "the", "parent", "TracyThreadContext" ]
train
https://github.com/joaovicente/Tracy/blob/822d3aa335c1801df25ae6e67c22466368de3747/src/main/java/com/apm4all/tracy/TracyFutureTask.java#L55-L60
apache/groovy
src/main/java/org/codehaus/groovy/syntax/CSTNode.java
CSTNode.get
public CSTNode get(int index, boolean safe) { """ Returns the specified element, or Token.NULL if safe is set and the specified element is null (or doesn't exist). """ CSTNode element = get(index); if (element == null && safe) { element = Token.NULL; } return elem...
java
public CSTNode get(int index, boolean safe) { CSTNode element = get(index); if (element == null && safe) { element = Token.NULL; } return element; }
[ "public", "CSTNode", "get", "(", "int", "index", ",", "boolean", "safe", ")", "{", "CSTNode", "element", "=", "get", "(", "index", ")", ";", "if", "(", "element", "==", "null", "&&", "safe", ")", "{", "element", "=", "Token", ".", "NULL", ";", "}",...
Returns the specified element, or Token.NULL if safe is set and the specified element is null (or doesn't exist).
[ "Returns", "the", "specified", "element", "or", "Token", ".", "NULL", "if", "safe", "is", "set", "and", "the", "specified", "element", "is", "null", "(", "or", "doesn", "t", "exist", ")", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/syntax/CSTNode.java#L211-L219
youngmonkeys/ezyfox-sfs2x
src/main/java/com/tvd12/ezyfox/sfs2x/clienthandler/ClientEventHandler.java
ClientEventHandler.responseErrorToClient
private void responseErrorToClient(Exception ex, User user) { """ Response error to client @param ex the exception @param user the recipient """ BadRequestException e = getBadRequestException(ex); if(!e.isSendToClient()) return; ISFSObject params = new SFSObject(); params.putUtfStrin...
java
private void responseErrorToClient(Exception ex, User user) { BadRequestException e = getBadRequestException(ex); if(!e.isSendToClient()) return; ISFSObject params = new SFSObject(); params.putUtfString(APIKey.MESSAGE, e.getReason()); params.putInt(APIKey.CODE, e.getCode()); send(APIKey...
[ "private", "void", "responseErrorToClient", "(", "Exception", "ex", ",", "User", "user", ")", "{", "BadRequestException", "e", "=", "getBadRequestException", "(", "ex", ")", ";", "if", "(", "!", "e", ".", "isSendToClient", "(", ")", ")", "return", ";", "IS...
Response error to client @param ex the exception @param user the recipient
[ "Response", "error", "to", "client" ]
train
https://github.com/youngmonkeys/ezyfox-sfs2x/blob/7e004033a3b551c3ae970a0c8f45db7b1ec144de/src/main/java/com/tvd12/ezyfox/sfs2x/clienthandler/ClientEventHandler.java#L171-L178