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 |
|---|---|---|---|---|---|---|---|---|---|---|
JOML-CI/JOML | src/org/joml/Vector4i.java | Vector4i.set | public Vector4i set(int index, ByteBuffer buffer) {
"""
Read this vector from the supplied {@link ByteBuffer} starting at the
specified absolute buffer position/index.
<p>
This method will not increment the position of the given ByteBuffer.
@param index
the absolute position into the ByteBuffer
@param buff... | java | public Vector4i set(int index, ByteBuffer buffer) {
MemUtil.INSTANCE.get(this, index, buffer);
return this;
} | [
"public",
"Vector4i",
"set",
"(",
"int",
"index",
",",
"ByteBuffer",
"buffer",
")",
"{",
"MemUtil",
".",
"INSTANCE",
".",
"get",
"(",
"this",
",",
"index",
",",
"buffer",
")",
";",
"return",
"this",
";",
"}"
] | Read this vector from the supplied {@link ByteBuffer} starting at the
specified absolute buffer position/index.
<p>
This method will not increment the position of the given ByteBuffer.
@param index
the absolute position into the ByteBuffer
@param buffer
values will be read in <code>x, y, z, w</code> order
@return this | [
"Read",
"this",
"vector",
"from",
"the",
"supplied",
"{",
"@link",
"ByteBuffer",
"}",
"starting",
"at",
"the",
"specified",
"absolute",
"buffer",
"position",
"/",
"index",
".",
"<p",
">",
"This",
"method",
"will",
"not",
"increment",
"the",
"position",
"of",... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Vector4i.java#L375-L378 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/search/bingimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/search/imagesearch/implementation/BingImagesImpl.java | BingImagesImpl.searchWithServiceResponseAsync | public Observable<ServiceResponse<ImagesModel>> searchWithServiceResponseAsync(String query, SearchOptionalParameter searchOptionalParameter) {
"""
The Image Search API lets you send a search query to Bing and get back a list of relevant images. This section provides technical details about the query parameters an... | java | public Observable<ServiceResponse<ImagesModel>> searchWithServiceResponseAsync(String query, SearchOptionalParameter searchOptionalParameter) {
if (query == null) {
throw new IllegalArgumentException("Parameter query is required and cannot be null.");
}
final String acceptLanguage = ... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"ImagesModel",
">",
">",
"searchWithServiceResponseAsync",
"(",
"String",
"query",
",",
"SearchOptionalParameter",
"searchOptionalParameter",
")",
"{",
"if",
"(",
"query",
"==",
"null",
")",
"{",
"throw",
"new",
... | The Image Search API lets you send a search query to Bing and get back a list of relevant images. This section provides technical details about the query parameters and headers that you use to request images and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the... | [
"The",
"Image",
"Search",
"API",
"lets",
"you",
"send",
"a",
"search",
"query",
"to",
"Bing",
"and",
"get",
"back",
"a",
"list",
"of",
"relevant",
"images",
".",
"This",
"section",
"provides",
"technical",
"details",
"about",
"the",
"query",
"parameters",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/search/bingimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/search/imagesearch/implementation/BingImagesImpl.java#L140-L173 |
tvesalainen/util | vfs/src/main/java/org/vesalainen/vfs/VirtualFileSystems.java | VirtualFileSystems.newFileSystem | public static final FileSystem newFileSystem(Path path, Map<String,?> env) throws IOException {
"""
Constructs a new FileSystem to access the contents of a file as a file system.
@param path
@param env
@return
@throws IOException
"""
return getDefault().provider().newFileSystem(path, env);
} | java | public static final FileSystem newFileSystem(Path path, Map<String,?> env) throws IOException
{
return getDefault().provider().newFileSystem(path, env);
} | [
"public",
"static",
"final",
"FileSystem",
"newFileSystem",
"(",
"Path",
"path",
",",
"Map",
"<",
"String",
",",
"?",
">",
"env",
")",
"throws",
"IOException",
"{",
"return",
"getDefault",
"(",
")",
".",
"provider",
"(",
")",
".",
"newFileSystem",
"(",
"... | Constructs a new FileSystem to access the contents of a file as a file system.
@param path
@param env
@return
@throws IOException | [
"Constructs",
"a",
"new",
"FileSystem",
"to",
"access",
"the",
"contents",
"of",
"a",
"file",
"as",
"a",
"file",
"system",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/vfs/src/main/java/org/vesalainen/vfs/VirtualFileSystems.java#L47-L50 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/PeerGroup.java | PeerGroup.broadcastTransaction | public TransactionBroadcast broadcastTransaction(final Transaction tx, final int minConnections) {
"""
<p>Given a transaction, sends it un-announced to one peer and then waits for it to be received back from other
peers. Once all connected peers have announced the transaction, the future available via the
{@link... | java | public TransactionBroadcast broadcastTransaction(final Transaction tx, final int minConnections) {
// If we don't have a record of where this tx came from already, set it to be ourselves so Peer doesn't end up
// redownloading it from the network redundantly.
if (tx.getConfidence().getSource().e... | [
"public",
"TransactionBroadcast",
"broadcastTransaction",
"(",
"final",
"Transaction",
"tx",
",",
"final",
"int",
"minConnections",
")",
"{",
"// If we don't have a record of where this tx came from already, set it to be ourselves so Peer doesn't end up",
"// redownloading it from the ne... | <p>Given a transaction, sends it un-announced to one peer and then waits for it to be received back from other
peers. Once all connected peers have announced the transaction, the future available via the
{@link TransactionBroadcast#future()} method will be completed. If anything goes
wrong the exception will be thrown ... | [
"<p",
">",
"Given",
"a",
"transaction",
"sends",
"it",
"un",
"-",
"announced",
"to",
"one",
"peer",
"and",
"then",
"waits",
"for",
"it",
"to",
"be",
"received",
"back",
"from",
"other",
"peers",
".",
"Once",
"all",
"connected",
"peers",
"have",
"announce... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/PeerGroup.java#L2042-L2086 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScannerSet.java | DataBlockScannerSet.verifiedByClient | synchronized void verifiedByClient(int namespaceId, Block block) {
"""
/*
A reader will try to indicate a block is verified and will add blocks to
the DataBlockScannerSet before they are finished (due to concurrent
readers).
fixed so a read verification can't add the block
"""
DataBlockScanner nsScan... | java | synchronized void verifiedByClient(int namespaceId, Block block) {
DataBlockScanner nsScanner = getNSScanner(namespaceId);
if (nsScanner != null) {
nsScanner.updateScanStatusUpdateOnly(block,
DataBlockScanner.ScanType.REMOTE_READ, true);
} else {
LOG.warn("No namespace scanner found fo... | [
"synchronized",
"void",
"verifiedByClient",
"(",
"int",
"namespaceId",
",",
"Block",
"block",
")",
"{",
"DataBlockScanner",
"nsScanner",
"=",
"getNSScanner",
"(",
"namespaceId",
")",
";",
"if",
"(",
"nsScanner",
"!=",
"null",
")",
"{",
"nsScanner",
".",
"updat... | /*
A reader will try to indicate a block is verified and will add blocks to
the DataBlockScannerSet before they are finished (due to concurrent
readers).
fixed so a read verification can't add the block | [
"/",
"*",
"A",
"reader",
"will",
"try",
"to",
"indicate",
"a",
"block",
"is",
"verified",
"and",
"will",
"add",
"blocks",
"to",
"the",
"DataBlockScannerSet",
"before",
"they",
"are",
"finished",
"(",
"due",
"to",
"concurrent",
"readers",
")",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScannerSet.java#L371-L379 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/AbstractDb.java | AbstractDb.execute | public int execute(String sql, Object... params) throws SQLException {
"""
执行非查询语句<br>
语句包括 插入、更新、删除
@param sql SQL
@param params 参数
@return 影响行数
@throws SQLException SQL执行异常
"""
Connection conn = null;
try {
conn = this.getConnection();
return SqlExecutor.execute(conn, sql, params);
} ... | java | public int execute(String sql, Object... params) throws SQLException {
Connection conn = null;
try {
conn = this.getConnection();
return SqlExecutor.execute(conn, sql, params);
} catch (SQLException e) {
throw e;
} finally {
this.closeConnection(conn);
}
} | [
"public",
"int",
"execute",
"(",
"String",
"sql",
",",
"Object",
"...",
"params",
")",
"throws",
"SQLException",
"{",
"Connection",
"conn",
"=",
"null",
";",
"try",
"{",
"conn",
"=",
"this",
".",
"getConnection",
"(",
")",
";",
"return",
"SqlExecutor",
"... | 执行非查询语句<br>
语句包括 插入、更新、删除
@param sql SQL
@param params 参数
@return 影响行数
@throws SQLException SQL执行异常 | [
"执行非查询语句<br",
">",
"语句包括",
"插入、更新、删除"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/AbstractDb.java#L165-L175 |
jnidzwetzki/bitfinex-v2-wss-api-java | src/main/java/com/github/jnidzwetzki/bitfinex/v2/SimpleBitfinexApiBroker.java | SimpleBitfinexApiBroker.authenticateAndWait | private void authenticateAndWait(final CountDownLatch latch) throws InterruptedException, BitfinexClientException {
"""
Execute the authentication and wait until the socket is ready
@throws InterruptedException
@throws BitfinexClientException
"""
if (authenticated) {
return;
}
sendCommand(new AuthCo... | java | private void authenticateAndWait(final CountDownLatch latch) throws InterruptedException, BitfinexClientException {
if (authenticated) {
return;
}
sendCommand(new AuthCommand(configuration.getAuthNonceProducer()));
logger.debug("Waiting for connection ready events");
latch.await(10, TimeUnit.SECONDS);
i... | [
"private",
"void",
"authenticateAndWait",
"(",
"final",
"CountDownLatch",
"latch",
")",
"throws",
"InterruptedException",
",",
"BitfinexClientException",
"{",
"if",
"(",
"authenticated",
")",
"{",
"return",
";",
"}",
"sendCommand",
"(",
"new",
"AuthCommand",
"(",
... | Execute the authentication and wait until the socket is ready
@throws InterruptedException
@throws BitfinexClientException | [
"Execute",
"the",
"authentication",
"and",
"wait",
"until",
"the",
"socket",
"is",
"ready"
] | train | https://github.com/jnidzwetzki/bitfinex-v2-wss-api-java/blob/2e6adf1eb6f8cd4c8722f1619f78ab2cc3c600ee/src/main/java/com/github/jnidzwetzki/bitfinex/v2/SimpleBitfinexApiBroker.java#L502-L513 |
danieldk/conllx-io | src/main/java/eu/danieldk/nlp/conllx/reader/CONLLReader.java | CONLLReader.constructSentence | private Sentence constructSentence(List<Token> tokens) throws IOException {
"""
Construct a sentence. If strictness is used and invariants do not hold, convert
the exception to an IOException.
"""
Sentence sentence;
try {
sentence = new SimpleSentence(tokens, strict);
} cat... | java | private Sentence constructSentence(List<Token> tokens) throws IOException {
Sentence sentence;
try {
sentence = new SimpleSentence(tokens, strict);
} catch (IllegalArgumentException e) {
throw new IOException(e.getMessage());
}
return sentence;
} | [
"private",
"Sentence",
"constructSentence",
"(",
"List",
"<",
"Token",
">",
"tokens",
")",
"throws",
"IOException",
"{",
"Sentence",
"sentence",
";",
"try",
"{",
"sentence",
"=",
"new",
"SimpleSentence",
"(",
"tokens",
",",
"strict",
")",
";",
"}",
"catch",
... | Construct a sentence. If strictness is used and invariants do not hold, convert
the exception to an IOException. | [
"Construct",
"a",
"sentence",
".",
"If",
"strictness",
"is",
"used",
"and",
"invariants",
"do",
"not",
"hold",
"convert",
"the",
"exception",
"to",
"an",
"IOException",
"."
] | train | https://github.com/danieldk/conllx-io/blob/c1e6028bc3394f000b1efe231ae7e7f625e10d64/src/main/java/eu/danieldk/nlp/conllx/reader/CONLLReader.java#L115-L123 |
CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java | CleverTapAPI.pushProfile | @SuppressWarnings( {
"""
Push a profile update.
@param profile A {@link Map}, with keys as strings, and values as {@link String},
{@link Integer}, {@link Long}, {@link Boolean}, {@link Float}, {@link Double},
{@link java.util.Date}, or {@link Character}
""""unused", "WeakerAccess"})
public void pushPr... | java | @SuppressWarnings({"unused", "WeakerAccess"})
public void pushProfile(final Map<String, Object> profile) {
if (profile == null || profile.isEmpty())
return;
postAsyncSafely("profilePush", new Runnable() {
@Override
public void run() {
_push(profil... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unused\"",
",",
"\"WeakerAccess\"",
"}",
")",
"public",
"void",
"pushProfile",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"profile",
")",
"{",
"if",
"(",
"profile",
"==",
"null",
"||",
"profile",
".",
"i... | Push a profile update.
@param profile A {@link Map}, with keys as strings, and values as {@link String},
{@link Integer}, {@link Long}, {@link Boolean}, {@link Float}, {@link Double},
{@link java.util.Date}, or {@link Character} | [
"Push",
"a",
"profile",
"update",
"."
] | train | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java#L3130-L3141 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dictionary/CustomDictionary.java | CustomDictionary.parseText | public static void parseText(String text, AhoCorasickDoubleArrayTrie.IHit<CoreDictionary.Attribute> processor) {
"""
解析一段文本(目前采用了BinTrie+DAT的混合储存形式,此方法可以统一两个数据结构)
@param text 文本
@param processor 处理器
"""
if (trie != null)
{
BaseSearcher searcher = CustomDictionary.getSea... | java | public static void parseText(String text, AhoCorasickDoubleArrayTrie.IHit<CoreDictionary.Attribute> processor)
{
if (trie != null)
{
BaseSearcher searcher = CustomDictionary.getSearcher(text);
int offset;
Map.Entry<String, CoreDictionary.Attribute> entry;
... | [
"public",
"static",
"void",
"parseText",
"(",
"String",
"text",
",",
"AhoCorasickDoubleArrayTrie",
".",
"IHit",
"<",
"CoreDictionary",
".",
"Attribute",
">",
"processor",
")",
"{",
"if",
"(",
"trie",
"!=",
"null",
")",
"{",
"BaseSearcher",
"searcher",
"=",
"... | 解析一段文本(目前采用了BinTrie+DAT的混合储存形式,此方法可以统一两个数据结构)
@param text 文本
@param processor 处理器 | [
"解析一段文本(目前采用了BinTrie",
"+",
"DAT的混合储存形式,此方法可以统一两个数据结构)"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dictionary/CustomDictionary.java#L578-L596 |
sdl/odata | odata_client/src/main/java/com/sdl/odata/client/marshall/AtomEntityUnmarshaller.java | AtomEntityUnmarshaller.atomUnmarshall | public Object atomUnmarshall(String oDataEntityXml, String fullResponse, ODataClientQuery query)
throws UnsupportedEncodingException, ODataClientException {
"""
Unmarshalls an Atom XML form of on OData entity into the actual entity (DTO) object.
@param oDataEntityXml the Atom XML form of on OData en... | java | public Object atomUnmarshall(String oDataEntityXml, String fullResponse, ODataClientQuery query)
throws UnsupportedEncodingException, ODataClientException {
Object unmarshalledEntity;
// build a dummy request context which contains the Xml
ODataRequest request = buildODataRequestFrom... | [
"public",
"Object",
"atomUnmarshall",
"(",
"String",
"oDataEntityXml",
",",
"String",
"fullResponse",
",",
"ODataClientQuery",
"query",
")",
"throws",
"UnsupportedEncodingException",
",",
"ODataClientException",
"{",
"Object",
"unmarshalledEntity",
";",
"// build a dummy re... | Unmarshalls an Atom XML form of on OData entity into the actual entity (DTO) object.
@param oDataEntityXml the Atom XML form of on OData entity
@return an entity (DTO) object
@throws java.io.UnsupportedEncodingException
@throws ODataClientException | [
"Unmarshalls",
"an",
"Atom",
"XML",
"form",
"of",
"on",
"OData",
"entity",
"into",
"the",
"actual",
"entity",
"(",
"DTO",
")",
"object",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_client/src/main/java/com/sdl/odata/client/marshall/AtomEntityUnmarshaller.java#L147-L165 |
OpenLiberty/open-liberty | dev/com.ibm.ws.collector/src/com/ibm/ws/collector/Collector.java | Collector.configure | private void configure(Map<String, Object> configuration) throws IOException {
"""
/*
Process the configuration and create the relevant tasks
Target is also initialized using the information provided in the configuration
"""
List<TaskConfig> configList = new ArrayList<TaskConfig>();
configLis... | java | private void configure(Map<String, Object> configuration) throws IOException {
List<TaskConfig> configList = new ArrayList<TaskConfig>();
configList.addAll(parseConfig(configuration));
for (TaskConfig taskConfig : configList) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEn... | [
"private",
"void",
"configure",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"configuration",
")",
"throws",
"IOException",
"{",
"List",
"<",
"TaskConfig",
">",
"configList",
"=",
"new",
"ArrayList",
"<",
"TaskConfig",
">",
"(",
")",
";",
"configList",
"... | /*
Process the configuration and create the relevant tasks
Target is also initialized using the information provided in the configuration | [
"/",
"*",
"Process",
"the",
"configuration",
"and",
"create",
"the",
"relevant",
"tasks",
"Target",
"is",
"also",
"initialized",
"using",
"the",
"information",
"provided",
"in",
"the",
"configuration"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.collector/src/com/ibm/ws/collector/Collector.java#L178-L202 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Scroller.java | Scroller.scrollToSide | @SuppressWarnings("deprecation")
public void scrollToSide(Side side, float scrollPosition, int stepCount) {
"""
Scrolls horizontally.
@param side the side to which to scroll; {@link Side#RIGHT} or {@link Side#LEFT}
@param scrollPosition the position to scroll to, from 0 to 1 where 1 is all the way. Example is... | java | @SuppressWarnings("deprecation")
public void scrollToSide(Side side, float scrollPosition, int stepCount) {
WindowManager windowManager = (WindowManager)
inst.getTargetContext().getSystemService(Context.WINDOW_SERVICE);
int screenHeight = windowManager.getDefaultDisplay()
.getHeight();
int screenWidth ... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"void",
"scrollToSide",
"(",
"Side",
"side",
",",
"float",
"scrollPosition",
",",
"int",
"stepCount",
")",
"{",
"WindowManager",
"windowManager",
"=",
"(",
"WindowManager",
")",
"inst",
".",
"getTar... | Scrolls horizontally.
@param side the side to which to scroll; {@link Side#RIGHT} or {@link Side#LEFT}
@param scrollPosition the position to scroll to, from 0 to 1 where 1 is all the way. Example is: 0.55.
@param stepCount how many move steps to include in the scroll. Less steps results in a faster scroll | [
"Scrolls",
"horizontally",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Scroller.java#L346-L361 |
mabe02/lanterna | src/main/java/com/googlecode/lanterna/terminal/swing/TerminalEmulatorPalette.java | TerminalEmulatorPalette.get | public Color get(TextColor.ANSI color, boolean isForeground, boolean useBrightTones) {
"""
Returns the AWT color from this palette given an ANSI color and two hints for if we are looking for a background
color and if we want to use the bright version.
@param color Which ANSI color we want to extract
@param isFo... | java | public Color get(TextColor.ANSI color, boolean isForeground, boolean useBrightTones) {
if(useBrightTones) {
switch(color) {
case BLACK:
return brightBlack;
case BLUE:
return brightBlue;
case CYAN:
... | [
"public",
"Color",
"get",
"(",
"TextColor",
".",
"ANSI",
"color",
",",
"boolean",
"isForeground",
",",
"boolean",
"useBrightTones",
")",
"{",
"if",
"(",
"useBrightTones",
")",
"{",
"switch",
"(",
"color",
")",
"{",
"case",
"BLACK",
":",
"return",
"brightBl... | Returns the AWT color from this palette given an ANSI color and two hints for if we are looking for a background
color and if we want to use the bright version.
@param color Which ANSI color we want to extract
@param isForeground Is this color we extract going to be used as a background color?
@param useBrightTones If ... | [
"Returns",
"the",
"AWT",
"color",
"from",
"this",
"palette",
"given",
"an",
"ANSI",
"color",
"and",
"two",
"hints",
"for",
"if",
"we",
"are",
"looking",
"for",
"a",
"background",
"color",
"and",
"if",
"we",
"want",
"to",
"use",
"the",
"bright",
"version"... | train | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/terminal/swing/TerminalEmulatorPalette.java#L284-L330 |
livetribe/livetribe-slp | core/src/main/java/org/livetribe/slp/spi/msg/BytesBlock.java | BytesBlock.readInt | protected static int readInt(byte[] bytes, int offset, int length) {
"""
Reads an integer from <code>bytes</code> in network byte order.
@param bytes The bytes from where the integer value is read
@param offset The offset in <code>bytes</code> from where to start reading the integer
@param length The number ... | java | protected static int readInt(byte[] bytes, int offset, int length)
{
int result = 0;
for (int i = 0; i < length; ++i)
{
result <<= 8;
result += bytes[offset + i] & 0xFF;
}
return result;
} | [
"protected",
"static",
"int",
"readInt",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"int",
"result",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"length",
";",
"++",
"i",
")",
"{",
... | Reads an integer from <code>bytes</code> in network byte order.
@param bytes The bytes from where the integer value is read
@param offset The offset in <code>bytes</code> from where to start reading the integer
@param length The number of bytes to read
@return The integer value read | [
"Reads",
"an",
"integer",
"from",
"<code",
">",
"bytes<",
"/",
"code",
">",
"in",
"network",
"byte",
"order",
"."
] | train | https://github.com/livetribe/livetribe-slp/blob/6cc13dbe81feab133fe3dd291ca081cbc6e1f591/core/src/main/java/org/livetribe/slp/spi/msg/BytesBlock.java#L61-L70 |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/ShareIntents.java | ShareIntents.newShareTextIntent | public static Intent newShareTextIntent(String subject, String message, String chooserDialogTitle) {
"""
Creates a chooser to share some data.
@param subject The subject to share (might be discarded, for instance if the user picks an SMS app)
@param message The message to share
@param ch... | java | public static Intent newShareTextIntent(String subject, String message, String chooserDialogTitle) {
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_TEXT, message);
shareIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
shareIntent.setType(MIME_TYPE_T... | [
"public",
"static",
"Intent",
"newShareTextIntent",
"(",
"String",
"subject",
",",
"String",
"message",
",",
"String",
"chooserDialogTitle",
")",
"{",
"Intent",
"shareIntent",
"=",
"new",
"Intent",
"(",
"Intent",
".",
"ACTION_SEND",
")",
";",
"shareIntent",
".",... | Creates a chooser to share some data.
@param subject The subject to share (might be discarded, for instance if the user picks an SMS app)
@param message The message to share
@param chooserDialogTitle The title for the chooser dialog
@return the intent | [
"Creates",
"a",
"chooser",
"to",
"share",
"some",
"data",
"."
] | train | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/ShareIntents.java#L36-L42 |
marvinlabs/android-slideshow-widget | library/src/main/java/com/marvinlabs/widget/slideshow/SlideShowView.java | SlideShowView.displaySlide | private void displaySlide(final int currentPosition, final int previousPosition) {
"""
Display the view for the given slide, launching the appropriate transitions if available
"""
Log.v("SlideShowView", "Displaying slide at position: " + currentPosition);
// Hide the progress indicator
... | java | private void displaySlide(final int currentPosition, final int previousPosition) {
Log.v("SlideShowView", "Displaying slide at position: " + currentPosition);
// Hide the progress indicator
hideProgressIndicator();
// Add the slide view to our hierarchy
final View inView = get... | [
"private",
"void",
"displaySlide",
"(",
"final",
"int",
"currentPosition",
",",
"final",
"int",
"previousPosition",
")",
"{",
"Log",
".",
"v",
"(",
"\"SlideShowView\"",
",",
"\"Displaying slide at position: \"",
"+",
"currentPosition",
")",
";",
"// Hide the progress ... | Display the view for the given slide, launching the appropriate transitions if available | [
"Display",
"the",
"view",
"for",
"the",
"given",
"slide",
"launching",
"the",
"appropriate",
"transitions",
"if",
"available"
] | train | https://github.com/marvinlabs/android-slideshow-widget/blob/0d8ddca9a8f62787d78b5eb7f184cabfee569d8d/library/src/main/java/com/marvinlabs/widget/slideshow/SlideShowView.java#L590-L649 |
davetcc/tcMenu | tcMenuJavaApi/src/main/java/com/thecoderscorner/menu/domain/state/MenuTree.java | MenuTree.addOrUpdateItem | public void addOrUpdateItem(int parentId, MenuItem item) {
"""
This will either add or update an existing item, depending if the ID is already present.
@param parentId the parent where it should be placed / already exists
@param item the item to either add or update.
"""
synchronized (subMenuItems) {... | java | public void addOrUpdateItem(int parentId, MenuItem item) {
synchronized (subMenuItems) {
getSubMenuById(parentId).ifPresent(subMenu-> {
if(getMenuItems(subMenu).stream().anyMatch(it-> it.getId() == item.getId())) {
replaceMenuById(asSubMenu(subMenu), item);
... | [
"public",
"void",
"addOrUpdateItem",
"(",
"int",
"parentId",
",",
"MenuItem",
"item",
")",
"{",
"synchronized",
"(",
"subMenuItems",
")",
"{",
"getSubMenuById",
"(",
"parentId",
")",
".",
"ifPresent",
"(",
"subMenu",
"->",
"{",
"if",
"(",
"getMenuItems",
"("... | This will either add or update an existing item, depending if the ID is already present.
@param parentId the parent where it should be placed / already exists
@param item the item to either add or update. | [
"This",
"will",
"either",
"add",
"or",
"update",
"an",
"existing",
"item",
"depending",
"if",
"the",
"ID",
"is",
"already",
"present",
"."
] | train | https://github.com/davetcc/tcMenu/blob/61546e4b982b25ceaff384073fe9ec1fff55e64a/tcMenuJavaApi/src/main/java/com/thecoderscorner/menu/domain/state/MenuTree.java#L80-L91 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java | ULocale.toUnicodeLocaleType | public static String toUnicodeLocaleType(String keyword, String value) {
"""
<strong>[icu]</strong> Converts the specified keyword value (legacy type, or BCP 47
Unicode locale extension type) to the well-formed BCP 47 Unicode locale
extension type for the specified keyword (category). For example, BCP 47
Unicod... | java | public static String toUnicodeLocaleType(String keyword, String value) {
String bcpType = KeyTypeData.toBcpType(keyword, value, null, null);
if (bcpType == null && UnicodeLocaleExtension.isType(value)) {
// unknown keyword, but syntax is fine..
bcpType = AsciiUtil.toLowerString(v... | [
"public",
"static",
"String",
"toUnicodeLocaleType",
"(",
"String",
"keyword",
",",
"String",
"value",
")",
"{",
"String",
"bcpType",
"=",
"KeyTypeData",
".",
"toBcpType",
"(",
"keyword",
",",
"value",
",",
"null",
",",
"null",
")",
";",
"if",
"(",
"bcpTyp... | <strong>[icu]</strong> Converts the specified keyword value (legacy type, or BCP 47
Unicode locale extension type) to the well-formed BCP 47 Unicode locale
extension type for the specified keyword (category). For example, BCP 47
Unicode locale extension type "phonebk" is returned for the input
keyword value "phonebook"... | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"Converts",
"the",
"specified",
"keyword",
"value",
"(",
"legacy",
"type",
"or",
"BCP",
"47",
"Unicode",
"locale",
"extension",
"type",
")",
"to",
"the",
"well",
"-",
"formed",
"BCP",
"47",
"Uni... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java#L3353-L3360 |
apache/flink | flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/compiler/NFACompiler.java | NFACompiler.canProduceEmptyMatches | public static boolean canProduceEmptyMatches(final Pattern<?, ?> pattern) {
"""
Verifies if the provided pattern can possibly generate empty match. Example of patterns that can possibly
generate empty matches are: A*, A?, A* B? etc.
@param pattern pattern to check
@return true if empty match could potentially... | java | public static boolean canProduceEmptyMatches(final Pattern<?, ?> pattern) {
NFAFactoryCompiler<?> compiler = new NFAFactoryCompiler<>(checkNotNull(pattern));
compiler.compileFactory();
State<?> startState = compiler.getStates().stream().filter(State::isStart).findFirst().orElseThrow(
() -> new IllegalStateExce... | [
"public",
"static",
"boolean",
"canProduceEmptyMatches",
"(",
"final",
"Pattern",
"<",
"?",
",",
"?",
">",
"pattern",
")",
"{",
"NFAFactoryCompiler",
"<",
"?",
">",
"compiler",
"=",
"new",
"NFAFactoryCompiler",
"<>",
"(",
"checkNotNull",
"(",
"pattern",
")",
... | Verifies if the provided pattern can possibly generate empty match. Example of patterns that can possibly
generate empty matches are: A*, A?, A* B? etc.
@param pattern pattern to check
@return true if empty match could potentially match the pattern, false otherwise | [
"Verifies",
"if",
"the",
"provided",
"pattern",
"can",
"possibly",
"generate",
"empty",
"match",
".",
"Example",
"of",
"patterns",
"that",
"can",
"possibly",
"generate",
"empty",
"matches",
"are",
":",
"A",
"*",
"A?",
"A",
"*",
"B?",
"etc",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/compiler/NFACompiler.java#L89-L118 |
aol/cyclops | cyclops/src/main/java/cyclops/companion/Streams.java | Streams.streamToOptional | public final static <T> Optional<Seq<T>> streamToOptional(final Stream<T> stream) {
"""
Create an Optional containing a List materialized from a Stream
<pre>
{@code
Optional<Seq<Integer>> opt = Streams.streamToOptional(Stream.of(1,2,3));
//Optional[[1,2,3]]
}
</pre>
@param stream To convert into a... | java | public final static <T> Optional<Seq<T>> streamToOptional(final Stream<T> stream) {
final List<T> collected = stream.collect(java.util.stream.Collectors.toList());
if (collected.size() == 0)
return Optional.empty();
return Optional.of(Seq.fromIterable(collected));
} | [
"public",
"final",
"static",
"<",
"T",
">",
"Optional",
"<",
"Seq",
"<",
"T",
">",
">",
"streamToOptional",
"(",
"final",
"Stream",
"<",
"T",
">",
"stream",
")",
"{",
"final",
"List",
"<",
"T",
">",
"collected",
"=",
"stream",
".",
"collect",
"(",
... | Create an Optional containing a List materialized from a Stream
<pre>
{@code
Optional<Seq<Integer>> opt = Streams.streamToOptional(Stream.of(1,2,3));
//Optional[[1,2,3]]
}
</pre>
@param stream To convert into an Optional
@return Optional with a List of values | [
"Create",
"an",
"Optional",
"containing",
"a",
"List",
"materialized",
"from",
"a",
"Stream"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/cyclops/companion/Streams.java#L473-L479 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/URLUtil.java | URLUtil.getURL | public static URL getURL(String path, Class<?> clazz) {
"""
获得URL
@param path 相对给定 class所在的路径
@param clazz 指定class
@return URL
@see ResourceUtil#getResource(String, Class)
"""
return ResourceUtil.getResource(path, clazz);
} | java | public static URL getURL(String path, Class<?> clazz) {
return ResourceUtil.getResource(path, clazz);
} | [
"public",
"static",
"URL",
"getURL",
"(",
"String",
"path",
",",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"return",
"ResourceUtil",
".",
"getResource",
"(",
"path",
",",
"clazz",
")",
";",
"}"
] | 获得URL
@param path 相对给定 class所在的路径
@param clazz 指定class
@return URL
@see ResourceUtil#getResource(String, Class) | [
"获得URL"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/URLUtil.java#L145-L147 |
respoke/respoke-sdk-android | respokeSDK/src/main/java/com/digium/respokesdk/RespokeClient.java | RespokeClient.postJoinGroupMembersError | private void postJoinGroupMembersError(final JoinGroupCompletionListener completionListener, final String errorMessage) {
"""
A convenience method for posting errors to a JoinGroupCompletionListener
@param completionListener The listener to notify
@param errorMessage The human-readable error message th... | java | private void postJoinGroupMembersError(final JoinGroupCompletionListener completionListener, final String errorMessage) {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
if (null != completionListener) {
completi... | [
"private",
"void",
"postJoinGroupMembersError",
"(",
"final",
"JoinGroupCompletionListener",
"completionListener",
",",
"final",
"String",
"errorMessage",
")",
"{",
"new",
"Handler",
"(",
"Looper",
".",
"getMainLooper",
"(",
")",
")",
".",
"post",
"(",
"new",
"Run... | A convenience method for posting errors to a JoinGroupCompletionListener
@param completionListener The listener to notify
@param errorMessage The human-readable error message that occurred | [
"A",
"convenience",
"method",
"for",
"posting",
"errors",
"to",
"a",
"JoinGroupCompletionListener"
] | train | https://github.com/respoke/respoke-sdk-android/blob/34a15f0558d29b1f1bc8481bbc5c505e855e05ef/respokeSDK/src/main/java/com/digium/respokesdk/RespokeClient.java#L1089-L1098 |
sematext/ActionGenerator | ag-player-es/src/main/java/com/sematext/ag/es/util/JSONUtils.java | JSONUtils.getElasticSearchBulkHeader | public static String getElasticSearchBulkHeader(SimpleDataEvent event, String index, String type) {
"""
Constructs ES bulk header for the document.
@param event
data event
@param index
index name
@param type
document type
@return ES bulk header
"""
StringBuilder builder = new StringBuilder();
... | java | public static String getElasticSearchBulkHeader(SimpleDataEvent event, String index, String type) {
StringBuilder builder = new StringBuilder();
builder.append("{\"index\":{\"_index\":\"");
builder.append(index);
builder.append("\",\"_type\":\"");
builder.append(type);
builder.append("\",\"_id\"... | [
"public",
"static",
"String",
"getElasticSearchBulkHeader",
"(",
"SimpleDataEvent",
"event",
",",
"String",
"index",
",",
"String",
"type",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"\"{\\\"i... | Constructs ES bulk header for the document.
@param event
data event
@param index
index name
@param type
document type
@return ES bulk header | [
"Constructs",
"ES",
"bulk",
"header",
"for",
"the",
"document",
"."
] | train | https://github.com/sematext/ActionGenerator/blob/10f4a3e680f20d7d151f5d40e6758aeb072d474f/ag-player-es/src/main/java/com/sematext/ag/es/util/JSONUtils.java#L65-L75 |
zaproxy/zaproxy | src/org/zaproxy/zap/control/AddOn.java | AddOn.calculateExtensionRunRequirements | public AddOnRunRequirements calculateExtensionRunRequirements(String classname, Collection<AddOn> availableAddOns) {
"""
Calculates the requirements to run the extension with the given {@code classname}, in the current ZAP and Java versions
and with the given {@code availableAddOns}.
<p>
If the extension depend... | java | public AddOnRunRequirements calculateExtensionRunRequirements(String classname, Collection<AddOn> availableAddOns) {
AddOnRunRequirements requirements = new AddOnRunRequirements(this);
for (ExtensionWithDeps extensionWithDeps : extensionsWithDeps) {
if (extensionWithDeps.getClassname().eq... | [
"public",
"AddOnRunRequirements",
"calculateExtensionRunRequirements",
"(",
"String",
"classname",
",",
"Collection",
"<",
"AddOn",
">",
"availableAddOns",
")",
"{",
"AddOnRunRequirements",
"requirements",
"=",
"new",
"AddOnRunRequirements",
"(",
"this",
")",
";",
"for"... | Calculates the requirements to run the extension with the given {@code classname}, in the current ZAP and Java versions
and with the given {@code availableAddOns}.
<p>
If the extension depends on other add-ons, those add-ons are checked if are also runnable.
<p>
<strong>Note:</strong> All the given {@code availableAddO... | [
"Calculates",
"the",
"requirements",
"to",
"run",
"the",
"extension",
"with",
"the",
"given",
"{",
"@code",
"classname",
"}",
"in",
"the",
"current",
"ZAP",
"and",
"Java",
"versions",
"and",
"with",
"the",
"given",
"{",
"@code",
"availableAddOns",
"}",
".",
... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/control/AddOn.java#L1372-L1381 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.withDefault | public static <T> List<T> withDefault(List<T> self, Closure init) {
"""
An alias for <code>withLazyDefault</code> which decorates a list allowing
it to grow when called with index values outside the normal list bounds.
@param self a List
@param init a Closure with the target index as parameter which generates... | java | public static <T> List<T> withDefault(List<T> self, Closure init) {
return withLazyDefault(self, init);
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"withDefault",
"(",
"List",
"<",
"T",
">",
"self",
",",
"Closure",
"init",
")",
"{",
"return",
"withLazyDefault",
"(",
"self",
",",
"init",
")",
";",
"}"
] | An alias for <code>withLazyDefault</code> which decorates a list allowing
it to grow when called with index values outside the normal list bounds.
@param self a List
@param init a Closure with the target index as parameter which generates the default value
@return the decorated List
@see #withLazyDefault(java.util.Lis... | [
"An",
"alias",
"for",
"<code",
">",
"withLazyDefault<",
"/",
"code",
">",
"which",
"decorates",
"a",
"list",
"allowing",
"it",
"to",
"grow",
"when",
"called",
"with",
"index",
"values",
"outside",
"the",
"normal",
"list",
"bounds",
"."
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L7764-L7766 |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java | XMLAssert.assertXMLValid | public static void assertXMLValid(InputSource xml, String systemId)
throws SAXException, ConfigurationException {
"""
Assert that an InputSource containing XML contains valid XML:
the document must contain a DOCTYPE to be validated, but the
validation will use the systemId to obtain the DTD
@param xml
... | java | public static void assertXMLValid(InputSource xml, String systemId)
throws SAXException, ConfigurationException {
assertXMLValid(new Validator(xml, systemId));
} | [
"public",
"static",
"void",
"assertXMLValid",
"(",
"InputSource",
"xml",
",",
"String",
"systemId",
")",
"throws",
"SAXException",
",",
"ConfigurationException",
"{",
"assertXMLValid",
"(",
"new",
"Validator",
"(",
"xml",
",",
"systemId",
")",
")",
";",
"}"
] | Assert that an InputSource containing XML contains valid XML:
the document must contain a DOCTYPE to be validated, but the
validation will use the systemId to obtain the DTD
@param xml
@param systemId
@throws SAXException
@throws ConfigurationException if validation could not be turned on
@see Validator | [
"Assert",
"that",
"an",
"InputSource",
"containing",
"XML",
"contains",
"valid",
"XML",
":",
"the",
"document",
"must",
"contain",
"a",
"DOCTYPE",
"to",
"be",
"validated",
"but",
"the",
"validation",
"will",
"use",
"the",
"systemId",
"to",
"obtain",
"the",
"... | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L1052-L1055 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/utils/SymmetryTools.java | SymmetryTools.fromAFP | public static MultipleAlignment fromAFP(AFPChain symm, Atom[] atoms)
throws StructureException {
"""
Converts a refined symmetry AFPChain alignment into the standard
representation of symmetry in a MultipleAlignment, that contains the
entire Atom array of the strcuture and the symmetric repeats are orgaized
... | java | public static MultipleAlignment fromAFP(AFPChain symm, Atom[] atoms)
throws StructureException {
if (!symm.getAlgorithmName().contains("symm")) {
throw new IllegalArgumentException(
"The input alignment is not a symmetry alignment.");
}
MultipleAlignmentEnsemble e = new MultipleAlignmentEnsembleImpl(... | [
"public",
"static",
"MultipleAlignment",
"fromAFP",
"(",
"AFPChain",
"symm",
",",
"Atom",
"[",
"]",
"atoms",
")",
"throws",
"StructureException",
"{",
"if",
"(",
"!",
"symm",
".",
"getAlgorithmName",
"(",
")",
".",
"contains",
"(",
"\"symm\"",
")",
")",
"{... | Converts a refined symmetry AFPChain alignment into the standard
representation of symmetry in a MultipleAlignment, that contains the
entire Atom array of the strcuture and the symmetric repeats are orgaized
in different rows in a single Block.
@param symm
AFPChain created with a symmetry algorithm and refined
@param ... | [
"Converts",
"a",
"refined",
"symmetry",
"AFPChain",
"alignment",
"into",
"the",
"standard",
"representation",
"of",
"symmetry",
"in",
"a",
"MultipleAlignment",
"that",
"contains",
"the",
"entire",
"Atom",
"array",
"of",
"the",
"strcuture",
"and",
"the",
"symmetric... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/utils/SymmetryTools.java#L651-L693 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.createCertificateAsync | public Observable<CertificateOperation> createCertificateAsync(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map<String, String> tags) {
"""
Creates a new certificate.
If this is the first version, the certificate resource is created... | java | public Observable<CertificateOperation> createCertificateAsync(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map<String, String> tags) {
return createCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificatePol... | [
"public",
"Observable",
"<",
"CertificateOperation",
">",
"createCertificateAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"certificateName",
",",
"CertificatePolicy",
"certificatePolicy",
",",
"CertificateAttributes",
"certificateAttributes",
",",
"Map",
"<",
"Strin... | Creates a new certificate.
If this is the first version, the certificate resource is created. This operation requires the certificates/create permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param certificateName The name of the certificate.
@param certificatePolicy The man... | [
"Creates",
"a",
"new",
"certificate",
".",
"If",
"this",
"is",
"the",
"first",
"version",
"the",
"certificate",
"resource",
"is",
"created",
".",
"This",
"operation",
"requires",
"the",
"certificates",
"/",
"create",
"permission",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L6612-L6619 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/MutableDictionary.java | MutableDictionary.setDate | @NonNull
@Override
public MutableDictionary setDate(@NonNull String key, Date value) {
"""
Set a Date object for the given key.
@param key The key
@param value The Date object.
@return The self object.
"""
return setValue(key, value);
} | java | @NonNull
@Override
public MutableDictionary setDate(@NonNull String key, Date value) {
return setValue(key, value);
} | [
"@",
"NonNull",
"@",
"Override",
"public",
"MutableDictionary",
"setDate",
"(",
"@",
"NonNull",
"String",
"key",
",",
"Date",
"value",
")",
"{",
"return",
"setValue",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Set a Date object for the given key.
@param key The key
@param value The Date object.
@return The self object. | [
"Set",
"a",
"Date",
"object",
"for",
"the",
"given",
"key",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableDictionary.java#L221-L225 |
jboss/jboss-el-api_spec | src/main/java/javax/el/ELProcessor.java | ELProcessor.defineFunction | public void defineFunction(String prefix, String function, Method method)
throws NoSuchMethodException {
"""
Define an EL function in the local function mapper.
@param prefix The namespace for the function or "" for no namesapce.
@param function The name of the function.
If empty (""), the method na... | java | public void defineFunction(String prefix, String function, Method method)
throws NoSuchMethodException {
if (prefix == null || function == null || method == null) {
throw new NullPointerException("Null argument for defineFunction");
}
if (! Modifier.isStatic(method.getMod... | [
"public",
"void",
"defineFunction",
"(",
"String",
"prefix",
",",
"String",
"function",
",",
"Method",
"method",
")",
"throws",
"NoSuchMethodException",
"{",
"if",
"(",
"prefix",
"==",
"null",
"||",
"function",
"==",
"null",
"||",
"method",
"==",
"null",
")"... | Define an EL function in the local function mapper.
@param prefix The namespace for the function or "" for no namesapce.
@param function The name of the function.
If empty (""), the method name is used as the function name.
@param method The <code>java.lang.reflect.Method</code> instance of
the method that implements t... | [
"Define",
"an",
"EL",
"function",
"in",
"the",
"local",
"function",
"mapper",
"."
] | train | https://github.com/jboss/jboss-el-api_spec/blob/4cef117cae3ccf9f76439845687a8d219ad2eb43/src/main/java/javax/el/ELProcessor.java#L257-L269 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/PatternPool.java | PatternPool.get | public static Pattern get(String regex, int flags) {
"""
先从Pattern池中查找正则对应的{@link Pattern},找不到则编译正则表达式并入池。
@param regex 正则表达式
@param flags 正则标识位集合 {@link Pattern}
@return {@link Pattern}
"""
final RegexWithFlag regexWithFlag = new RegexWithFlag(regex, flags);
Pattern pattern = POOL.get(regexWithFl... | java | public static Pattern get(String regex, int flags) {
final RegexWithFlag regexWithFlag = new RegexWithFlag(regex, flags);
Pattern pattern = POOL.get(regexWithFlag);
if (null == pattern) {
pattern = Pattern.compile(regex, flags);
POOL.put(regexWithFlag, pattern);
}
return pattern;
} | [
"public",
"static",
"Pattern",
"get",
"(",
"String",
"regex",
",",
"int",
"flags",
")",
"{",
"final",
"RegexWithFlag",
"regexWithFlag",
"=",
"new",
"RegexWithFlag",
"(",
"regex",
",",
"flags",
")",
";",
"Pattern",
"pattern",
"=",
"POOL",
".",
"get",
"(",
... | 先从Pattern池中查找正则对应的{@link Pattern},找不到则编译正则表达式并入池。
@param regex 正则表达式
@param flags 正则标识位集合 {@link Pattern}
@return {@link Pattern} | [
"先从Pattern池中查找正则对应的",
"{",
"@link",
"Pattern",
"}",
",找不到则编译正则表达式并入池。"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/PatternPool.java#L82-L91 |
indeedeng/util | urlparsing/src/main/java/com/indeed/util/urlparsing/ParseUtils.java | ParseUtils.parseSignedInt | public static int parseSignedInt(CharSequence s, final int start, final int end) throws NumberFormatException {
"""
Parses out an int value from the provided string, equivalent to Integer.parseInt(s.substring(start, end)),
but has significantly less overhead, no object creation and later garbage collection requir... | java | public static int parseSignedInt(CharSequence s, final int start, final int end) throws NumberFormatException {
if (s.charAt(start) == '-') {
// negative!
return -parseUnsignedInt(s, start + 1, end);
} else {
return parseUnsignedInt(s, start, end);
}
} | [
"public",
"static",
"int",
"parseSignedInt",
"(",
"CharSequence",
"s",
",",
"final",
"int",
"start",
",",
"final",
"int",
"end",
")",
"throws",
"NumberFormatException",
"{",
"if",
"(",
"s",
".",
"charAt",
"(",
"start",
")",
"==",
"'",
"'",
")",
"{",
"/... | Parses out an int value from the provided string, equivalent to Integer.parseInt(s.substring(start, end)),
but has significantly less overhead, no object creation and later garbage collection required.
@throws {@link NumberFormatException} if it encounters any character that is not [-0-9]. | [
"Parses",
"out",
"an",
"int",
"value",
"from",
"the",
"provided",
"string",
"equivalent",
"to",
"Integer",
".",
"parseInt",
"(",
"s",
".",
"substring",
"(",
"start",
"end",
"))",
"but",
"has",
"significantly",
"less",
"overhead",
"no",
"object",
"creation",
... | train | https://github.com/indeedeng/util/blob/332008426cf14b57e7fc3e817d9423e3f84fb922/urlparsing/src/main/java/com/indeed/util/urlparsing/ParseUtils.java#L31-L38 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServersInner.java | ServersInner.updateAsync | public Observable<ServerInner> updateAsync(String resourceGroupName, String serverName, ServerUpdate parameters) {
"""
Updates an existing server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@pa... | java | public Observable<ServerInner> updateAsync(String resourceGroupName, String serverName, ServerUpdate parameters) {
return updateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1<ServiceResponse<ServerInner>, ServerInner>() {
@Override
public ServerInner ca... | [
"public",
"Observable",
"<",
"ServerInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"ServerUpdate",
"parameters",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
",",
... | Updates an existing server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param parameters The required parameters for updating a server.
@throws IllegalArgument... | [
"Updates",
"an",
"existing",
"server",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServersInner.java#L393-L400 |
Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/entity/Cells.java | Cells.getLong | public Long getLong(String nameSpace, String cellName) {
"""
Returns the {@code Long} value of the {@link Cell} (associated to {@code table}) whose name iscellName, or null
if this Cells object contains no cell whose name is cellName.
@param nameSpace the name of the owning table
@param cellName the name of ... | java | public Long getLong(String nameSpace, String cellName) {
return getValue(nameSpace, cellName, Long.class);
} | [
"public",
"Long",
"getLong",
"(",
"String",
"nameSpace",
",",
"String",
"cellName",
")",
"{",
"return",
"getValue",
"(",
"nameSpace",
",",
"cellName",
",",
"Long",
".",
"class",
")",
";",
"}"
] | Returns the {@code Long} value of the {@link Cell} (associated to {@code table}) whose name iscellName, or null
if this Cells object contains no cell whose name is cellName.
@param nameSpace the name of the owning table
@param cellName the name of the Cell we want to retrieve from this Cells object.
@return the {@cod... | [
"Returns",
"the",
"{",
"@code",
"Long",
"}",
"value",
"of",
"the",
"{",
"@link",
"Cell",
"}",
"(",
"associated",
"to",
"{",
"@code",
"table",
"}",
")",
"whose",
"name",
"iscellName",
"or",
"null",
"if",
"this",
"Cells",
"object",
"contains",
"no",
"cel... | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/entity/Cells.java#L1123-L1125 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/features/FeatureUtilities.java | FeatureUtilities.doVectorize | @SuppressWarnings("unchecked")
public static Collection<Polygon> doVectorize( GridCoverage2D src, Map<String, Object> args ) {
"""
Helper function to run the Vectorize operation with given parameters and
retrieve the vectors.
@param src the source {@link GridCoverage2D}.
@param args a {@code Map} of param... | java | @SuppressWarnings("unchecked")
public static Collection<Polygon> doVectorize( GridCoverage2D src, Map<String, Object> args ) {
if (args == null) {
args = new HashMap<String, Object>();
}
ParameterBlockJAI pb = new ParameterBlockJAI("Vectorize");
pb.setSource("source0", s... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"Collection",
"<",
"Polygon",
">",
"doVectorize",
"(",
"GridCoverage2D",
"src",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"args",
")",
"{",
"if",
"(",
"args",
"==",
"null",
")",
... | Helper function to run the Vectorize operation with given parameters and
retrieve the vectors.
@param src the source {@link GridCoverage2D}.
@param args a {@code Map} of parameter names and values or <code>null</code>.
@return the generated vectors as JTS Polygons | [
"Helper",
"function",
"to",
"run",
"the",
"Vectorize",
"operation",
"with",
"given",
"parameters",
"and",
"retrieve",
"the",
"vectors",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/features/FeatureUtilities.java#L729-L760 |
kubernetes-client/java | kubernetes/src/main/java/io/kubernetes/client/ApiClient.java | ApiClient.buildRequestBodyMultipart | public RequestBody buildRequestBodyMultipart(Map<String, Object> formParams) {
"""
Build a multipart (file uploading) request body with the given form parameters,
which could contain text fields and file fields.
@param formParams Form parameters in the form of Map
@return RequestBody
"""
Multipart... | java | public RequestBody buildRequestBodyMultipart(Map<String, Object> formParams) {
MultipartBuilder mpBuilder = new MultipartBuilder().type(MultipartBuilder.FORM);
for (Entry<String, Object> param : formParams.entrySet()) {
if (param.getValue() instanceof File) {
File file = (Fil... | [
"public",
"RequestBody",
"buildRequestBodyMultipart",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"formParams",
")",
"{",
"MultipartBuilder",
"mpBuilder",
"=",
"new",
"MultipartBuilder",
"(",
")",
".",
"type",
"(",
"MultipartBuilder",
".",
"FORM",
")",
";",
... | Build a multipart (file uploading) request body with the given form parameters,
which could contain text fields and file fields.
@param formParams Form parameters in the form of Map
@return RequestBody | [
"Build",
"a",
"multipart",
"(",
"file",
"uploading",
")",
"request",
"body",
"with",
"the",
"given",
"form",
"parameters",
"which",
"could",
"contain",
"text",
"fields",
"and",
"file",
"fields",
"."
] | train | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/kubernetes/src/main/java/io/kubernetes/client/ApiClient.java#L1072-L1086 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/lang/ServiceLoaderHelper.java | ServiceLoaderHelper.getAllSPIImplementations | @Nonnull
@ReturnsMutableCopy
public static <T> ICommonsList <T> getAllSPIImplementations (@Nonnull final Class <T> aSPIClass,
@Nonnull final ClassLoader aClassLoader) {
"""
Uses the {@link ServiceLoader} to load all SPI implementations of the
pass... | java | @Nonnull
@ReturnsMutableCopy
public static <T> ICommonsList <T> getAllSPIImplementations (@Nonnull final Class <T> aSPIClass,
@Nonnull final ClassLoader aClassLoader)
{
return getAllSPIImplementations (aSPIClass, aClassLoader, null);
} | [
"@",
"Nonnull",
"@",
"ReturnsMutableCopy",
"public",
"static",
"<",
"T",
">",
"ICommonsList",
"<",
"T",
">",
"getAllSPIImplementations",
"(",
"@",
"Nonnull",
"final",
"Class",
"<",
"T",
">",
"aSPIClass",
",",
"@",
"Nonnull",
"final",
"ClassLoader",
"aClassLoad... | Uses the {@link ServiceLoader} to load all SPI implementations of the
passed class
@param <T>
The implementation type to be loaded
@param aSPIClass
The SPI interface class. May not be <code>null</code>.
@param aClassLoader
The class loader to use for the SPI loader. May not be
<code>null</code>.
@return A list of all ... | [
"Uses",
"the",
"{",
"@link",
"ServiceLoader",
"}",
"to",
"load",
"all",
"SPI",
"implementations",
"of",
"the",
"passed",
"class"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/lang/ServiceLoaderHelper.java#L83-L89 |
podio/podio-java | src/main/java/com/podio/app/AppAPI.java | AppAPI.updateOrder | public void updateOrder(int spaceId, List<Integer> appIds) {
"""
Updates the order of the apps on the space. It should post all the apps
from the space in the order required.
@param spaceId
The id of the space the apps are on
@param appIds
The ids of the apps in the new order
"""
getResourceFactory().... | java | public void updateOrder(int spaceId, List<Integer> appIds) {
getResourceFactory().getApiResource("/app/space/" + spaceId + "/order")
.entity(appIds, MediaType.APPLICATION_JSON_TYPE).put();
} | [
"public",
"void",
"updateOrder",
"(",
"int",
"spaceId",
",",
"List",
"<",
"Integer",
">",
"appIds",
")",
"{",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/app/space/\"",
"+",
"spaceId",
"+",
"\"/order\"",
")",
".",
"entity",
"(",
"appIds",... | Updates the order of the apps on the space. It should post all the apps
from the space in the order required.
@param spaceId
The id of the space the apps are on
@param appIds
The ids of the apps in the new order | [
"Updates",
"the",
"order",
"of",
"the",
"apps",
"on",
"the",
"space",
".",
"It",
"should",
"post",
"all",
"the",
"apps",
"from",
"the",
"space",
"in",
"the",
"order",
"required",
"."
] | train | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/app/AppAPI.java#L206-L209 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/xml/Ra10XmlGen.java | Ra10XmlGen.writeOutbound | private void writeOutbound(Definition def, Writer out, int indent) throws IOException {
"""
Output outbound xml part
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException
"""
writeIndent(out, indent);
out.write("<managedconnectionfactory-clas... | java | private void writeOutbound(Definition def, Writer out, int indent) throws IOException
{
writeIndent(out, indent);
out.write("<managedconnectionfactory-class>" + def.getRaPackage() + "." +
def.getMcfDefs().get(0).getMcfClass() + "</managedconnectionfactory-class>");
writeEol(out);
... | [
"private",
"void",
"writeOutbound",
"(",
"Definition",
"def",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"writeIndent",
"(",
"out",
",",
"indent",
")",
";",
"out",
".",
"write",
"(",
"\"<managedconnectionfactory-class>\"",
"... | Output outbound xml part
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"outbound",
"xml",
"part"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/xml/Ra10XmlGen.java#L117-L172 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java | VirtualMachineScaleSetsInner.listSkusWithServiceResponseAsync | public Observable<ServiceResponse<Page<VirtualMachineScaleSetSkuInner>>> listSkusWithServiceResponseAsync(final String resourceGroupName, final String vmScaleSetName) {
"""
Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU.
@param resourceGr... | java | public Observable<ServiceResponse<Page<VirtualMachineScaleSetSkuInner>>> listSkusWithServiceResponseAsync(final String resourceGroupName, final String vmScaleSetName) {
return listSkusSinglePageAsync(resourceGroupName, vmScaleSetName)
.concatMap(new Func1<ServiceResponse<Page<VirtualMachineScaleSetS... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"VirtualMachineScaleSetSkuInner",
">",
">",
">",
"listSkusWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"vmScaleSetName",
")",
"{",
"return",
"listSkusSin... | Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the ob... | [
"Gets",
"a",
"list",
"of",
"SKUs",
"available",
"for",
"your",
"VM",
"scale",
"set",
"including",
"the",
"minimum",
"and",
"maximum",
"VM",
"instances",
"allowed",
"for",
"each",
"SKU",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java#L1660-L1672 |
lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/util/ProcessUtil.java | ProcessUtil.consumeProcessConsole | public static void consumeProcessConsole(Process process, Listener<String> outputListener, Listener<String> errorListener) {
"""
Launch 2 threads to consume both output and error streams, and call the listeners for each line read.
"""
Application app = LCCore.getApplication();
ThreadFactory factory = app... | java | public static void consumeProcessConsole(Process process, Listener<String> outputListener, Listener<String> errorListener) {
Application app = LCCore.getApplication();
ThreadFactory factory = app.getThreadFactory();
Thread t;
ConsoleConsumer cc;
cc = new ConsoleConsumer(process.getInputStream(), outputLi... | [
"public",
"static",
"void",
"consumeProcessConsole",
"(",
"Process",
"process",
",",
"Listener",
"<",
"String",
">",
"outputListener",
",",
"Listener",
"<",
"String",
">",
"errorListener",
")",
"{",
"Application",
"app",
"=",
"LCCore",
".",
"getApplication",
"("... | Launch 2 threads to consume both output and error streams, and call the listeners for each line read. | [
"Launch",
"2",
"threads",
"to",
"consume",
"both",
"output",
"and",
"error",
"streams",
"and",
"call",
"the",
"listeners",
"for",
"each",
"line",
"read",
"."
] | train | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/util/ProcessUtil.java#L37-L56 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.deleteTag | public void deleteTag(GitlabProject project, String tagName) throws IOException {
"""
Delete tag in specific project
@param project
@param tagName
@throws IOException on gitlab api call error
"""
String tailUrl = GitlabProject.URL + "/" + project + GitlabTag.URL + "/" + tagName;
retrieve()... | java | public void deleteTag(GitlabProject project, String tagName) throws IOException {
String tailUrl = GitlabProject.URL + "/" + project + GitlabTag.URL + "/" + tagName;
retrieve().method(DELETE).to(tailUrl, Void.class);
} | [
"public",
"void",
"deleteTag",
"(",
"GitlabProject",
"project",
",",
"String",
"tagName",
")",
"throws",
"IOException",
"{",
"String",
"tailUrl",
"=",
"GitlabProject",
".",
"URL",
"+",
"\"/\"",
"+",
"project",
"+",
"GitlabTag",
".",
"URL",
"+",
"\"/\"",
"+",... | Delete tag in specific project
@param project
@param tagName
@throws IOException on gitlab api call error | [
"Delete",
"tag",
"in",
"specific",
"project"
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L3439-L3442 |
IBM/ibm-cos-sdk-java | ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/s3/internal/crypto/S3CryptoModuleBase.java | S3CryptoModuleBase.newContentCryptoMaterial | private ContentCryptoMaterial newContentCryptoMaterial(
EncryptionMaterialsProvider kekMaterialProvider,
Provider provider, AmazonWebServiceRequest req) {
"""
Returns a non-null content encryption material generated with the given kek
material and security providers.
@throws SdkClientEx... | java | private ContentCryptoMaterial newContentCryptoMaterial(
EncryptionMaterialsProvider kekMaterialProvider,
Provider provider, AmazonWebServiceRequest req) {
EncryptionMaterials kekMaterials = kekMaterialProvider.getEncryptionMaterials();
if (kekMaterials == null)
throw ... | [
"private",
"ContentCryptoMaterial",
"newContentCryptoMaterial",
"(",
"EncryptionMaterialsProvider",
"kekMaterialProvider",
",",
"Provider",
"provider",
",",
"AmazonWebServiceRequest",
"req",
")",
"{",
"EncryptionMaterials",
"kekMaterials",
"=",
"kekMaterialProvider",
".",
"getE... | Returns a non-null content encryption material generated with the given kek
material and security providers.
@throws SdkClientException if no encryption material can be found from
the given encryption material provider. | [
"Returns",
"a",
"non",
"-",
"null",
"content",
"encryption",
"material",
"generated",
"with",
"the",
"given",
"kek",
"material",
"and",
"security",
"providers",
"."
] | train | https://github.com/IBM/ibm-cos-sdk-java/blob/d0bb2dd754c328a05e7dba8dc42e28b271b6daf2/ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/s3/internal/crypto/S3CryptoModuleBase.java#L485-L492 |
CenturyLinkCloud/mdw | mdw-hub/src/com/centurylink/mdw/hub/servlet/SoapServlet.java | SoapServlet.createSoapFaultResponse | protected String createSoapFaultResponse(String message)
throws SOAPException, TransformerException {
"""
Original API (Defaults to using MessageFactory.newInstance(), i.e. SOAP
1.1)
@param message
@return Soap fault as string
@throws SOAPException
@throws TransformerException
"""
re... | java | protected String createSoapFaultResponse(String message)
throws SOAPException, TransformerException {
return createSoapFaultResponse(SOAPConstants.SOAP_1_1_PROTOCOL, null, message);
} | [
"protected",
"String",
"createSoapFaultResponse",
"(",
"String",
"message",
")",
"throws",
"SOAPException",
",",
"TransformerException",
"{",
"return",
"createSoapFaultResponse",
"(",
"SOAPConstants",
".",
"SOAP_1_1_PROTOCOL",
",",
"null",
",",
"message",
")",
";",
"}... | Original API (Defaults to using MessageFactory.newInstance(), i.e. SOAP
1.1)
@param message
@return Soap fault as string
@throws SOAPException
@throws TransformerException | [
"Original",
"API",
"(",
"Defaults",
"to",
"using",
"MessageFactory",
".",
"newInstance",
"()",
"i",
".",
"e",
".",
"SOAP",
"1",
".",
"1",
")"
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-hub/src/com/centurylink/mdw/hub/servlet/SoapServlet.java#L376-L379 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/metadata/URLMatchingUtils.java | URLMatchingUtils.isPathNameMatch | public static boolean isPathNameMatch(String uri, String urlPattern) {
"""
Determine if the urlPattern is a path name match for the uri.
@param uri
@param urlPattern
@return
"""
if (urlPattern.startsWith("/") && urlPattern.endsWith("/*")) {
String s = urlPattern.substring(0, urlPattern... | java | public static boolean isPathNameMatch(String uri, String urlPattern) {
if (urlPattern.startsWith("/") && urlPattern.endsWith("/*")) {
String s = urlPattern.substring(0, urlPattern.length() - 1);
/**
* First case,urlPattern
* /a/b/c/ matches /a/b/c/*
... | [
"public",
"static",
"boolean",
"isPathNameMatch",
"(",
"String",
"uri",
",",
"String",
"urlPattern",
")",
"{",
"if",
"(",
"urlPattern",
".",
"startsWith",
"(",
"\"/\"",
")",
"&&",
"urlPattern",
".",
"endsWith",
"(",
"\"/*\"",
")",
")",
"{",
"String",
"s",
... | Determine if the urlPattern is a path name match for the uri.
@param uri
@param urlPattern
@return | [
"Determine",
"if",
"the",
"urlPattern",
"is",
"a",
"path",
"name",
"match",
"for",
"the",
"uri",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/metadata/URLMatchingUtils.java#L85-L113 |
dain/leveldb | leveldb/src/main/java/org/iq80/leveldb/util/SliceInput.java | SliceInput.readBytes | public int readBytes(GatheringByteChannel out, int length)
throws IOException {
"""
Transfers this buffer's data to the specified stream starting at the
current {@code position}.
@param length the maximum number of bytes to transfer
@return the actual number of bytes written out to the specified c... | java | public int readBytes(GatheringByteChannel out, int length)
throws IOException
{
int readBytes = slice.getBytes(position, out, length);
position += readBytes;
return readBytes;
} | [
"public",
"int",
"readBytes",
"(",
"GatheringByteChannel",
"out",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"int",
"readBytes",
"=",
"slice",
".",
"getBytes",
"(",
"position",
",",
"out",
",",
"length",
")",
";",
"position",
"+=",
"readBytes",... | Transfers this buffer's data to the specified stream starting at the
current {@code position}.
@param length the maximum number of bytes to transfer
@return the actual number of bytes written out to the specified channel
@throws IndexOutOfBoundsException if {@code length} is greater than {@code this.available()}
@thro... | [
"Transfers",
"this",
"buffer",
"s",
"data",
"to",
"the",
"specified",
"stream",
"starting",
"at",
"the",
"current",
"{",
"@code",
"position",
"}",
"."
] | train | https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/util/SliceInput.java#L349-L355 |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.setBaselineStart | public void setBaselineStart(int baselineNumber, Date value) {
"""
Set a baseline value.
@param baselineNumber baseline index (1-10)
@param value baseline value
"""
set(selectField(TaskFieldLists.BASELINE_STARTS, baselineNumber), value);
} | java | public void setBaselineStart(int baselineNumber, Date value)
{
set(selectField(TaskFieldLists.BASELINE_STARTS, baselineNumber), value);
} | [
"public",
"void",
"setBaselineStart",
"(",
"int",
"baselineNumber",
",",
"Date",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"TaskFieldLists",
".",
"BASELINE_STARTS",
",",
"baselineNumber",
")",
",",
"value",
")",
";",
"}"
] | Set a baseline value.
@param baselineNumber baseline index (1-10)
@param value baseline value | [
"Set",
"a",
"baseline",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L4013-L4016 |
iipc/webarchive-commons | src/main/java/org/archive/format/text/charset/CharsetDetector.java | CharsetDetector.getCharsetFromMeta | protected String getCharsetFromMeta(byte buffer[],int len) throws IOException {
"""
Attempt to find a META tag in the HTML that hints at the character set
used to write the document.
@param resource
@return String character set found from META tags in the HTML
@throws IOException
"""
String charsetName... | java | protected String getCharsetFromMeta(byte buffer[],int len) throws IOException {
String charsetName = null;
// convert to UTF-8 String -- which hopefully will not mess up the
// characters we're interested in...
String sample = new String(buffer,0,len,DEFAULT_CHARSET);
String metaContentType = findMetaContent... | [
"protected",
"String",
"getCharsetFromMeta",
"(",
"byte",
"buffer",
"[",
"]",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"String",
"charsetName",
"=",
"null",
";",
"// convert to UTF-8 String -- which hopefully will not mess up the",
"// characters we're interest... | Attempt to find a META tag in the HTML that hints at the character set
used to write the document.
@param resource
@return String character set found from META tags in the HTML
@throws IOException | [
"Attempt",
"to",
"find",
"a",
"META",
"tag",
"in",
"the",
"HTML",
"that",
"hints",
"at",
"the",
"character",
"set",
"used",
"to",
"write",
"the",
"document",
"."
] | train | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/format/text/charset/CharsetDetector.java#L168-L179 |
line/centraldogma | client/java-armeria/src/main/java/com/linecorp/centraldogma/client/armeria/AbstractArmeriaCentralDogmaBuilder.java | AbstractArmeriaCentralDogmaBuilder.newClientBuilder | protected final ClientBuilder newClientBuilder(String uri, Consumer<ClientBuilder> customizer) {
"""
Returns a newly created {@link ClientBuilder} configured with the specified {@code customizer}
and then with the {@link ArmeriaClientConfigurator} specified with
{@link #clientConfigurator(ArmeriaClientConfigurat... | java | protected final ClientBuilder newClientBuilder(String uri, Consumer<ClientBuilder> customizer) {
final ClientBuilder builder = new ClientBuilder(uri);
customizer.accept(builder);
clientConfigurator.configure(builder);
builder.factory(clientFactory());
return builder;
} | [
"protected",
"final",
"ClientBuilder",
"newClientBuilder",
"(",
"String",
"uri",
",",
"Consumer",
"<",
"ClientBuilder",
">",
"customizer",
")",
"{",
"final",
"ClientBuilder",
"builder",
"=",
"new",
"ClientBuilder",
"(",
"uri",
")",
";",
"customizer",
".",
"accep... | Returns a newly created {@link ClientBuilder} configured with the specified {@code customizer}
and then with the {@link ArmeriaClientConfigurator} specified with
{@link #clientConfigurator(ArmeriaClientConfigurator)}. | [
"Returns",
"a",
"newly",
"created",
"{"
] | train | https://github.com/line/centraldogma/blob/b9e46c67fbc26628c2186ce2f46e7fb303c831e9/client/java-armeria/src/main/java/com/linecorp/centraldogma/client/armeria/AbstractArmeriaCentralDogmaBuilder.java#L203-L209 |
qiniu/android-sdk | library/src/main/java/com/qiniu/android/http/MultipartBody.java | MultipartBody.appendQuotedString | static StringBuilder appendQuotedString(StringBuilder target, String key) {
"""
Appends a quoted-string to a StringBuilder.
<p>RFC 2388 is rather vague about how one should escape special characters in form-data
parameters, and as it turns out Firefox and Chrome actually do rather different things, and
both s... | java | static StringBuilder appendQuotedString(StringBuilder target, String key) {
target.append('"');
for (int i = 0, len = key.length(); i < len; i++) {
char ch = key.charAt(i);
switch (ch) {
case '\n':
target.append("%0A");
brea... | [
"static",
"StringBuilder",
"appendQuotedString",
"(",
"StringBuilder",
"target",
",",
"String",
"key",
")",
"{",
"target",
".",
"append",
"(",
"'",
"'",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"len",
"=",
"key",
".",
"length",
"(",
")",
";",... | Appends a quoted-string to a StringBuilder.
<p>RFC 2388 is rather vague about how one should escape special characters in form-data
parameters, and as it turns out Firefox and Chrome actually do rather different things, and
both say in their comments that they're not really sure what the right approach is. We go with
... | [
"Appends",
"a",
"quoted",
"-",
"string",
"to",
"a",
"StringBuilder",
"."
] | train | https://github.com/qiniu/android-sdk/blob/dbd2a01fb3bff7a5e75e8934bbf81713124d8466/library/src/main/java/com/qiniu/android/http/MultipartBody.java#L97-L118 |
joniles/mpxj | src/main/java/net/sf/mpxj/merlin/MerlinReader.java | MerlinReader.getNodeList | private NodeList getNodeList(String document, XPathExpression expression) throws Exception {
"""
Retrieve a node list based on an XPath expression.
@param document XML document to process
@param expression compiled XPath expression
@return node list
"""
Document doc = m_documentBuilder.parse(new Inp... | java | private NodeList getNodeList(String document, XPathExpression expression) throws Exception
{
Document doc = m_documentBuilder.parse(new InputSource(new StringReader(document)));
return (NodeList) expression.evaluate(doc, XPathConstants.NODESET);
} | [
"private",
"NodeList",
"getNodeList",
"(",
"String",
"document",
",",
"XPathExpression",
"expression",
")",
"throws",
"Exception",
"{",
"Document",
"doc",
"=",
"m_documentBuilder",
".",
"parse",
"(",
"new",
"InputSource",
"(",
"new",
"StringReader",
"(",
"document... | Retrieve a node list based on an XPath expression.
@param document XML document to process
@param expression compiled XPath expression
@return node list | [
"Retrieve",
"a",
"node",
"list",
"based",
"on",
"an",
"XPath",
"expression",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/merlin/MerlinReader.java#L666-L670 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/odmg/locking/InMemoryLockMapImpl.java | InMemoryLockMapImpl.addReader | public boolean addReader(TransactionImpl tx, Object obj) {
"""
Add a reader lock entry for transaction tx on object obj
to the persistent storage.
"""
checkTimedOutLocks();
Identity oid = new Identity(obj,getBroker());
LockEntry reader = new LockEntry(oid.toString(),
... | java | public boolean addReader(TransactionImpl tx, Object obj)
{
checkTimedOutLocks();
Identity oid = new Identity(obj,getBroker());
LockEntry reader = new LockEntry(oid.toString(),
tx.getGUID(),
System.currentTimeMillis(),
LockStrategyFacto... | [
"public",
"boolean",
"addReader",
"(",
"TransactionImpl",
"tx",
",",
"Object",
"obj",
")",
"{",
"checkTimedOutLocks",
"(",
")",
";",
"Identity",
"oid",
"=",
"new",
"Identity",
"(",
"obj",
",",
"getBroker",
"(",
")",
")",
";",
"LockEntry",
"reader",
"=",
... | Add a reader lock entry for transaction tx on object obj
to the persistent storage. | [
"Add",
"a",
"reader",
"lock",
"entry",
"for",
"transaction",
"tx",
"on",
"object",
"obj",
"to",
"the",
"persistent",
"storage",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/locking/InMemoryLockMapImpl.java#L132-L145 |
SonarSource/sonarqube | server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java | MyBatis.newScrollingSelectStatement | public PreparedStatement newScrollingSelectStatement(DbSession session, String sql) {
"""
Create a PreparedStatement for SELECT requests with scrolling of results
"""
int fetchSize = database.getDialect().getScrollDefaultFetchSize();
return newScrollingSelectStatement(session, sql, fetchSize);
} | java | public PreparedStatement newScrollingSelectStatement(DbSession session, String sql) {
int fetchSize = database.getDialect().getScrollDefaultFetchSize();
return newScrollingSelectStatement(session, sql, fetchSize);
} | [
"public",
"PreparedStatement",
"newScrollingSelectStatement",
"(",
"DbSession",
"session",
",",
"String",
"sql",
")",
"{",
"int",
"fetchSize",
"=",
"database",
".",
"getDialect",
"(",
")",
".",
"getScrollDefaultFetchSize",
"(",
")",
";",
"return",
"newScrollingSelec... | Create a PreparedStatement for SELECT requests with scrolling of results | [
"Create",
"a",
"PreparedStatement",
"for",
"SELECT",
"requests",
"with",
"scrolling",
"of",
"results"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java#L312-L315 |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/HELM2NotationUtils.java | HELM2NotationUtils.section2 | private static void section2(List<ConnectionNotation> connections, Map<String, String> mapIds) throws NotationException {
"""
method to add ConnectionNotation to the existent
@param connections ConnectionNotatoin
@param mapIds Map of old and new Ids
@throws NotationException if notation is not valid
"""
... | java | private static void section2(List<ConnectionNotation> connections, Map<String, String> mapIds) throws NotationException {
for (ConnectionNotation connection : connections) {
HELMEntity first = connection.getSourceId();
String idFirst = first.getId();
HELMEntity second = connection.getTarge... | [
"private",
"static",
"void",
"section2",
"(",
"List",
"<",
"ConnectionNotation",
">",
"connections",
",",
"Map",
"<",
"String",
",",
"String",
">",
"mapIds",
")",
"throws",
"NotationException",
"{",
"for",
"(",
"ConnectionNotation",
"connection",
":",
"connectio... | method to add ConnectionNotation to the existent
@param connections ConnectionNotatoin
@param mapIds Map of old and new Ids
@throws NotationException if notation is not valid | [
"method",
"to",
"add",
"ConnectionNotation",
"to",
"the",
"existent"
] | train | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/HELM2NotationUtils.java#L273-L296 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/cluster/topology/TopologyComparators.java | TopologyComparators.isChanged | public static boolean isChanged(Partitions o1, Partitions o2) {
"""
Check if properties changed which are essential for cluster operations.
@param o1 the first object to be compared.
@param o2 the second object to be compared.
@return {@literal true} if {@code MASTER} or {@code SLAVE} flags changed or the res... | java | public static boolean isChanged(Partitions o1, Partitions o2) {
if (o1.size() != o2.size()) {
return true;
}
for (RedisClusterNode base : o2) {
if (!essentiallyEqualsTo(base, o1.getPartitionByNodeId(base.getNodeId()))) {
return true;
}
... | [
"public",
"static",
"boolean",
"isChanged",
"(",
"Partitions",
"o1",
",",
"Partitions",
"o2",
")",
"{",
"if",
"(",
"o1",
".",
"size",
"(",
")",
"!=",
"o2",
".",
"size",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"for",
"(",
"RedisClusterNode",
... | Check if properties changed which are essential for cluster operations.
@param o1 the first object to be compared.
@param o2 the second object to be compared.
@return {@literal true} if {@code MASTER} or {@code SLAVE} flags changed or the responsible slots changed. | [
"Check",
"if",
"properties",
"changed",
"which",
"are",
"essential",
"for",
"cluster",
"operations",
"."
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/cluster/topology/TopologyComparators.java#L121-L134 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/termofuse/TermOfUsePanel.java | TermOfUsePanel.newRightsAndDutiesPanel | protected Component newRightsAndDutiesPanel(final String id,
final IModel<RightsAndDutiesModelBean> model) {
"""
Factory method for creating the new {@link Component} for the rights and duties. This method
is invoked in the constructor from the derived classes and can be overridden so users can
provide their o... | java | protected Component newRightsAndDutiesPanel(final String id,
final IModel<RightsAndDutiesModelBean> model)
{
return new RightsAndDutiesPanel(id, model);
} | [
"protected",
"Component",
"newRightsAndDutiesPanel",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"RightsAndDutiesModelBean",
">",
"model",
")",
"{",
"return",
"new",
"RightsAndDutiesPanel",
"(",
"id",
",",
"model",
")",
";",
"}"
] | Factory method for creating the new {@link Component} for the rights and duties. This method
is invoked in the constructor from the derived classes and can be overridden so users can
provide their own version of a new {@link Component} for the rights and duties.
@param id
the id
@param model
the model
@return the new ... | [
"Factory",
"method",
"for",
"creating",
"the",
"new",
"{",
"@link",
"Component",
"}",
"for",
"the",
"rights",
"and",
"duties",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"ove... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/termofuse/TermOfUsePanel.java#L347-L351 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/TableForm.java | TableForm.addButton | public Input addButton(String tag,
String label) {
"""
Add a Submit Button.
@param tag The form name of the element
@param label The label for the Button
"""
if (buttons==null)
buttonsAtBottom();
Input e = new Input(Input.Submit,tag,label);
if (... | java | public Input addButton(String tag,
String label)
{
if (buttons==null)
buttonsAtBottom();
Input e = new Input(Input.Submit,tag,label);
if (extendRow)
addField(null,e);
else
buttons.add(e);
return e;
} | [
"public",
"Input",
"addButton",
"(",
"String",
"tag",
",",
"String",
"label",
")",
"{",
"if",
"(",
"buttons",
"==",
"null",
")",
"buttonsAtBottom",
"(",
")",
";",
"Input",
"e",
"=",
"new",
"Input",
"(",
"Input",
".",
"Submit",
",",
"tag",
",",
"label... | Add a Submit Button.
@param tag The form name of the element
@param label The label for the Button | [
"Add",
"a",
"Submit",
"Button",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/TableForm.java#L263-L275 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java | SimpleDocTreeVisitor.visitUnknownBlockTag | @Override
public R visitUnknownBlockTag(UnknownBlockTagTree node, P p) {
"""
{@inheritDoc} This implementation calls {@code defaultAction}.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of {@code defaultAction}
"""
return defaultAction(node, p);
} | java | @Override
public R visitUnknownBlockTag(UnknownBlockTagTree node, P p) {
return defaultAction(node, p);
} | [
"@",
"Override",
"public",
"R",
"visitUnknownBlockTag",
"(",
"UnknownBlockTagTree",
"node",
",",
"P",
"p",
")",
"{",
"return",
"defaultAction",
"(",
"node",
",",
"p",
")",
";",
"}"
] | {@inheritDoc} This implementation calls {@code defaultAction}.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of {@code defaultAction} | [
"{",
"@inheritDoc",
"}",
"This",
"implementation",
"calls",
"{",
"@code",
"defaultAction",
"}",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java#L429-L432 |
kopihao/peasy-recyclerview | peasy-recyclerview/src/main/java/com/kopirealm/peasyrecyclerview/PeasyViewHolder.java | PeasyViewHolder.inflateView | public static View inflateView(LayoutInflater inflater, ViewGroup parent, int layoutId) {
"""
Static method to help inflate parent view with layoutId
@param inflater inflater
@param parent parent
@param layoutId layoutId
@return View
"""
return inflater.inflate(layoutId, parent, false);
} | java | public static View inflateView(LayoutInflater inflater, ViewGroup parent, int layoutId) {
return inflater.inflate(layoutId, parent, false);
} | [
"public",
"static",
"View",
"inflateView",
"(",
"LayoutInflater",
"inflater",
",",
"ViewGroup",
"parent",
",",
"int",
"layoutId",
")",
"{",
"return",
"inflater",
".",
"inflate",
"(",
"layoutId",
",",
"parent",
",",
"false",
")",
";",
"}"
] | Static method to help inflate parent view with layoutId
@param inflater inflater
@param parent parent
@param layoutId layoutId
@return View | [
"Static",
"method",
"to",
"help",
"inflate",
"parent",
"view",
"with",
"layoutId"
] | train | https://github.com/kopihao/peasy-recyclerview/blob/a26071849e5d5b5b1febe685f205558b49908f87/peasy-recyclerview/src/main/java/com/kopirealm/peasyrecyclerview/PeasyViewHolder.java#L25-L27 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/dump/codec/TimedSQLEncoder.java | TimedSQLEncoder.encodeDiff | protected String encodeDiff(final Task<Diff> task, final Diff diff)
throws ConfigurationException, UnsupportedEncodingException,
DecodingException, EncodingException, SQLConsumerException {
"""
Encodes the diff.
@param task
Reference to the DiffTask
@param diff
Diff to encode
@return Base 64 encoded Dif... | java | protected String encodeDiff(final Task<Diff> task, final Diff diff)
throws ConfigurationException, UnsupportedEncodingException,
DecodingException, EncodingException, SQLConsumerException
{
String encoding = super.encodeDiff(task, diff);
this.encodedSize += encoding.length();
return encoding;
} | [
"protected",
"String",
"encodeDiff",
"(",
"final",
"Task",
"<",
"Diff",
">",
"task",
",",
"final",
"Diff",
"diff",
")",
"throws",
"ConfigurationException",
",",
"UnsupportedEncodingException",
",",
"DecodingException",
",",
"EncodingException",
",",
"SQLConsumerExcept... | Encodes the diff.
@param task
Reference to the DiffTask
@param diff
Diff to encode
@return Base 64 encoded Diff
@throws ConfigurationException
if an error occurred while accessing the configuration
@throws UnsupportedEncodingException
if the character encoding is unsupported
@throws DecodingException
if the decoding ... | [
"Encodes",
"the",
"diff",
"."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/dump/codec/TimedSQLEncoder.java#L121-L131 |
igniterealtime/Smack | smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentSession.java | AgentSession.setStatus | public void setStatus(Presence.Mode presenceMode, int maxChats) throws XMPPException, SmackException, InterruptedException {
"""
Sets the agent's current status with the workgroup. The presence mode affects
how offers are routed to the agent. The possible presence modes with their
meanings are as follows:<ul>
... | java | public void setStatus(Presence.Mode presenceMode, int maxChats) throws XMPPException, SmackException, InterruptedException {
setStatus(presenceMode, maxChats, null);
} | [
"public",
"void",
"setStatus",
"(",
"Presence",
".",
"Mode",
"presenceMode",
",",
"int",
"maxChats",
")",
"throws",
"XMPPException",
",",
"SmackException",
",",
"InterruptedException",
"{",
"setStatus",
"(",
"presenceMode",
",",
"maxChats",
",",
"null",
")",
";"... | Sets the agent's current status with the workgroup. The presence mode affects
how offers are routed to the agent. The possible presence modes with their
meanings are as follows:<ul>
<li>Presence.Mode.AVAILABLE -- (Default) the agent is available for more chats
(equivalent to Presence.Mode.CHAT).
<li>Presence.Mode.DO_N... | [
"Sets",
"the",
"agent",
"s",
"current",
"status",
"with",
"the",
"workgroup",
".",
"The",
"presence",
"mode",
"affects",
"how",
"offers",
"are",
"routed",
"to",
"the",
"agent",
".",
"The",
"possible",
"presence",
"modes",
"with",
"their",
"meanings",
"are",
... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentSession.java#L389-L391 |
rnorth/visible-assertions | src/main/java/org/rnorth/visibleassertions/VisibleAssertions.java | VisibleAssertions.assertNull | public static void assertNull(String message, Object o) {
"""
Assert that a value is null.
<p>
If the assertion passes, a green tick will be shown. If the assertion fails, a red cross will be shown.
@param message message to display alongside the assertion outcome
@param o value to test
"""
... | java | public static void assertNull(String message, Object o) {
if (o == null) {
pass(message);
} else {
fail(message, "'" + o + "' is not null");
}
} | [
"public",
"static",
"void",
"assertNull",
"(",
"String",
"message",
",",
"Object",
"o",
")",
"{",
"if",
"(",
"o",
"==",
"null",
")",
"{",
"pass",
"(",
"message",
")",
";",
"}",
"else",
"{",
"fail",
"(",
"message",
",",
"\"'\"",
"+",
"o",
"+",
"\"... | Assert that a value is null.
<p>
If the assertion passes, a green tick will be shown. If the assertion fails, a red cross will be shown.
@param message message to display alongside the assertion outcome
@param o value to test | [
"Assert",
"that",
"a",
"value",
"is",
"null",
".",
"<p",
">",
"If",
"the",
"assertion",
"passes",
"a",
"green",
"tick",
"will",
"be",
"shown",
".",
"If",
"the",
"assertion",
"fails",
"a",
"red",
"cross",
"will",
"be",
"shown",
"."
] | train | https://github.com/rnorth/visible-assertions/blob/6d7a7724db40ac0e9f87279553f814b790310b3b/src/main/java/org/rnorth/visibleassertions/VisibleAssertions.java#L279-L285 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/Matrices.java | Matrices.getRotationJAMA | public static Matrix getRotationJAMA(Matrix4d transform) {
"""
Convert a transformation matrix into a JAMA rotation matrix. Because the
JAMA matrix is a pre-multiplication matrix and the Vecmath matrix is a
post-multiplication one, the rotation matrix is transposed to ensure that
the transformation they produce... | java | public static Matrix getRotationJAMA(Matrix4d transform) {
Matrix rot = new Matrix(3, 3);
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
rot.set(j, i, transform.getElement(i, j)); // transposed
}
}
return rot;
} | [
"public",
"static",
"Matrix",
"getRotationJAMA",
"(",
"Matrix4d",
"transform",
")",
"{",
"Matrix",
"rot",
"=",
"new",
"Matrix",
"(",
"3",
",",
"3",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"3",
";",
"i",
"++",
")",
"{",
"for",
... | Convert a transformation matrix into a JAMA rotation matrix. Because the
JAMA matrix is a pre-multiplication matrix and the Vecmath matrix is a
post-multiplication one, the rotation matrix is transposed to ensure that
the transformation they produce is the same.
@param transform
Matrix4d with transposed rotation matri... | [
"Convert",
"a",
"transformation",
"matrix",
"into",
"a",
"JAMA",
"rotation",
"matrix",
".",
"Because",
"the",
"JAMA",
"matrix",
"is",
"a",
"pre",
"-",
"multiplication",
"matrix",
"and",
"the",
"Vecmath",
"matrix",
"is",
"a",
"post",
"-",
"multiplication",
"o... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/Matrices.java#L54-L63 |
codelibs/fess | src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java | FessMessages.addConstraintsDigitsMessage | public FessMessages addConstraintsDigitsMessage(String property, String fraction, String integer) {
"""
Add the created action message for the key 'constraints.Digits.message' with parameters.
<pre>
message: {item} is numeric value out of bounds (<{integer} digits>.<{fraction} digits> expected).
</p... | java | public FessMessages addConstraintsDigitsMessage(String property, String fraction, String integer) {
assertPropertyNotNull(property);
add(property, new UserMessage(CONSTRAINTS_Digits_MESSAGE, fraction, integer));
return this;
} | [
"public",
"FessMessages",
"addConstraintsDigitsMessage",
"(",
"String",
"property",
",",
"String",
"fraction",
",",
"String",
"integer",
")",
"{",
"assertPropertyNotNull",
"(",
"property",
")",
";",
"add",
"(",
"property",
",",
"new",
"UserMessage",
"(",
"CONSTRAI... | Add the created action message for the key 'constraints.Digits.message' with parameters.
<pre>
message: {item} is numeric value out of bounds (<{integer} digits>.<{fraction} digits> expected).
</pre>
@param property The property name for the message. (NotNull)
@param fraction The parameter fraction for mess... | [
"Add",
"the",
"created",
"action",
"message",
"for",
"the",
"key",
"constraints",
".",
"Digits",
".",
"message",
"with",
"parameters",
".",
"<pre",
">",
"message",
":",
"{",
"item",
"}",
"is",
"numeric",
"value",
"out",
"of",
"bounds",
"(",
"<",
";",
... | train | https://github.com/codelibs/fess/blob/e5e4b722549d32a4958dfd94965b21937bfe64cf/src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java#L667-L671 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapsInner.java | VirtualNetworkTapsInner.getByResourceGroupAsync | public Observable<VirtualNetworkTapInner> getByResourceGroupAsync(String resourceGroupName, String tapName) {
"""
Gets information about the specified virtual network tap.
@param resourceGroupName The name of the resource group.
@param tapName The name of virtual network tap.
@throws IllegalArgumentException ... | java | public Observable<VirtualNetworkTapInner> getByResourceGroupAsync(String resourceGroupName, String tapName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, tapName).map(new Func1<ServiceResponse<VirtualNetworkTapInner>, VirtualNetworkTapInner>() {
@Override
public ... | [
"public",
"Observable",
"<",
"VirtualNetworkTapInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"tapName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"tapName",
")",
".",
"map"... | Gets information about the specified virtual network tap.
@param resourceGroupName The name of the resource group.
@param tapName The name of virtual network tap.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the VirtualNetworkTapInner object | [
"Gets",
"information",
"about",
"the",
"specified",
"virtual",
"network",
"tap",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapsInner.java#L302-L309 |
DDTH/ddth-queue | ddth-queue-core/src/main/java/com/github/ddth/queue/impl/RabbitMqQueue.java | RabbitMqQueue.putToQueue | protected boolean putToQueue(IQueueMessage<ID, DATA> msg) {
"""
Puts a message to Kafka queue, partitioning message by
{@link IQueueMessage#qId()}
@param msg
@return
"""
try {
byte[] msgData = serialize(msg);
getProducerChannel().basicPublish("", queueName, null, msgData);
... | java | protected boolean putToQueue(IQueueMessage<ID, DATA> msg) {
try {
byte[] msgData = serialize(msg);
getProducerChannel().basicPublish("", queueName, null, msgData);
return true;
} catch (Exception e) {
throw e instanceof QueueException ? (QueueException) e ... | [
"protected",
"boolean",
"putToQueue",
"(",
"IQueueMessage",
"<",
"ID",
",",
"DATA",
">",
"msg",
")",
"{",
"try",
"{",
"byte",
"[",
"]",
"msgData",
"=",
"serialize",
"(",
"msg",
")",
";",
"getProducerChannel",
"(",
")",
".",
"basicPublish",
"(",
"\"\"",
... | Puts a message to Kafka queue, partitioning message by
{@link IQueueMessage#qId()}
@param msg
@return | [
"Puts",
"a",
"message",
"to",
"Kafka",
"queue",
"partitioning",
"message",
"by",
"{",
"@link",
"IQueueMessage#qId",
"()",
"}"
] | train | https://github.com/DDTH/ddth-queue/blob/b20776850d23111d3d71fc8ed6023c590bc3621f/ddth-queue-core/src/main/java/com/github/ddth/queue/impl/RabbitMqQueue.java#L237-L245 |
alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/utils/disruptor/RingBuffer.java | RingBuffer.tryPublishEvent | public boolean tryPublishEvent(EventTranslatorVararg<E> translator, Object... args) {
"""
Allows a variable number of user supplied arguments
@see #publishEvent(EventTranslator)
@param translator The user specified translation for the event
@param args User supplied arguments.
@return true if the value was p... | java | public boolean tryPublishEvent(EventTranslatorVararg<E> translator, Object... args) {
try {
final long sequence = sequencer.tryNext();
translateAndPublish(translator, sequence, args);
return true;
} catch (InsufficientCapacityException e) {
return false;
... | [
"public",
"boolean",
"tryPublishEvent",
"(",
"EventTranslatorVararg",
"<",
"E",
">",
"translator",
",",
"Object",
"...",
"args",
")",
"{",
"try",
"{",
"final",
"long",
"sequence",
"=",
"sequencer",
".",
"tryNext",
"(",
")",
";",
"translateAndPublish",
"(",
"... | Allows a variable number of user supplied arguments
@see #publishEvent(EventTranslator)
@param translator The user specified translation for the event
@param args User supplied arguments.
@return true if the value was published, false if there was insufficient capacity. | [
"Allows",
"a",
"variable",
"number",
"of",
"user",
"supplied",
"arguments"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/utils/disruptor/RingBuffer.java#L499-L507 |
mikepenz/Android-Iconics | library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java | IconicsDrawable.iconOffsetYDp | @NonNull
public IconicsDrawable iconOffsetYDp(@Dimension(unit = DP) int sizeDp) {
"""
set the icon offset for Y as dp
@return The current IconicsDrawable for chaining.
"""
return iconOffsetYPx(Utils.convertDpToPx(mContext, sizeDp));
} | java | @NonNull
public IconicsDrawable iconOffsetYDp(@Dimension(unit = DP) int sizeDp) {
return iconOffsetYPx(Utils.convertDpToPx(mContext, sizeDp));
} | [
"@",
"NonNull",
"public",
"IconicsDrawable",
"iconOffsetYDp",
"(",
"@",
"Dimension",
"(",
"unit",
"=",
"DP",
")",
"int",
"sizeDp",
")",
"{",
"return",
"iconOffsetYPx",
"(",
"Utils",
".",
"convertDpToPx",
"(",
"mContext",
",",
"sizeDp",
")",
")",
";",
"}"
] | set the icon offset for Y as dp
@return The current IconicsDrawable for chaining. | [
"set",
"the",
"icon",
"offset",
"for",
"Y",
"as",
"dp"
] | train | https://github.com/mikepenz/Android-Iconics/blob/0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8/library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java#L558-L561 |
kuujo/vertigo | core/src/main/java/net/kuujo/vertigo/Vertigo.java | Vertigo.undeployNetwork | public Vertigo undeployNetwork(String cluster, JsonObject network) {
"""
Undeploys a network from the given cluster from a json configuration.<p>
The JSON configuration will immediately be converted to a {@link NetworkConfig} prior
to undeploying the network. In order to undeploy the entire network, the config... | java | public Vertigo undeployNetwork(String cluster, JsonObject network) {
return undeployNetwork(cluster, network, null);
} | [
"public",
"Vertigo",
"undeployNetwork",
"(",
"String",
"cluster",
",",
"JsonObject",
"network",
")",
"{",
"return",
"undeployNetwork",
"(",
"cluster",
",",
"network",
",",
"null",
")",
";",
"}"
] | Undeploys a network from the given cluster from a json configuration.<p>
The JSON configuration will immediately be converted to a {@link NetworkConfig} prior
to undeploying the network. In order to undeploy the entire network, the configuration
should be the same as the deployed configuration. Vertigo will use config... | [
"Undeploys",
"a",
"network",
"from",
"the",
"given",
"cluster",
"from",
"a",
"json",
"configuration",
".",
"<p",
">"
] | train | https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/Vertigo.java#L645-L647 |
infinispan/infinispan | object-filter/src/main/java/org/infinispan/objectfilter/impl/util/IntervalTree.java | IntervalTree.compareIntervals | private int compareIntervals(Interval<K> i1, Interval<K> i2) {
"""
Compare two Intervals.
@return a negative integer, zero, or a positive integer depending if Interval i1 is to the left of i2, overlaps
with it, or is to the right of i2.
"""
int res1 = compare(i1.up, i2.low);
if (res1 < 0 || res... | java | private int compareIntervals(Interval<K> i1, Interval<K> i2) {
int res1 = compare(i1.up, i2.low);
if (res1 < 0 || res1 <= 0 && (!i1.includeUpper || !i2.includeLower)) {
return -1;
}
int res2 = compare(i2.up, i1.low);
if (res2 < 0 || res2 <= 0 && (!i2.includeUpper || !i1.includeLow... | [
"private",
"int",
"compareIntervals",
"(",
"Interval",
"<",
"K",
">",
"i1",
",",
"Interval",
"<",
"K",
">",
"i2",
")",
"{",
"int",
"res1",
"=",
"compare",
"(",
"i1",
".",
"up",
",",
"i2",
".",
"low",
")",
";",
"if",
"(",
"res1",
"<",
"0",
"||",... | Compare two Intervals.
@return a negative integer, zero, or a positive integer depending if Interval i1 is to the left of i2, overlaps
with it, or is to the right of i2. | [
"Compare",
"two",
"Intervals",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/object-filter/src/main/java/org/infinispan/objectfilter/impl/util/IntervalTree.java#L102-L112 |
netplex/json-smart-v2 | json-smart/src/main/java/net/minidev/json/parser/JSONParserByteArray.java | JSONParserByteArray.parse | public <T> T parse(byte[] in, JsonReaderI<T> mapper) throws ParseException {
"""
use to return Primitive Type, or String, Or JsonObject or JsonArray
generated by a ContainerFactory
"""
this.base = mapper.base;
this.in = in;
this.len = in.length;
return parse(mapper);
} | java | public <T> T parse(byte[] in, JsonReaderI<T> mapper) throws ParseException {
this.base = mapper.base;
this.in = in;
this.len = in.length;
return parse(mapper);
} | [
"public",
"<",
"T",
">",
"T",
"parse",
"(",
"byte",
"[",
"]",
"in",
",",
"JsonReaderI",
"<",
"T",
">",
"mapper",
")",
"throws",
"ParseException",
"{",
"this",
".",
"base",
"=",
"mapper",
".",
"base",
";",
"this",
".",
"in",
"=",
"in",
";",
"this"... | use to return Primitive Type, or String, Or JsonObject or JsonArray
generated by a ContainerFactory | [
"use",
"to",
"return",
"Primitive",
"Type",
"or",
"String",
"Or",
"JsonObject",
"or",
"JsonArray",
"generated",
"by",
"a",
"ContainerFactory"
] | train | https://github.com/netplex/json-smart-v2/blob/bfb3daef039e22a7bbff5f76bf14ea23330cd70e/json-smart/src/main/java/net/minidev/json/parser/JSONParserByteArray.java#L54-L59 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.moveResource | public void moveResource(String source, String destination) throws CmsException {
"""
Moves a resource to the given destination.<p>
A move operation in OpenCms is always a copy (as sibling) followed by a delete,
this is a result of the online/offline structure of the
OpenCms VFS. This way you can see the dele... | java | public void moveResource(String source, String destination) throws CmsException {
CmsResource resource = readResource(source, CmsResourceFilter.IGNORE_EXPIRATION);
getResourceType(resource).moveResource(this, m_securityManager, resource, destination);
} | [
"public",
"void",
"moveResource",
"(",
"String",
"source",
",",
"String",
"destination",
")",
"throws",
"CmsException",
"{",
"CmsResource",
"resource",
"=",
"readResource",
"(",
"source",
",",
"CmsResourceFilter",
".",
"IGNORE_EXPIRATION",
")",
";",
"getResourceType... | Moves a resource to the given destination.<p>
A move operation in OpenCms is always a copy (as sibling) followed by a delete,
this is a result of the online/offline structure of the
OpenCms VFS. This way you can see the deleted files/folders in the offline
project, and you will be unable to undelete them.<p>
@param s... | [
"Moves",
"a",
"resource",
"to",
"the",
"given",
"destination",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L2241-L2245 |
languagetool-org/languagetool | languagetool-office-extension/src/main/java/org/languagetool/openoffice/ResultCache.java | ResultCache.removeRange | void removeRange(int firstParagraph, int lastParagraph) {
"""
Remove all cache entries between firstParagraph and lastParagraph
"""
for(int i = 0; i < entries.size(); i++) {
if(entries.get(i).numberOfParagraph >= firstParagraph && entries.get(i).numberOfParagraph <= lastParagraph) {
entries.r... | java | void removeRange(int firstParagraph, int lastParagraph) {
for(int i = 0; i < entries.size(); i++) {
if(entries.get(i).numberOfParagraph >= firstParagraph && entries.get(i).numberOfParagraph <= lastParagraph) {
entries.remove(i);
i--;
}
}
} | [
"void",
"removeRange",
"(",
"int",
"firstParagraph",
",",
"int",
"lastParagraph",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"entries",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
"entries",
".",
"get",
"(",
"i",
... | Remove all cache entries between firstParagraph and lastParagraph | [
"Remove",
"all",
"cache",
"entries",
"between",
"firstParagraph",
"and",
"lastParagraph"
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-office-extension/src/main/java/org/languagetool/openoffice/ResultCache.java#L67-L74 |
jboss/jboss-jsp-api_spec | src/main/java/javax/servlet/jsp/tagext/TagSupport.java | TagSupport.findAncestorWithClass | public static final Tag findAncestorWithClass(Tag from, Class klass) {
"""
Find the instance of a given class type that is closest to a given
instance.
This method uses the getParent method from the Tag
interface.
This method is used for coordination among cooperating tags.
<p>
The current version of the s... | java | public static final Tag findAncestorWithClass(Tag from, Class klass) {
boolean isInterface = false;
if (from == null ||
klass == null ||
(!Tag.class.isAssignableFrom(klass) &&
!(isInterface = klass.isInterface()))) {
return null;
}
for (;;) {
Tag tag = from.getParent();
if (tag == ... | [
"public",
"static",
"final",
"Tag",
"findAncestorWithClass",
"(",
"Tag",
"from",
",",
"Class",
"klass",
")",
"{",
"boolean",
"isInterface",
"=",
"false",
";",
"if",
"(",
"from",
"==",
"null",
"||",
"klass",
"==",
"null",
"||",
"(",
"!",
"Tag",
".",
"cl... | Find the instance of a given class type that is closest to a given
instance.
This method uses the getParent method from the Tag
interface.
This method is used for coordination among cooperating tags.
<p>
The current version of the specification only provides one formal
way of indicating the observable type of a tag ha... | [
"Find",
"the",
"instance",
"of",
"a",
"given",
"class",
"type",
"that",
"is",
"closest",
"to",
"a",
"given",
"instance",
".",
"This",
"method",
"uses",
"the",
"getParent",
"method",
"from",
"the",
"Tag",
"interface",
".",
"This",
"method",
"is",
"used",
... | train | https://github.com/jboss/jboss-jsp-api_spec/blob/da53166619f33a5134dc3315a3264990cc1f541f/src/main/java/javax/servlet/jsp/tagext/TagSupport.java#L113-L136 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/NormOps_DDRM.java | NormOps_DDRM.fastNormP | public static double fastNormP(DMatrixRMaj A , double p ) {
"""
An unsafe but faster version of {@link #normP} that calls routines which are faster
but more prone to overflow/underflow problems.
@param A Vector or matrix whose norm is to be computed.
@param p The p value of the p-norm.
@return The computed n... | java | public static double fastNormP(DMatrixRMaj A , double p ) {
if( p == 1 ) {
return normP1(A);
} else if( p == 2 ) {
return fastNormP2(A);
} else if( Double.isInfinite(p)) {
return normPInf(A);
}
if( MatrixFeatures_DDRM.isVector(A) ) {
... | [
"public",
"static",
"double",
"fastNormP",
"(",
"DMatrixRMaj",
"A",
",",
"double",
"p",
")",
"{",
"if",
"(",
"p",
"==",
"1",
")",
"{",
"return",
"normP1",
"(",
"A",
")",
";",
"}",
"else",
"if",
"(",
"p",
"==",
"2",
")",
"{",
"return",
"fastNormP2... | An unsafe but faster version of {@link #normP} that calls routines which are faster
but more prone to overflow/underflow problems.
@param A Vector or matrix whose norm is to be computed.
@param p The p value of the p-norm.
@return The computed norm. | [
"An",
"unsafe",
"but",
"faster",
"version",
"of",
"{",
"@link",
"#normP",
"}",
"that",
"calls",
"routines",
"which",
"are",
"faster",
"but",
"more",
"prone",
"to",
"overflow",
"/",
"underflow",
"problems",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/NormOps_DDRM.java#L308-L321 |
JOML-CI/JOML | src/org/joml/Matrix3d.java | Matrix3d.scaling | public Matrix3d scaling(double x, double y, double z) {
"""
Set this matrix to be a simple scale matrix.
@param x
the scale in x
@param y
the scale in y
@param z
the scale in z
@return this
"""
m00 = x;
m01 = 0.0;
m02 = 0.0;
m10 = 0.0;
m11 = y;
m12 = 0.0... | java | public Matrix3d scaling(double x, double y, double z) {
m00 = x;
m01 = 0.0;
m02 = 0.0;
m10 = 0.0;
m11 = y;
m12 = 0.0;
m20 = 0.0;
m21 = 0.0;
m22 = z;
return this;
} | [
"public",
"Matrix3d",
"scaling",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
")",
"{",
"m00",
"=",
"x",
";",
"m01",
"=",
"0.0",
";",
"m02",
"=",
"0.0",
";",
"m10",
"=",
"0.0",
";",
"m11",
"=",
"y",
";",
"m12",
"=",
"0.0",
";",... | Set this matrix to be a simple scale matrix.
@param x
the scale in x
@param y
the scale in y
@param z
the scale in z
@return this | [
"Set",
"this",
"matrix",
"to",
"be",
"a",
"simple",
"scale",
"matrix",
"."
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3d.java#L1357-L1368 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsXmlContainerPageHandler.java | CmsXmlContainerPageHandler.validateNames | protected void validateNames(CmsObject cms, I_CmsXmlContentValue value, CmsXmlContent content)
throws CmsXmlException {
"""
Validates container names, so that they are unique in the page.<p>
@param cms the cms context
@param value the value to validate
@param content the container page to validate
@thr... | java | protected void validateNames(CmsObject cms, I_CmsXmlContentValue value, CmsXmlContent content)
throws CmsXmlException {
// get the current name
Locale locale = value.getLocale();
String namePath = CmsXmlUtils.concatXpath(value.getPath(), CmsXmlContainerPage.XmlNode.Name.name());
Str... | [
"protected",
"void",
"validateNames",
"(",
"CmsObject",
"cms",
",",
"I_CmsXmlContentValue",
"value",
",",
"CmsXmlContent",
"content",
")",
"throws",
"CmsXmlException",
"{",
"// get the current name",
"Locale",
"locale",
"=",
"value",
".",
"getLocale",
"(",
")",
";",... | Validates container names, so that they are unique in the page.<p>
@param cms the cms context
@param value the value to validate
@param content the container page to validate
@throws CmsXmlException if there are duplicated names | [
"Validates",
"container",
"names",
"so",
"that",
"they",
"are",
"unique",
"in",
"the",
"page",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsXmlContainerPageHandler.java#L147-L172 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/util/GraphUtils.java | GraphUtils.toDot | public static <D, N extends DottableNode<D, N>> String toDot(Collection<? extends N> nodes, String name, String header) {
"""
Debugging: dot representation of a set of connected nodes. The resulting
dot representation will use {@code Node.toString} to display node labels
and {@code Node.printDependency} to displ... | java | public static <D, N extends DottableNode<D, N>> String toDot(Collection<? extends N> nodes, String name, String header) {
StringBuilder buf = new StringBuilder();
buf.append(String.format("digraph %s {\n", name));
buf.append(String.format("label = %s;\n", DotVisitor.wrap(header)));
DotVi... | [
"public",
"static",
"<",
"D",
",",
"N",
"extends",
"DottableNode",
"<",
"D",
",",
"N",
">",
">",
"String",
"toDot",
"(",
"Collection",
"<",
"?",
"extends",
"N",
">",
"nodes",
",",
"String",
"name",
",",
"String",
"header",
")",
"{",
"StringBuilder",
... | Debugging: dot representation of a set of connected nodes. The resulting
dot representation will use {@code Node.toString} to display node labels
and {@code Node.printDependency} to display edge labels. The resulting
representation is also customizable with a graph name and a header. | [
"Debugging",
":",
"dot",
"representation",
"of",
"a",
"set",
"of",
"connected",
"nodes",
".",
"The",
"resulting",
"dot",
"representation",
"will",
"use",
"{"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/util/GraphUtils.java#L222-L230 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/shape/Shape.java | Shape.setElementWiseStride | public static void setElementWiseStride(IntBuffer buffer, int elementWiseStride) {
"""
Get the element wise stride for the
shape info buffer
@param buffer the buffer to get the element
wise stride from
@return the element wise stride for the buffer
"""
int length2 = shapeInfoLength(buffer.get(0));
... | java | public static void setElementWiseStride(IntBuffer buffer, int elementWiseStride) {
int length2 = shapeInfoLength(buffer.get(0));
// if (1 > 0) throw new RuntimeException("setElementWiseStride called: [" + elementWiseStride + "], buffer: " + bufferToString(buffer));
buffer.put(length2 - 2,... | [
"public",
"static",
"void",
"setElementWiseStride",
"(",
"IntBuffer",
"buffer",
",",
"int",
"elementWiseStride",
")",
"{",
"int",
"length2",
"=",
"shapeInfoLength",
"(",
"buffer",
".",
"get",
"(",
"0",
")",
")",
";",
"// if (1 > 0) throw new RuntimeException(... | Get the element wise stride for the
shape info buffer
@param buffer the buffer to get the element
wise stride from
@return the element wise stride for the buffer | [
"Get",
"the",
"element",
"wise",
"stride",
"for",
"the",
"shape",
"info",
"buffer"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/shape/Shape.java#L3073-L3077 |
UrielCh/ovh-java-sdk | ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java | ApiOvhPackxdsl.packName_voipLine_options_customShippingAddress_POST | public Long packName_voipLine_options_customShippingAddress_POST(String packName, String address, String cityName, String firstName, String lastName, String zipCode) throws IOException {
"""
Create a new shippingId to be used for voipLine service creation
REST: POST /pack/xdsl/{packName}/voipLine/options/custom... | java | public Long packName_voipLine_options_customShippingAddress_POST(String packName, String address, String cityName, String firstName, String lastName, String zipCode) throws IOException {
String qPath = "/pack/xdsl/{packName}/voipLine/options/customShippingAddress";
StringBuilder sb = path(qPath, packName);
HashMa... | [
"public",
"Long",
"packName_voipLine_options_customShippingAddress_POST",
"(",
"String",
"packName",
",",
"String",
"address",
",",
"String",
"cityName",
",",
"String",
"firstName",
",",
"String",
"lastName",
",",
"String",
"zipCode",
")",
"throws",
"IOException",
"{"... | Create a new shippingId to be used for voipLine service creation
REST: POST /pack/xdsl/{packName}/voipLine/options/customShippingAddress
@param address [required] Address, including street name
@param lastName [required] Last name
@param firstName [required] First name
@param cityName [required] City name
@param zipCo... | [
"Create",
"a",
"new",
"shippingId",
"to",
"be",
"used",
"for",
"voipLine",
"service",
"creation"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java#L320-L331 |
redkale/redkale | src/org/redkale/asm/ClassReader.java | ClassReader.createLabel | private Label createLabel(int offset, Label[] labels) {
"""
Creates a label without the Label.DEBUG flag set, for the given offset.
The label is created with a call to {@link #readLabel} and its
Label.DEBUG flag is cleared.
@param offset
a bytecode offset in a method.
@param labels
the already created labe... | java | private Label createLabel(int offset, Label[] labels) {
Label label = readLabel(offset, labels);
label.status &= ~Label.DEBUG;
return label;
} | [
"private",
"Label",
"createLabel",
"(",
"int",
"offset",
",",
"Label",
"[",
"]",
"labels",
")",
"{",
"Label",
"label",
"=",
"readLabel",
"(",
"offset",
",",
"labels",
")",
";",
"label",
".",
"status",
"&=",
"~",
"Label",
".",
"DEBUG",
";",
"return",
... | Creates a label without the Label.DEBUG flag set, for the given offset.
The label is created with a call to {@link #readLabel} and its
Label.DEBUG flag is cleared.
@param offset
a bytecode offset in a method.
@param labels
the already created labels, indexed by their offset.
@return a Label without the Label.DEBUG fla... | [
"Creates",
"a",
"label",
"without",
"the",
"Label",
".",
"DEBUG",
"flag",
"set",
"for",
"the",
"given",
"offset",
".",
"The",
"label",
"is",
"created",
"with",
"a",
"call",
"to",
"{",
"@link",
"#readLabel",
"}",
"and",
"its",
"Label",
".",
"DEBUG",
"fl... | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/asm/ClassReader.java#L2401-L2405 |
HubSpot/Singularity | SingularityExecutor/src/main/java/com/hubspot/singularity/executor/SingularityExecutor.java | SingularityExecutor.reregistered | @Override
public void reregistered(ExecutorDriver executorDriver, Protos.SlaveInfo slaveInfo) {
"""
Invoked when the executor re-registers with a restarted slave.
"""
LOG.debug("Re-registered with Mesos slave {}", slaveInfo.getId().getValue());
LOG.info("Re-registered with Mesos slave {}", MesosUtils... | java | @Override
public void reregistered(ExecutorDriver executorDriver, Protos.SlaveInfo slaveInfo) {
LOG.debug("Re-registered with Mesos slave {}", slaveInfo.getId().getValue());
LOG.info("Re-registered with Mesos slave {}", MesosUtils.formatForLogging(slaveInfo));
} | [
"@",
"Override",
"public",
"void",
"reregistered",
"(",
"ExecutorDriver",
"executorDriver",
",",
"Protos",
".",
"SlaveInfo",
"slaveInfo",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Re-registered with Mesos slave {}\"",
",",
"slaveInfo",
".",
"getId",
"(",
")",
".",
... | Invoked when the executor re-registers with a restarted slave. | [
"Invoked",
"when",
"the",
"executor",
"re",
"-",
"registers",
"with",
"a",
"restarted",
"slave",
"."
] | train | https://github.com/HubSpot/Singularity/blob/384a8c16a10aa076af5ca45c8dfcedab9e5122c8/SingularityExecutor/src/main/java/com/hubspot/singularity/executor/SingularityExecutor.java#L51-L55 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/task_device_log.java | task_device_log.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
task_device_log_responses result = (task_device_log_responses) service.... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
task_device_log_responses result = (task_device_log_responses) service.get_payload_formatter().string_to_resource(task_device_log_responses.class, response);
if(result.errorcode != 0)
{
if (result... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"task_device_log_responses",
"result",
"=",
"(",
"task_device_log_responses",
")",
"service",
".",
"get_payloa... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/task_device_log.java#L269-L286 |
apereo/cas | support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/web/response/callback/OAuth20AuthorizationCodeAuthorizationResponseBuilder.java | OAuth20AuthorizationCodeAuthorizationResponseBuilder.buildCallbackViewViaRedirectUri | protected ModelAndView buildCallbackViewViaRedirectUri(final J2EContext context, final String clientId,
final Authentication authentication, final OAuthCode code) {
"""
Build callback view via redirect uri model and view.
@param context the conte... | java | protected ModelAndView buildCallbackViewViaRedirectUri(final J2EContext context, final String clientId,
final Authentication authentication, final OAuthCode code) {
val attributes = authentication.getAttributes();
val state = attributes.get(OAut... | [
"protected",
"ModelAndView",
"buildCallbackViewViaRedirectUri",
"(",
"final",
"J2EContext",
"context",
",",
"final",
"String",
"clientId",
",",
"final",
"Authentication",
"authentication",
",",
"final",
"OAuthCode",
"code",
")",
"{",
"val",
"attributes",
"=",
"authent... | Build callback view via redirect uri model and view.
@param context the context
@param clientId the client id
@param authentication the authentication
@param code the code
@return the model and view | [
"Build",
"callback",
"view",
"via",
"redirect",
"uri",
"model",
"and",
"view",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/web/response/callback/OAuth20AuthorizationCodeAuthorizationResponseBuilder.java#L68-L92 |
LearnLib/automatalib | commons/smartcollections/src/main/java/net/automatalib/commons/smartcollections/ArrayUtil.java | ArrayUtil.computeNewCapacity | public static int computeNewCapacity(int length, int requiredCapacity, int nextCapacityHint) {
"""
Computes the size of an array that is required to hold {@code requiredCapacity} number of elements.
<p>
This method first tries to increase the size of the array by a factor of 1.5 to prevent a sequence of successi... | java | public static int computeNewCapacity(int length, int requiredCapacity, int nextCapacityHint) {
if (requiredCapacity < length) {
return length;
}
int newCapacity = (length * 3) / 2 + 1;
if (newCapacity < nextCapacityHint) {
newCapacity = nextCapacityHint;
... | [
"public",
"static",
"int",
"computeNewCapacity",
"(",
"int",
"length",
",",
"int",
"requiredCapacity",
",",
"int",
"nextCapacityHint",
")",
"{",
"if",
"(",
"requiredCapacity",
"<",
"length",
")",
"{",
"return",
"length",
";",
"}",
"int",
"newCapacity",
"=",
... | Computes the size of an array that is required to hold {@code requiredCapacity} number of elements.
<p>
This method first tries to increase the size of the array by a factor of 1.5 to prevent a sequence of successive
increases by 1. It then evaluates the {@code nextCapacityHint} parameter as well as the {@code required... | [
"Computes",
"the",
"size",
"of",
"an",
"array",
"that",
"is",
"required",
"to",
"hold",
"{",
"@code",
"requiredCapacity",
"}",
"number",
"of",
"elements",
".",
"<p",
">",
"This",
"method",
"first",
"tries",
"to",
"increase",
"the",
"size",
"of",
"the",
"... | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/commons/smartcollections/src/main/java/net/automatalib/commons/smartcollections/ArrayUtil.java#L61-L77 |
eclipse/hawkbit | hawkbit-repository/hawkbit-repository-core/src/main/java/org/eclipse/hawkbit/repository/RolloutStatusCache.java | RolloutStatusCache.putRolloutStatus | public void putRolloutStatus(final Map<Long, List<TotalTargetCountActionStatus>> put) {
"""
Put map of {@link TotalTargetCountActionStatus} for multiple
{@link Rollout}s into cache.
@param put
map of cached entries
"""
final Cache cache = cacheManager.getCache(CACHE_RO_NAME);
putIntoCache(... | java | public void putRolloutStatus(final Map<Long, List<TotalTargetCountActionStatus>> put) {
final Cache cache = cacheManager.getCache(CACHE_RO_NAME);
putIntoCache(put, cache);
} | [
"public",
"void",
"putRolloutStatus",
"(",
"final",
"Map",
"<",
"Long",
",",
"List",
"<",
"TotalTargetCountActionStatus",
">",
">",
"put",
")",
"{",
"final",
"Cache",
"cache",
"=",
"cacheManager",
".",
"getCache",
"(",
"CACHE_RO_NAME",
")",
";",
"putIntoCache"... | Put map of {@link TotalTargetCountActionStatus} for multiple
{@link Rollout}s into cache.
@param put
map of cached entries | [
"Put",
"map",
"of",
"{",
"@link",
"TotalTargetCountActionStatus",
"}",
"for",
"multiple",
"{",
"@link",
"Rollout",
"}",
"s",
"into",
"cache",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-core/src/main/java/org/eclipse/hawkbit/repository/RolloutStatusCache.java#L130-L133 |
the-fascinator/plugin-roles-internal | src/main/java/com/googlecode/fascinator/roles/internal/InternalRoles.java | InternalRoles.removeRole | @Override
public void removeRole(String username, String oldrole) throws RolesException {
"""
Remove a role from a user.
@param username
The username of the user.
@param oldrole
The role to remove from the user.
@throws RolesException
if there was an error during removal.
"""
List<String> users_with... | java | @Override
public void removeRole(String username, String oldrole) throws RolesException {
List<String> users_with_role = new ArrayList<String>();
if (user_list.containsKey(username)) {
List<String> roles_of_user = user_list.get(username);
if (roles_of_user.contains(oldrole)) {
// Update our user list
... | [
"@",
"Override",
"public",
"void",
"removeRole",
"(",
"String",
"username",
",",
"String",
"oldrole",
")",
"throws",
"RolesException",
"{",
"List",
"<",
"String",
">",
"users_with_role",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"if",
"("... | Remove a role from a user.
@param username
The username of the user.
@param oldrole
The role to remove from the user.
@throws RolesException
if there was an error during removal. | [
"Remove",
"a",
"role",
"from",
"a",
"user",
"."
] | train | https://github.com/the-fascinator/plugin-roles-internal/blob/5f75f802a92ef907acf030692d462aec4b4d3aae/src/main/java/com/googlecode/fascinator/roles/internal/InternalRoles.java#L337-L373 |
httl/httl | httl/src/main/java/httl/Engine.java | Engine.getResource | public Resource getResource(String name, Locale locale) throws IOException {
"""
Get template resource.
@param name - template name
@param locale - template locale
@return template resource
@throws IOException - If an I/O error occurs
@see #getEngine()
"""
return getResource(name, locale, null... | java | public Resource getResource(String name, Locale locale) throws IOException {
return getResource(name, locale, null);
} | [
"public",
"Resource",
"getResource",
"(",
"String",
"name",
",",
"Locale",
"locale",
")",
"throws",
"IOException",
"{",
"return",
"getResource",
"(",
"name",
",",
"locale",
",",
"null",
")",
";",
"}"
] | Get template resource.
@param name - template name
@param locale - template locale
@return template resource
@throws IOException - If an I/O error occurs
@see #getEngine() | [
"Get",
"template",
"resource",
"."
] | train | https://github.com/httl/httl/blob/e13e00f4ab41252a8f53d6dafd4a6610be9dcaad/httl/src/main/java/httl/Engine.java#L282-L284 |
lionsoul2014/jcseg | jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/JSONzip.java | JSONzip.logchar | static void logchar(int integer, int width) {
"""
Write a character or its code to the console.
@param integer The charcode to be written to the log.
@param width The width of the charcode in bits.
"""
if (integer > ' ' && integer <= '}') {
log("'" + (char) integer + "':" + width + " ")... | java | static void logchar(int integer, int width) {
if (integer > ' ' && integer <= '}') {
log("'" + (char) integer + "':" + width + " ");
} else {
log(integer, width);
}
} | [
"static",
"void",
"logchar",
"(",
"int",
"integer",
",",
"int",
"width",
")",
"{",
"if",
"(",
"integer",
">",
"'",
"'",
"&&",
"integer",
"<=",
"'",
"'",
")",
"{",
"log",
"(",
"\"'\"",
"+",
"(",
"char",
")",
"integer",
"+",
"\"':\"",
"+",
"width",... | Write a character or its code to the console.
@param integer The charcode to be written to the log.
@param width The width of the charcode in bits. | [
"Write",
"a",
"character",
"or",
"its",
"code",
"to",
"the",
"console",
"."
] | train | https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/JSONzip.java#L231-L237 |
TestFX/Monocle | src/main/java/com/sun/glass/ui/monocle/LinuxInput.java | LinuxInput.codeToString | static String codeToString(String type, short code) {
"""
Convert an event code to its equivalent string, given its type string.
The type string is needed because event codes are context sensitive. For
example, the code 1 is "SYN_CONFIG" for an EV_SYN event but "KEY_ESC" for
an EV_KEY event. This method is ine... | java | static String codeToString(String type, short code) {
int i = type.indexOf("_");
if (i >= 0) {
String prefix = type.substring(i + 1);
String altPrefix = prefix.equals("KEY") ? "BTN" : prefix;
for (Field field : LinuxInput.class.getDeclaredFields()) {
S... | [
"static",
"String",
"codeToString",
"(",
"String",
"type",
",",
"short",
"code",
")",
"{",
"int",
"i",
"=",
"type",
".",
"indexOf",
"(",
"\"_\"",
")",
";",
"if",
"(",
"i",
">=",
"0",
")",
"{",
"String",
"prefix",
"=",
"type",
".",
"substring",
"(",... | Convert an event code to its equivalent string, given its type string.
The type string is needed because event codes are context sensitive. For
example, the code 1 is "SYN_CONFIG" for an EV_SYN event but "KEY_ESC" for
an EV_KEY event. This method is inefficient and is for debugging use
only. | [
"Convert",
"an",
"event",
"code",
"to",
"its",
"equivalent",
"string",
"given",
"its",
"type",
"string",
".",
"The",
"type",
"string",
"is",
"needed",
"because",
"event",
"codes",
"are",
"context",
"sensitive",
".",
"For",
"example",
"the",
"code",
"1",
"i... | train | https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/LinuxInput.java#L759-L777 |
radkovo/jStyleParser | src/main/java/cz/vutbr/web/csskit/antlr4/CSSErrorStrategy.java | CSSErrorStrategy.consumeUntilGreedy | protected void consumeUntilGreedy(Parser recognizer, IntervalSet set, CSSLexerState.RecoveryMode mode) {
"""
Consumes token until lexer state is function-balanced and
token from follow is matched. Matched token is also consumed
"""
CSSToken t;
do {
Token next = recognizer.getInputS... | java | protected void consumeUntilGreedy(Parser recognizer, IntervalSet set, CSSLexerState.RecoveryMode mode) {
CSSToken t;
do {
Token next = recognizer.getInputStream().LT(1);
if (next instanceof CSSToken) {
t = (CSSToken) recognizer.getInputStream().LT(1);
... | [
"protected",
"void",
"consumeUntilGreedy",
"(",
"Parser",
"recognizer",
",",
"IntervalSet",
"set",
",",
"CSSLexerState",
".",
"RecoveryMode",
"mode",
")",
"{",
"CSSToken",
"t",
";",
"do",
"{",
"Token",
"next",
"=",
"recognizer",
".",
"getInputStream",
"(",
")"... | Consumes token until lexer state is function-balanced and
token from follow is matched. Matched token is also consumed | [
"Consumes",
"token",
"until",
"lexer",
"state",
"is",
"function",
"-",
"balanced",
"and",
"token",
"from",
"follow",
"is",
"matched",
".",
"Matched",
"token",
"is",
"also",
"consumed"
] | train | https://github.com/radkovo/jStyleParser/blob/8ab049ac6866aa52c4d7deee25c9e294e7191957/src/main/java/cz/vutbr/web/csskit/antlr4/CSSErrorStrategy.java#L72-L89 |
headius/invokebinder | src/main/java/com/headius/invokebinder/Signature.java | Signature.prependArg | public Signature prependArg(String name, Class<?> type) {
"""
Prepend an argument (name + type) to the signature.
@param name the name of the argument
@param type the type of the argument
@return a new signature with the added arguments
"""
String[] newArgNames = new String[argNames.length + 1];
... | java | public Signature prependArg(String name, Class<?> type) {
String[] newArgNames = new String[argNames.length + 1];
System.arraycopy(argNames, 0, newArgNames, 1, argNames.length);
newArgNames[0] = name;
MethodType newMethodType = methodType.insertParameterTypes(0, type);
return new... | [
"public",
"Signature",
"prependArg",
"(",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"String",
"[",
"]",
"newArgNames",
"=",
"new",
"String",
"[",
"argNames",
".",
"length",
"+",
"1",
"]",
";",
"System",
".",
"arraycopy",
"(",
"... | Prepend an argument (name + type) to the signature.
@param name the name of the argument
@param type the type of the argument
@return a new signature with the added arguments | [
"Prepend",
"an",
"argument",
"(",
"name",
"+",
"type",
")",
"to",
"the",
"signature",
"."
] | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Signature.java#L219-L225 |
census-instrumentation/opencensus-java | api/src/main/java/io/opencensus/trace/SpanId.java | SpanId.fromBytes | public static SpanId fromBytes(byte[] src, int srcOffset) {
"""
Returns a {@code SpanId} whose representation is copied from the {@code src} beginning at the
{@code srcOffset} offset.
@param src the buffer where the representation of the {@code SpanId} is copied.
@param srcOffset the offset in the buffer wher... | java | public static SpanId fromBytes(byte[] src, int srcOffset) {
Utils.checkNotNull(src, "src");
return new SpanId(BigendianEncoding.longFromByteArray(src, srcOffset));
} | [
"public",
"static",
"SpanId",
"fromBytes",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"srcOffset",
")",
"{",
"Utils",
".",
"checkNotNull",
"(",
"src",
",",
"\"src\"",
")",
";",
"return",
"new",
"SpanId",
"(",
"BigendianEncoding",
".",
"longFromByteArray",
"... | Returns a {@code SpanId} whose representation is copied from the {@code src} beginning at the
{@code srcOffset} offset.
@param src the buffer where the representation of the {@code SpanId} is copied.
@param srcOffset the offset in the buffer where the representation of the {@code SpanId}
begins.
@return a {@code SpanI... | [
"Returns",
"a",
"{",
"@code",
"SpanId",
"}",
"whose",
"representation",
"is",
"copied",
"from",
"the",
"{",
"@code",
"src",
"}",
"beginning",
"at",
"the",
"{",
"@code",
"srcOffset",
"}",
"offset",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/api/src/main/java/io/opencensus/trace/SpanId.java#L85-L88 |
kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-remote/kie-server-client/src/main/java/org/kie/server/client/KieServicesFactory.java | KieServicesFactory.newJMSConfiguration | public static KieServicesConfiguration newJMSConfiguration( InitialContext context, String username, String password ) {
"""
Creates a new configuration object for JMS based service
@param context a context to look up for the JMS request and response queues
@param username user name
@param password user passwor... | java | public static KieServicesConfiguration newJMSConfiguration( InitialContext context, String username, String password ) {
return new KieServicesConfigurationImpl( context, username, password );
} | [
"public",
"static",
"KieServicesConfiguration",
"newJMSConfiguration",
"(",
"InitialContext",
"context",
",",
"String",
"username",
",",
"String",
"password",
")",
"{",
"return",
"new",
"KieServicesConfigurationImpl",
"(",
"context",
",",
"username",
",",
"password",
... | Creates a new configuration object for JMS based service
@param context a context to look up for the JMS request and response queues
@param username user name
@param password user password
@return configuration instance | [
"Creates",
"a",
"new",
"configuration",
"object",
"for",
"JMS",
"based",
"service"
] | train | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-remote/kie-server-client/src/main/java/org/kie/server/client/KieServicesFactory.java#L91-L93 |
VoltDB/voltdb | src/frontend/org/voltdb/importer/ImporterStatsCollector.java | ImporterStatsCollector.reportFailure | public void reportFailure(String importerName, String procName, boolean decrementPending) {
"""
Use this when the insert fails even before the request is queued by the InternalConnectionHandler
"""
StatsInfo statsInfo = getStatsInfo(importerName, procName);
if (decrementPending) {
s... | java | public void reportFailure(String importerName, String procName, boolean decrementPending) {
StatsInfo statsInfo = getStatsInfo(importerName, procName);
if (decrementPending) {
statsInfo.m_pendingCount.decrementAndGet();
}
statsInfo.m_failureCount.incrementAndGet();
} | [
"public",
"void",
"reportFailure",
"(",
"String",
"importerName",
",",
"String",
"procName",
",",
"boolean",
"decrementPending",
")",
"{",
"StatsInfo",
"statsInfo",
"=",
"getStatsInfo",
"(",
"importerName",
",",
"procName",
")",
";",
"if",
"(",
"decrementPending",... | Use this when the insert fails even before the request is queued by the InternalConnectionHandler | [
"Use",
"this",
"when",
"the",
"insert",
"fails",
"even",
"before",
"the",
"request",
"is",
"queued",
"by",
"the",
"InternalConnectionHandler"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/importer/ImporterStatsCollector.java#L85-L91 |
netheosgithub/pcs_api | java/src/main/java/net/netheos/pcsapi/providers/cloudme/CloudMe.java | CloudMe.rawCreateFolder | private CMFolder rawCreateFolder( CMFolder cmParentFolder, String name ) {
"""
Issue request to create a folder with given parent folder and name.
<p/>
No checks are performed before request.
@param cmParentFolder folder of the container
@param name base name of the folder to be created
@return the new Clou... | java | private CMFolder rawCreateFolder( CMFolder cmParentFolder, String name )
{
StringBuilder innerXml = new StringBuilder();
innerXml.append( "<folder id='" ).append( cmParentFolder.getId() ).append( "'/>" );
innerXml.append( "<childFolder>" ).append( XmlUtils.escape( name ) ).append( "</childFo... | [
"private",
"CMFolder",
"rawCreateFolder",
"(",
"CMFolder",
"cmParentFolder",
",",
"String",
"name",
")",
"{",
"StringBuilder",
"innerXml",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"innerXml",
".",
"append",
"(",
"\"<folder id='\"",
")",
".",
"append",
"(",
... | Issue request to create a folder with given parent folder and name.
<p/>
No checks are performed before request.
@param cmParentFolder folder of the container
@param name base name of the folder to be created
@return the new CloudMe folder | [
"Issue",
"request",
"to",
"create",
"a",
"folder",
"with",
"given",
"parent",
"folder",
"and",
"name",
".",
"<p",
"/",
">",
"No",
"checks",
"are",
"performed",
"before",
"request",
"."
] | train | https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/providers/cloudme/CloudMe.java#L476-L489 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF4.java | CommonOps_DDF4.elementDiv | public static void elementDiv( DMatrix4 a , DMatrix4 b) {
"""
<p>Performs an element by element division operation:<br>
<br>
a<sub>i</sub> = a<sub>i</sub> / b<sub>i</sub> <br>
</p>
@param a The left vector in the division operation. Modified.
@param b The right vector in the division operation. Not modified.
... | java | public static void elementDiv( DMatrix4 a , DMatrix4 b) {
a.a1 /= b.a1;
a.a2 /= b.a2;
a.a3 /= b.a3;
a.a4 /= b.a4;
} | [
"public",
"static",
"void",
"elementDiv",
"(",
"DMatrix4",
"a",
",",
"DMatrix4",
"b",
")",
"{",
"a",
".",
"a1",
"/=",
"b",
".",
"a1",
";",
"a",
".",
"a2",
"/=",
"b",
".",
"a2",
";",
"a",
".",
"a3",
"/=",
"b",
".",
"a3",
";",
"a",
".",
"a4",... | <p>Performs an element by element division operation:<br>
<br>
a<sub>i</sub> = a<sub>i</sub> / b<sub>i</sub> <br>
</p>
@param a The left vector in the division operation. Modified.
@param b The right vector in the division operation. Not modified. | [
"<p",
">",
"Performs",
"an",
"element",
"by",
"element",
"division",
"operation",
":",
"<br",
">",
"<br",
">",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"=",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"/",
"b<sub",
">",
"i<",
"/",
"sub",
">",
"<br",
">",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF4.java#L1369-L1374 |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java | MercatorProjection.latitudeToTileY | public static int latitudeToTileY(double latitude, byte zoomLevel) {
"""
Converts a latitude coordinate (in degrees) to a tile Y number at a certain zoom level.
@param latitude the latitude coordinate that should be converted.
@param zoomLevel the zoom level at which the coordinate should be converted.
@retu... | java | public static int latitudeToTileY(double latitude, byte zoomLevel) {
return pixelYToTileY(latitudeToPixelY(latitude, zoomLevel, DUMMY_TILE_SIZE), zoomLevel, DUMMY_TILE_SIZE);
} | [
"public",
"static",
"int",
"latitudeToTileY",
"(",
"double",
"latitude",
",",
"byte",
"zoomLevel",
")",
"{",
"return",
"pixelYToTileY",
"(",
"latitudeToPixelY",
"(",
"latitude",
",",
"zoomLevel",
",",
"DUMMY_TILE_SIZE",
")",
",",
"zoomLevel",
",",
"DUMMY_TILE_SIZE... | Converts a latitude coordinate (in degrees) to a tile Y number at a certain zoom level.
@param latitude the latitude coordinate that should be converted.
@param zoomLevel the zoom level at which the coordinate should be converted.
@return the tile Y number of the latitude value. | [
"Converts",
"a",
"latitude",
"coordinate",
"(",
"in",
"degrees",
")",
"to",
"a",
"tile",
"Y",
"number",
"at",
"a",
"certain",
"zoom",
"level",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java#L242-L244 |
olavloite/spanner-jdbc | src/main/java/nl/topicus/jdbc/CloudSpannerConnectionPoolDataSource.java | CloudSpannerConnectionPoolDataSource.getPooledConnection | @Override
public CloudSpannerPooledConnection getPooledConnection(String user, String password)
throws SQLException {
"""
Gets a connection which may be pooled by the app server or middleware implementation of
DataSource.
@throws java.sql.SQLException Occurs when the physical database connection cann... | java | @Override
public CloudSpannerPooledConnection getPooledConnection(String user, String password)
throws SQLException {
return new CloudSpannerPooledConnection(getConnection(user, password), defaultAutoCommit);
} | [
"@",
"Override",
"public",
"CloudSpannerPooledConnection",
"getPooledConnection",
"(",
"String",
"user",
",",
"String",
"password",
")",
"throws",
"SQLException",
"{",
"return",
"new",
"CloudSpannerPooledConnection",
"(",
"getConnection",
"(",
"user",
",",
"password",
... | Gets a connection which may be pooled by the app server or middleware implementation of
DataSource.
@throws java.sql.SQLException Occurs when the physical database connection cannot be
established. | [
"Gets",
"a",
"connection",
"which",
"may",
"be",
"pooled",
"by",
"the",
"app",
"server",
"or",
"middleware",
"implementation",
"of",
"DataSource",
"."
] | train | https://github.com/olavloite/spanner-jdbc/blob/b65a5185300580b143866e57501a1ea606b59aa5/src/main/java/nl/topicus/jdbc/CloudSpannerConnectionPoolDataSource.java#L65-L69 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.