repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 188 | func_name stringlengths 7 127 | whole_func_string stringlengths 77 3.91k | language stringclasses 1
value | func_code_string stringlengths 77 3.91k | func_code_tokens listlengths 20 745 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 477 | split_name stringclasses 1
value | func_code_url stringlengths 111 288 |
|---|---|---|---|---|---|---|---|---|---|---|
headius/invokebinder | src/main/java/com/headius/invokebinder/Signature.java | Signature.argName | public Signature argName(int index, String name) {
String[] argNames = Arrays.copyOf(argNames(), argNames().length);
argNames[index] = name;
return new Signature(type(), argNames);
} | java | public Signature argName(int index, String name) {
String[] argNames = Arrays.copyOf(argNames(), argNames().length);
argNames[index] = name;
return new Signature(type(), argNames);
} | [
"public",
"Signature",
"argName",
"(",
"int",
"index",
",",
"String",
"name",
")",
"{",
"String",
"[",
"]",
"argNames",
"=",
"Arrays",
".",
"copyOf",
"(",
"argNames",
"(",
")",
",",
"argNames",
"(",
")",
".",
"length",
")",
";",
"argNames",
"[",
"ind... | Set the argument name at the given index.
@param index the index at which to set the argument name
@param name the name to set
@return a new signature with the given name at the given index | [
"Set",
"the",
"argument",
"name",
"at",
"the",
"given",
"index",
"."
] | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Signature.java#L612-L616 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/ModelSerializer.java | ModelSerializer.restoreComputationGraph | public static ComputationGraph restoreComputationGraph(@NonNull InputStream is, boolean loadUpdater)
throws IOException {
checkInputStream(is);
File tmpFile = null;
try{
tmpFile = tempFileFromStream(is);
return restoreComputationGraph(tmpFile, loadUpdater);
... | java | public static ComputationGraph restoreComputationGraph(@NonNull InputStream is, boolean loadUpdater)
throws IOException {
checkInputStream(is);
File tmpFile = null;
try{
tmpFile = tempFileFromStream(is);
return restoreComputationGraph(tmpFile, loadUpdater);
... | [
"public",
"static",
"ComputationGraph",
"restoreComputationGraph",
"(",
"@",
"NonNull",
"InputStream",
"is",
",",
"boolean",
"loadUpdater",
")",
"throws",
"IOException",
"{",
"checkInputStream",
"(",
"is",
")",
";",
"File",
"tmpFile",
"=",
"null",
";",
"try",
"{... | Load a computation graph from a InputStream
@param is the inputstream to get the computation graph from
@return the loaded computation graph
@throws IOException | [
"Load",
"a",
"computation",
"graph",
"from",
"a",
"InputStream",
"@param",
"is",
"the",
"inputstream",
"to",
"get",
"the",
"computation",
"graph",
"from",
"@return",
"the",
"loaded",
"computation",
"graph"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/ModelSerializer.java#L464-L477 |
Waikato/moa | moa/src/main/java/moa/classifiers/meta/AccuracyWeightedEnsemble.java | AccuracyWeightedEnsemble.computeCandidateWeight | protected double computeCandidateWeight(Classifier candidate, Instances chunk, int numFolds) {
double candidateWeight = 0.0;
Random random = new Random(1);
Instances randData = new Instances(chunk);
randData.randomize(random);
if (randData.classAttribute().isNominal()) {
... | java | protected double computeCandidateWeight(Classifier candidate, Instances chunk, int numFolds) {
double candidateWeight = 0.0;
Random random = new Random(1);
Instances randData = new Instances(chunk);
randData.randomize(random);
if (randData.classAttribute().isNominal()) {
... | [
"protected",
"double",
"computeCandidateWeight",
"(",
"Classifier",
"candidate",
",",
"Instances",
"chunk",
",",
"int",
"numFolds",
")",
"{",
"double",
"candidateWeight",
"=",
"0.0",
";",
"Random",
"random",
"=",
"new",
"Random",
"(",
"1",
")",
";",
"Instances... | Computes the weight of a candidate classifier.
@param candidate Candidate classifier.
@param chunk Data chunk of examples.
@param numFolds Number of folds in candidate classifier cross-validation.
@param useMseR Determines whether to use the MSEr threshold.
@return Candidate classifier weight. | [
"Computes",
"the",
"weight",
"of",
"a",
"candidate",
"classifier",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/meta/AccuracyWeightedEnsemble.java#L247-L276 |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/util/Geometry.java | Geometry.getQuadrant | public static final Direction getQuadrant(final double cx, final double cy, final double x0, final double y0)
{
if ((x0 > cx) && (y0 < cy))
{
return Direction.NORTH_EAST;
}
if ((x0 > cx) && (y0 >= cy))
{
return Direction.SOUTH_EAST;
}
... | java | public static final Direction getQuadrant(final double cx, final double cy, final double x0, final double y0)
{
if ((x0 > cx) && (y0 < cy))
{
return Direction.NORTH_EAST;
}
if ((x0 > cx) && (y0 >= cy))
{
return Direction.SOUTH_EAST;
}
... | [
"public",
"static",
"final",
"Direction",
"getQuadrant",
"(",
"final",
"double",
"cx",
",",
"final",
"double",
"cy",
",",
"final",
"double",
"x0",
",",
"final",
"double",
"y0",
")",
"{",
"if",
"(",
"(",
"x0",
">",
"cx",
")",
"&&",
"(",
"y0",
"<",
"... | Returns the NESW quadrant the point is in. The delta from the center
NE x > 0, y < 0
SE x > 0, y >= 0
SW x <= 0, y >= 0
NW x <= 0, y < 0
@param cx
@param cy*
@param x0
@param y0
@return | [
"Returns",
"the",
"NESW",
"quadrant",
"the",
"point",
"is",
"in",
".",
"The",
"delta",
"from",
"the",
"center",
"NE",
"x",
">",
"0",
"y",
"<",
"0",
"SE",
"x",
">",
"0",
"y",
">",
"=",
"0",
"SW",
"x",
"<",
"=",
"0",
"y",
">",
"=",
"0",
"NW",... | train | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/util/Geometry.java#L1572-L1588 |
cryptomator/webdav-nio-adapter | src/main/java/org/cryptomator/frontend/webdav/WebDavServer.java | WebDavServer.createWebDavServlet | public WebDavServletController createWebDavServlet(Path rootPath, String contextPath) {
WebDavServletComponent servletComp = servletFactory.create(rootPath, contextPath);
return servletComp.servlet();
} | java | public WebDavServletController createWebDavServlet(Path rootPath, String contextPath) {
WebDavServletComponent servletComp = servletFactory.create(rootPath, contextPath);
return servletComp.servlet();
} | [
"public",
"WebDavServletController",
"createWebDavServlet",
"(",
"Path",
"rootPath",
",",
"String",
"contextPath",
")",
"{",
"WebDavServletComponent",
"servletComp",
"=",
"servletFactory",
".",
"create",
"(",
"rootPath",
",",
"contextPath",
")",
";",
"return",
"servle... | Creates a new WebDAV servlet (without starting it yet).
@param rootPath The path to the directory which should be served as root resource.
@param contextPath The servlet context path, i.e. the path of the root resource.
@return The controller object for this new servlet | [
"Creates",
"a",
"new",
"WebDAV",
"servlet",
"(",
"without",
"starting",
"it",
"yet",
")",
"."
] | train | https://github.com/cryptomator/webdav-nio-adapter/blob/55b0d7dccea9a4ede0a30a95583d8f04c8a86d18/src/main/java/org/cryptomator/frontend/webdav/WebDavServer.java#L137-L140 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/kg/AipKnowledgeGraphic.java | AipKnowledgeGraphic.createTask | public JSONObject createTask(String name, String templateContent, String inputMappingFile, String outputFile, String urlPattern, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("name", name);
request.addBo... | java | public JSONObject createTask(String name, String templateContent, String inputMappingFile, String outputFile, String urlPattern, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("name", name);
request.addBo... | [
"public",
"JSONObject",
"createTask",
"(",
"String",
"name",
",",
"String",
"templateContent",
",",
"String",
"inputMappingFile",
",",
"String",
"outputFile",
",",
"String",
"urlPattern",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
... | 创建任务接口
创建一个新的信息抽取任务
@param name - 任务名字
@param templateContent - json string 解析模板内容
@param inputMappingFile - 抓取结果映射文件的路径
@param outputFile - 输出文件名字
@param urlPattern - url pattern
@param options - 可选参数对象,key: value都为string类型
options - options列表:
limit_count 限制解析数量limit_count为0时进行全量任务,limit_count>0时只解析limit_count数量的... | [
"创建任务接口",
"创建一个新的信息抽取任务"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/kg/AipKnowledgeGraphic.java#L42-L61 |
threerings/nenya | core/src/main/java/com/threerings/resource/ResourceManager.java | ResourceManager.createFileResourceBundle | protected FileResourceBundle createFileResourceBundle (
File source, boolean delay, boolean unpack)
{
return new FileResourceBundle(source, delay, unpack);
} | java | protected FileResourceBundle createFileResourceBundle (
File source, boolean delay, boolean unpack)
{
return new FileResourceBundle(source, delay, unpack);
} | [
"protected",
"FileResourceBundle",
"createFileResourceBundle",
"(",
"File",
"source",
",",
"boolean",
"delay",
",",
"boolean",
"unpack",
")",
"{",
"return",
"new",
"FileResourceBundle",
"(",
"source",
",",
"delay",
",",
"unpack",
")",
";",
"}"
] | Creates an appropriate bundle for fetching resources from files. | [
"Creates",
"an",
"appropriate",
"bundle",
"for",
"fetching",
"resources",
"from",
"files",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/ResourceManager.java#L841-L845 |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/JsonPullParser.java | JsonPullParser.newParser | public static JsonPullParser newParser(InputStream is, Charset charset) {
if (is == null) {
throw new IllegalArgumentException("'is' must not be null.");
}
final Reader reader =
new InputStreamReader(is, (charset == null) ? DEFAULT_CHARSET : charset);
return newParser(reader);
} | java | public static JsonPullParser newParser(InputStream is, Charset charset) {
if (is == null) {
throw new IllegalArgumentException("'is' must not be null.");
}
final Reader reader =
new InputStreamReader(is, (charset == null) ? DEFAULT_CHARSET : charset);
return newParser(reader);
} | [
"public",
"static",
"JsonPullParser",
"newParser",
"(",
"InputStream",
"is",
",",
"Charset",
"charset",
")",
"{",
"if",
"(",
"is",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"'is' must not be null.\"",
")",
";",
"}",
"final",
"R... | Creates a new parser, using the given InputStream as its {@code JSON} feed.
<p>
Please call one of the {@code setSource(...)}'s before calling other methods.
</p>
@param is
An InputStream serves as {@code JSON} feed. Cannot be null.
@param charset
The character set should be assumed in which in the stream are encode... | [
"Creates",
"a",
"new",
"parser",
"using",
"the",
"given",
"InputStream",
"as",
"its",
"{",
"@code",
"JSON",
"}",
"feed",
"."
] | train | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/JsonPullParser.java#L203-L211 |
calrissian/mango | mango-json/src/main/java/org/calrissian/mango/json/mappings/JsonAttributeMappings.java | JsonAttributeMappings.toJsonString | public static String toJsonString(Collection<Attribute> attributeCollection, ObjectMapper objectMapper) throws JsonProcessingException {
return objectMapper.writeValueAsString(toObject(attributeCollection));
} | java | public static String toJsonString(Collection<Attribute> attributeCollection, ObjectMapper objectMapper) throws JsonProcessingException {
return objectMapper.writeValueAsString(toObject(attributeCollection));
} | [
"public",
"static",
"String",
"toJsonString",
"(",
"Collection",
"<",
"Attribute",
">",
"attributeCollection",
",",
"ObjectMapper",
"objectMapper",
")",
"throws",
"JsonProcessingException",
"{",
"return",
"objectMapper",
".",
"writeValueAsString",
"(",
"toObject",
"(",
... | Re-expands a flattened json representation from a collection of attributes back into a raw
nested json string. | [
"Re",
"-",
"expands",
"a",
"flattened",
"json",
"representation",
"from",
"a",
"collection",
"of",
"attributes",
"back",
"into",
"a",
"raw",
"nested",
"json",
"string",
"."
] | train | https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-json/src/main/java/org/calrissian/mango/json/mappings/JsonAttributeMappings.java#L100-L102 |
vlingo/vlingo-actors | src/main/java/io/vlingo/actors/World.java | World.actorFor | public Protocols actorFor(final Class<?>[] protocols, final Class<? extends Actor> type, final Object...parameters) {
if (isTerminated()) {
throw new IllegalStateException("vlingo/actors: Stopped.");
}
return stage().actorFor(protocols, type, parameters);
} | java | public Protocols actorFor(final Class<?>[] protocols, final Class<? extends Actor> type, final Object...parameters) {
if (isTerminated()) {
throw new IllegalStateException("vlingo/actors: Stopped.");
}
return stage().actorFor(protocols, type, parameters);
} | [
"public",
"Protocols",
"actorFor",
"(",
"final",
"Class",
"<",
"?",
">",
"[",
"]",
"protocols",
",",
"final",
"Class",
"<",
"?",
"extends",
"Actor",
">",
"type",
",",
"final",
"Object",
"...",
"parameters",
")",
"{",
"if",
"(",
"isTerminated",
"(",
")"... | Answers a {@code Protocols} that provides one or more supported protocols for the
newly created {@code Actor} according to {@code definition}.
@param protocols the {@code Class<?>[]} array of protocols that the {@code Actor} supports
@param type the {@code Class<? extends Actor>} of the {@code Actor} to create
@param p... | [
"Answers",
"a",
"{"
] | train | https://github.com/vlingo/vlingo-actors/blob/c7d046fd139c0490cf0fd2588d7dc2f792f13493/src/main/java/io/vlingo/actors/World.java#L136-L142 |
dnsjava/dnsjava | org/xbill/DNS/ZoneTransferIn.java | ZoneTransferIn.newIXFR | public static ZoneTransferIn
newIXFR(Name zone, long serial, boolean fallback, String host, TSIG key)
throws UnknownHostException
{
return newIXFR(zone, serial, fallback, host, 0, key);
} | java | public static ZoneTransferIn
newIXFR(Name zone, long serial, boolean fallback, String host, TSIG key)
throws UnknownHostException
{
return newIXFR(zone, serial, fallback, host, 0, key);
} | [
"public",
"static",
"ZoneTransferIn",
"newIXFR",
"(",
"Name",
"zone",
",",
"long",
"serial",
",",
"boolean",
"fallback",
",",
"String",
"host",
",",
"TSIG",
"key",
")",
"throws",
"UnknownHostException",
"{",
"return",
"newIXFR",
"(",
"zone",
",",
"serial",
"... | Instantiates a ZoneTransferIn object to do an IXFR (incremental zone
transfer).
@param zone The zone to transfer.
@param serial The existing serial number.
@param fallback If true, fall back to AXFR if IXFR is not supported.
@param host The host from which to transfer the zone.
@param key The TSIG key used to authentic... | [
"Instantiates",
"a",
"ZoneTransferIn",
"object",
"to",
"do",
"an",
"IXFR",
"(",
"incremental",
"zone",
"transfer",
")",
"."
] | train | https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/ZoneTransferIn.java#L290-L295 |
paypal/SeLion | dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/XmlDataProviderImpl.java | XmlDataProviderImpl.getDataByKeys | @Override
public Object[][] getDataByKeys(String[] keys) {
logger.entering(Arrays.toString(keys));
if (null == resource.getCls()) {
resource.setCls(KeyValueMap.class);
}
Object[][] objectArray;
try {
JAXBContext context = JAXBContext.newInstance(resou... | java | @Override
public Object[][] getDataByKeys(String[] keys) {
logger.entering(Arrays.toString(keys));
if (null == resource.getCls()) {
resource.setCls(KeyValueMap.class);
}
Object[][] objectArray;
try {
JAXBContext context = JAXBContext.newInstance(resou... | [
"@",
"Override",
"public",
"Object",
"[",
"]",
"[",
"]",
"getDataByKeys",
"(",
"String",
"[",
"]",
"keys",
")",
"{",
"logger",
".",
"entering",
"(",
"Arrays",
".",
"toString",
"(",
"keys",
")",
")",
";",
"if",
"(",
"null",
"==",
"resource",
".",
"g... | Generates a two dimensional array for TestNG DataProvider from the XML data representing a map of name value
collection filtered by keys.
A name value item should use the node name 'item' and a specific child structure since the implementation depends
on {@link KeyValuePair} class. The structure of an item in collecti... | [
"Generates",
"a",
"two",
"dimensional",
"array",
"for",
"TestNG",
"DataProvider",
"from",
"the",
"XML",
"data",
"representing",
"a",
"map",
"of",
"name",
"value",
"collection",
"filtered",
"by",
"keys",
"."
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/XmlDataProviderImpl.java#L262-L285 |
JOML-CI/JOML | src/org/joml/Vector3f.java | Vector3f.set | public Vector3f set(int index, FloatBuffer buffer) {
MemUtil.INSTANCE.get(this, index, buffer);
return this;
} | java | public Vector3f set(int index, FloatBuffer buffer) {
MemUtil.INSTANCE.get(this, index, buffer);
return this;
} | [
"public",
"Vector3f",
"set",
"(",
"int",
"index",
",",
"FloatBuffer",
"buffer",
")",
"{",
"MemUtil",
".",
"INSTANCE",
".",
"get",
"(",
"this",
",",
"index",
",",
"buffer",
")",
";",
"return",
"this",
";",
"}"
] | Read this vector from the supplied {@link FloatBuffer} starting at the specified
absolute buffer position/index.
<p>
This method will not increment the position of the given FloatBuffer.
@param index
the absolute position into the FloatBuffer
@param buffer
values will be read in <code>x, y, z</code> order
@return this | [
"Read",
"this",
"vector",
"from",
"the",
"supplied",
"{",
"@link",
"FloatBuffer",
"}",
"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/Vector3f.java#L392-L395 |
zackpollard/JavaTelegramBot-API | core/src/main/java/pro/zackpollard/telegrambot/api/TelegramBot.java | TelegramBot.editMessageText | public Message editMessageText(String chatId, Long messageId, String text, ParseMode parseMode, boolean disableWebPagePreview, InlineReplyMarkup inlineReplyMarkup) {
if(chatId != null && messageId != null && text != null) {
JSONObject jsonResponse = this.editMessageText(chatId, messageId, null, te... | java | public Message editMessageText(String chatId, Long messageId, String text, ParseMode parseMode, boolean disableWebPagePreview, InlineReplyMarkup inlineReplyMarkup) {
if(chatId != null && messageId != null && text != null) {
JSONObject jsonResponse = this.editMessageText(chatId, messageId, null, te... | [
"public",
"Message",
"editMessageText",
"(",
"String",
"chatId",
",",
"Long",
"messageId",
",",
"String",
"text",
",",
"ParseMode",
"parseMode",
",",
"boolean",
"disableWebPagePreview",
",",
"InlineReplyMarkup",
"inlineReplyMarkup",
")",
"{",
"if",
"(",
"chatId",
... | This allows you to edit the text of a message you have already sent previously
@param chatId The chat ID of the chat containing the message you want to edit
@param messageId The message ID of the message you want to edit
@param text The new text you want to displ... | [
"This",
"allows",
"you",
"to",
"edit",
"the",
"text",
"of",
"a",
"message",
"you",
"have",
"already",
"sent",
"previously"
] | train | https://github.com/zackpollard/JavaTelegramBot-API/blob/9d100f351824042ca5fc0ea735d1fa376a13e81d/core/src/main/java/pro/zackpollard/telegrambot/api/TelegramBot.java#L685-L698 |
teatrove/teatrove | teaservlet/src/main/java/org/teatrove/teaservlet/util/cluster/ClusterManager.java | ClusterManager.launchAuto | public void launchAuto(boolean active) {
killAuto();
if (mSock != null) {
try {
mAuto = new AutomaticClusterManagementThread(this, mCluster
.getClusterName(),
... | java | public void launchAuto(boolean active) {
killAuto();
if (mSock != null) {
try {
mAuto = new AutomaticClusterManagementThread(this, mCluster
.getClusterName(),
... | [
"public",
"void",
"launchAuto",
"(",
"boolean",
"active",
")",
"{",
"killAuto",
"(",
")",
";",
"if",
"(",
"mSock",
"!=",
"null",
")",
"{",
"try",
"{",
"mAuto",
"=",
"new",
"AutomaticClusterManagementThread",
"(",
"this",
",",
"mCluster",
".",
"getClusterNa... | Allows the management thread to passively take part in the cluster
operations.
Other cluster members will not be made aware of this instance. | [
"Allows",
"the",
"management",
"thread",
"to",
"passively",
"take",
"part",
"in",
"the",
"cluster",
"operations",
".",
"Other",
"cluster",
"members",
"will",
"not",
"be",
"made",
"aware",
"of",
"this",
"instance",
"."
] | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaservlet/src/main/java/org/teatrove/teaservlet/util/cluster/ClusterManager.java#L440-L455 |
ops4j/org.ops4j.base | ops4j-base-lang/src/main/java/org/ops4j/lang/PreConditionException.java | PreConditionException.validateEqualTo | public static void validateEqualTo( long value, long condition, String identifier )
throws PreConditionException
{
if( value == condition )
{
return;
}
throw new PreConditionException( identifier + " was not equal to " + condition + ". Was: " + value );
} | java | public static void validateEqualTo( long value, long condition, String identifier )
throws PreConditionException
{
if( value == condition )
{
return;
}
throw new PreConditionException( identifier + " was not equal to " + condition + ". Was: " + value );
} | [
"public",
"static",
"void",
"validateEqualTo",
"(",
"long",
"value",
",",
"long",
"condition",
",",
"String",
"identifier",
")",
"throws",
"PreConditionException",
"{",
"if",
"(",
"value",
"==",
"condition",
")",
"{",
"return",
";",
"}",
"throw",
"new",
"Pre... | Validates that the value under test is a particular value.
<p/>
This method ensures that <code>value == condition</code>.
@param identifier The name of the object.
@param condition The condition value.
@param value The value to be tested.
@throws PreConditionException if the condition is not met. | [
"Validates",
"that",
"the",
"value",
"under",
"test",
"is",
"a",
"particular",
"value",
".",
"<p",
"/",
">",
"This",
"method",
"ensures",
"that",
"<code",
">",
"value",
"==",
"condition<",
"/",
"code",
">",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-lang/src/main/java/org/ops4j/lang/PreConditionException.java#L211-L219 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/utils/memory/MemoryUtil.java | MemoryUtil.getBytes | public static void getBytes(long address, byte[] buffer, int bufferOffset, int count)
{
if (buffer == null)
throw new NullPointerException();
else if (bufferOffset < 0 || count < 0 || count > buffer.length - bufferOffset)
throw new IndexOutOfBoundsException();
else if... | java | public static void getBytes(long address, byte[] buffer, int bufferOffset, int count)
{
if (buffer == null)
throw new NullPointerException();
else if (bufferOffset < 0 || count < 0 || count > buffer.length - bufferOffset)
throw new IndexOutOfBoundsException();
else if... | [
"public",
"static",
"void",
"getBytes",
"(",
"long",
"address",
",",
"byte",
"[",
"]",
"buffer",
",",
"int",
"bufferOffset",
",",
"int",
"count",
")",
"{",
"if",
"(",
"buffer",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"... | Transfers count bytes from Memory starting at memoryOffset to buffer starting at bufferOffset
@param address start offset in the memory
@param buffer the data buffer
@param bufferOffset start offset of the buffer
@param count number of bytes to transfer | [
"Transfers",
"count",
"bytes",
"from",
"Memory",
"starting",
"at",
"memoryOffset",
"to",
"buffer",
"starting",
"at",
"bufferOffset"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/memory/MemoryUtil.java#L296-L306 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.hosting_web_new_GET | public ArrayList<String> hosting_web_new_GET(OvhDnsZoneEnum dnsZone, String domain, OvhOrderableNameEnum module, net.minidev.ovh.api.hosting.web.OvhOfferEnum offer, Boolean waiveRetractationPeriod) throws IOException {
String qPath = "/order/hosting/web/new";
StringBuilder sb = path(qPath);
query(sb, "dnsZone", d... | java | public ArrayList<String> hosting_web_new_GET(OvhDnsZoneEnum dnsZone, String domain, OvhOrderableNameEnum module, net.minidev.ovh.api.hosting.web.OvhOfferEnum offer, Boolean waiveRetractationPeriod) throws IOException {
String qPath = "/order/hosting/web/new";
StringBuilder sb = path(qPath);
query(sb, "dnsZone", d... | [
"public",
"ArrayList",
"<",
"String",
">",
"hosting_web_new_GET",
"(",
"OvhDnsZoneEnum",
"dnsZone",
",",
"String",
"domain",
",",
"OvhOrderableNameEnum",
"module",
",",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"hosting",
".",
"web",
".",
"OvhOfferEn... | Get allowed durations for 'new' option
REST: GET /order/hosting/web/new
@param domain [required] Domain name which will be linked to this hosting account
@param module [required] Module installation ready to use
@param dnsZone [required] Dns zone modification possibilities ( by default : RESET_ALL )
@param offer [requ... | [
"Get",
"allowed",
"durations",
"for",
"new",
"option"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L4755-L4765 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java | Error.parametersUsageNotAllowed | public static void parametersUsageNotAllowed(String methodName, String className){
throw new DynamicConversionParameterException(MSG.INSTANCE.message(dynamicConversionParameterException,methodName,className));
} | java | public static void parametersUsageNotAllowed(String methodName, String className){
throw new DynamicConversionParameterException(MSG.INSTANCE.message(dynamicConversionParameterException,methodName,className));
} | [
"public",
"static",
"void",
"parametersUsageNotAllowed",
"(",
"String",
"methodName",
",",
"String",
"className",
")",
"{",
"throw",
"new",
"DynamicConversionParameterException",
"(",
"MSG",
".",
"INSTANCE",
".",
"message",
"(",
"dynamicConversionParameterException",
",... | Thrown when the parameters number is incorrect.
@param methodName method name
@param className class name | [
"Thrown",
"when",
"the",
"parameters",
"number",
"is",
"incorrect",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java#L214-L216 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/memoize/StampedCommonCache.java | StampedCommonCache.doWithReadLock | private <R> R doWithReadLock(Action<K, V, R> action) {
long stamp = sl.tryOptimisticRead();
R result = action.doWith(commonCache);
if (!sl.validate(stamp)) {
stamp = sl.readLock();
try {
result = action.doWith(commonCache);
} finally {
... | java | private <R> R doWithReadLock(Action<K, V, R> action) {
long stamp = sl.tryOptimisticRead();
R result = action.doWith(commonCache);
if (!sl.validate(stamp)) {
stamp = sl.readLock();
try {
result = action.doWith(commonCache);
} finally {
... | [
"private",
"<",
"R",
">",
"R",
"doWithReadLock",
"(",
"Action",
"<",
"K",
",",
"V",
",",
"R",
">",
"action",
")",
"{",
"long",
"stamp",
"=",
"sl",
".",
"tryOptimisticRead",
"(",
")",
";",
"R",
"result",
"=",
"action",
".",
"doWith",
"(",
"commonCac... | deal with the backed cache guarded by read lock
@param action the content to complete | [
"deal",
"with",
"the",
"backed",
"cache",
"guarded",
"by",
"read",
"lock"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/memoize/StampedCommonCache.java#L282-L296 |
wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/format/MediaFormat.java | MediaFormat.getMinDimension | public Dimension getMinDimension() {
long effWithMin = getEffectiveMinWidth();
long effHeightMin = getEffectiveMinHeight();
double effRatio = getRatio();
if (effWithMin == 0 && effHeightMin > 0 && effRatio > 0) {
effWithMin = Math.round(effHeightMin * effRatio);
}
if (effWithMin > 0 && ef... | java | public Dimension getMinDimension() {
long effWithMin = getEffectiveMinWidth();
long effHeightMin = getEffectiveMinHeight();
double effRatio = getRatio();
if (effWithMin == 0 && effHeightMin > 0 && effRatio > 0) {
effWithMin = Math.round(effHeightMin * effRatio);
}
if (effWithMin > 0 && ef... | [
"public",
"Dimension",
"getMinDimension",
"(",
")",
"{",
"long",
"effWithMin",
"=",
"getEffectiveMinWidth",
"(",
")",
";",
"long",
"effHeightMin",
"=",
"getEffectiveMinHeight",
"(",
")",
";",
"double",
"effRatio",
"=",
"getRatio",
"(",
")",
";",
"if",
"(",
"... | Get minimum dimensions for media format. If only with or height is defined the missing dimensions
is calculated from the ratio. If no ratio defined either only width or height dimension is returned.
If neither width or height are defined null is returned.
@return Min. dimensions or null | [
"Get",
"minimum",
"dimensions",
"for",
"media",
"format",
".",
"If",
"only",
"with",
"or",
"height",
"is",
"defined",
"the",
"missing",
"dimensions",
"is",
"calculated",
"from",
"the",
"ratio",
".",
"If",
"no",
"ratio",
"defined",
"either",
"only",
"width",
... | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/format/MediaFormat.java#L432-L450 |
mbenson/therian | core/src/main/java/therian/util/Positions.java | Positions.readOnly | public static <T> Position.Readable<T> readOnly(final Typed<T> typed, final Supplier<T> supplier) {
return readOnly(Validate.notNull(typed, "type").getType(), supplier);
} | java | public static <T> Position.Readable<T> readOnly(final Typed<T> typed, final Supplier<T> supplier) {
return readOnly(Validate.notNull(typed, "type").getType(), supplier);
} | [
"public",
"static",
"<",
"T",
">",
"Position",
".",
"Readable",
"<",
"T",
">",
"readOnly",
"(",
"final",
"Typed",
"<",
"T",
">",
"typed",
",",
"final",
"Supplier",
"<",
"T",
">",
"supplier",
")",
"{",
"return",
"readOnly",
"(",
"Validate",
".",
"notN... | Get a read-only position of type {@code typed.type}, obtaining its value from {@code supplier}.
@param typed not {@code null}
@param supplier not {@code null}
@return Position.Readable | [
"Get",
"a",
"read",
"-",
"only",
"position",
"of",
"type",
"{",
"@code",
"typed",
".",
"type",
"}",
"obtaining",
"its",
"value",
"from",
"{",
"@code",
"supplier",
"}",
"."
] | train | https://github.com/mbenson/therian/blob/0653505f73e2a6f5b0abc394ea6d83af03408254/core/src/main/java/therian/util/Positions.java#L223-L225 |
pressgang-ccms/PressGangCCMSContentSpecProcessor | src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java | ContentSpecParser.getTitle | protected String getTitle(final String input, final char startDelim) {
if (isStringNullOrEmpty(input)) {
return null;
} else {
return ProcessorUtilities.cleanXMLCharacterReferences(StringUtilities.split(input, startDelim)[0].trim());
}
} | java | protected String getTitle(final String input, final char startDelim) {
if (isStringNullOrEmpty(input)) {
return null;
} else {
return ProcessorUtilities.cleanXMLCharacterReferences(StringUtilities.split(input, startDelim)[0].trim());
}
} | [
"protected",
"String",
"getTitle",
"(",
"final",
"String",
"input",
",",
"final",
"char",
"startDelim",
")",
"{",
"if",
"(",
"isStringNullOrEmpty",
"(",
"input",
")",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"return",
"ProcessorUtilities",
".",
"... | Gets the title of a chapter/section/appendix/topic by returning everything before the start delimiter.
@param input The input to be parsed to get the title.
@param startDelim The delimiter that specifies that start of options (ie '[')
@return The title as a String or null if the title is blank. | [
"Gets",
"the",
"title",
"of",
"a",
"chapter",
"/",
"section",
"/",
"appendix",
"/",
"topic",
"by",
"returning",
"everything",
"before",
"the",
"start",
"delimiter",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpecProcessor/blob/85ffac047c4ede0f972364ab1f03f7d61a4de5f1/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java#L1784-L1790 |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/KeyrefModule.java | KeyrefModule.processFile | private void processFile(final ResolveTask r) {
final List<XMLFilter> filters = new ArrayList<>();
final ConkeyrefFilter conkeyrefFilter = new ConkeyrefFilter();
conkeyrefFilter.setLogger(logger);
conkeyrefFilter.setJob(job);
conkeyrefFilter.setKeyDefinitions(r.scope);
c... | java | private void processFile(final ResolveTask r) {
final List<XMLFilter> filters = new ArrayList<>();
final ConkeyrefFilter conkeyrefFilter = new ConkeyrefFilter();
conkeyrefFilter.setLogger(logger);
conkeyrefFilter.setJob(job);
conkeyrefFilter.setKeyDefinitions(r.scope);
c... | [
"private",
"void",
"processFile",
"(",
"final",
"ResolveTask",
"r",
")",
"{",
"final",
"List",
"<",
"XMLFilter",
">",
"filters",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"final",
"ConkeyrefFilter",
"conkeyrefFilter",
"=",
"new",
"ConkeyrefFilter",
"(",
... | Process key references in a topic. Topic is stored with a new name if it's
been processed before. | [
"Process",
"key",
"references",
"in",
"a",
"topic",
".",
"Topic",
"is",
"stored",
"with",
"a",
"new",
"name",
"if",
"it",
"s",
"been",
"processed",
"before",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/KeyrefModule.java#L340-L377 |
Jasig/uPortal | uPortal-portlets/src/main/java/org/apereo/portal/portlets/portletadmin/PortletAdministrationHelper.java | PortletAdministrationHelper.addPrincipalPermissionsToForm | private void addPrincipalPermissionsToForm(IPortletDefinition def, PortletDefinitionForm form) {
final String portletTargetId = PermissionHelper.permissionTargetIdForPortletDefinition(def);
final Set<JsonEntityBean> principalBeans = new HashSet<>();
Map<String, IPermissionManager> permManagers ... | java | private void addPrincipalPermissionsToForm(IPortletDefinition def, PortletDefinitionForm form) {
final String portletTargetId = PermissionHelper.permissionTargetIdForPortletDefinition(def);
final Set<JsonEntityBean> principalBeans = new HashSet<>();
Map<String, IPermissionManager> permManagers ... | [
"private",
"void",
"addPrincipalPermissionsToForm",
"(",
"IPortletDefinition",
"def",
",",
"PortletDefinitionForm",
"form",
")",
"{",
"final",
"String",
"portletTargetId",
"=",
"PermissionHelper",
".",
"permissionTargetIdForPortletDefinition",
"(",
"def",
")",
";",
"final... | /*
Add to the form SUBSCRIBE, BROWSE, and CONFIGURE activity permissions, along with their principals,
assigned to the portlet. | [
"/",
"*",
"Add",
"to",
"the",
"form",
"SUBSCRIBE",
"BROWSE",
"and",
"CONFIGURE",
"activity",
"permissions",
"along",
"with",
"their",
"principals",
"assigned",
"to",
"the",
"portlet",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/portletadmin/PortletAdministrationHelper.java#L222-L261 |
tzaeschke/zoodb | src/org/zoodb/internal/server/index/AbstractPagedIndex.java | AbstractPagedIndex.writeToPreallocated | final int writeToPreallocated(StorageChannelOutput out, Map<AbstractIndexPage, Integer> map) {
return getRoot().writeToPreallocated(out, map);
} | java | final int writeToPreallocated(StorageChannelOutput out, Map<AbstractIndexPage, Integer> map) {
return getRoot().writeToPreallocated(out, map);
} | [
"final",
"int",
"writeToPreallocated",
"(",
"StorageChannelOutput",
"out",
",",
"Map",
"<",
"AbstractIndexPage",
",",
"Integer",
">",
"map",
")",
"{",
"return",
"getRoot",
"(",
")",
".",
"writeToPreallocated",
"(",
"out",
",",
"map",
")",
";",
"}"
] | Special write method that uses only pre-allocated pages.
@param map
@return the root page Id. | [
"Special",
"write",
"method",
"that",
"uses",
"only",
"pre",
"-",
"allocated",
"pages",
"."
] | train | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/server/index/AbstractPagedIndex.java#L154-L156 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/webmonitor/WebMonitorUtils.java | WebMonitorUtils.validateAndNormalizeUri | public static Path validateAndNormalizeUri(URI archiveDirUri) {
final String scheme = archiveDirUri.getScheme();
final String path = archiveDirUri.getPath();
// some validity checks
if (scheme == null) {
throw new IllegalArgumentException("The scheme (hdfs://, file://, etc) is null. " +
"Please specify ... | java | public static Path validateAndNormalizeUri(URI archiveDirUri) {
final String scheme = archiveDirUri.getScheme();
final String path = archiveDirUri.getPath();
// some validity checks
if (scheme == null) {
throw new IllegalArgumentException("The scheme (hdfs://, file://, etc) is null. " +
"Please specify ... | [
"public",
"static",
"Path",
"validateAndNormalizeUri",
"(",
"URI",
"archiveDirUri",
")",
"{",
"final",
"String",
"scheme",
"=",
"archiveDirUri",
".",
"getScheme",
"(",
")",
";",
"final",
"String",
"path",
"=",
"archiveDirUri",
".",
"getPath",
"(",
")",
";",
... | Checks and normalizes the given URI. This method first checks the validity of the
URI (scheme and path are not null) and then normalizes the URI to a path.
@param archiveDirUri The URI to check and normalize.
@return A normalized URI as a Path.
@throws IllegalArgumentException Thrown, if the URI misses scheme or path... | [
"Checks",
"and",
"normalizes",
"the",
"given",
"URI",
".",
"This",
"method",
"first",
"checks",
"the",
"validity",
"of",
"the",
"URI",
"(",
"scheme",
"and",
"path",
"are",
"not",
"null",
")",
"and",
"then",
"normalizes",
"the",
"URI",
"to",
"a",
"path",
... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/webmonitor/WebMonitorUtils.java#L263-L278 |
hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/CompressionUtil.java | CompressionUtil.extractFileGzip | public static File extractFileGzip(String _compressedFile, String _outputFileName) {
return decompress(CompressionMethod.GZIP, _compressedFile, _outputFileName);
} | java | public static File extractFileGzip(String _compressedFile, String _outputFileName) {
return decompress(CompressionMethod.GZIP, _compressedFile, _outputFileName);
} | [
"public",
"static",
"File",
"extractFileGzip",
"(",
"String",
"_compressedFile",
",",
"String",
"_outputFileName",
")",
"{",
"return",
"decompress",
"(",
"CompressionMethod",
".",
"GZIP",
",",
"_compressedFile",
",",
"_outputFileName",
")",
";",
"}"
] | Extracts a GZIP compressed file to the given outputfile.
@param _compressedFile
@param _outputFileName
@return file-object with outputfile or null on any error. | [
"Extracts",
"a",
"GZIP",
"compressed",
"file",
"to",
"the",
"given",
"outputfile",
"."
] | train | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/CompressionUtil.java#L42-L44 |
googleapis/cloud-bigtable-client | bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/config/BigtableVeneerSettingsFactory.java | BigtableVeneerSettingsFactory.buildMutateRowSettings | private static void buildMutateRowSettings(Builder builder, BigtableOptions options) {
RetrySettings retrySettings =
buildIdempotentRetrySettings(builder.mutateRowSettings().getRetrySettings(), options);
builder.mutateRowSettings()
.setRetrySettings(retrySettings)
.setRetryableCodes(bui... | java | private static void buildMutateRowSettings(Builder builder, BigtableOptions options) {
RetrySettings retrySettings =
buildIdempotentRetrySettings(builder.mutateRowSettings().getRetrySettings(), options);
builder.mutateRowSettings()
.setRetrySettings(retrySettings)
.setRetryableCodes(bui... | [
"private",
"static",
"void",
"buildMutateRowSettings",
"(",
"Builder",
"builder",
",",
"BigtableOptions",
"options",
")",
"{",
"RetrySettings",
"retrySettings",
"=",
"buildIdempotentRetrySettings",
"(",
"builder",
".",
"mutateRowSettings",
"(",
")",
".",
"getRetrySettin... | To build BigtableDataSettings#mutateRowSettings with default Retry settings. | [
"To",
"build",
"BigtableDataSettings#mutateRowSettings",
"with",
"default",
"Retry",
"settings",
"."
] | train | https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/config/BigtableVeneerSettingsFactory.java#L214-L221 |
virgo47/javasimon | core/src/main/java/org/javasimon/utils/SimonUtils.java | SimonUtils.doWithStopwatch | public static void doWithStopwatch(String name, Runnable runnable) {
try (Split split = SimonManager.getStopwatch(name).start()) {
runnable.run();
}
} | java | public static void doWithStopwatch(String name, Runnable runnable) {
try (Split split = SimonManager.getStopwatch(name).start()) {
runnable.run();
}
} | [
"public",
"static",
"void",
"doWithStopwatch",
"(",
"String",
"name",
",",
"Runnable",
"runnable",
")",
"{",
"try",
"(",
"Split",
"split",
"=",
"SimonManager",
".",
"getStopwatch",
"(",
"name",
")",
".",
"start",
"(",
")",
")",
"{",
"runnable",
".",
"run... | Calls a block of code with stopwatch around, can not return any result or throw an exception
(use {@link #doWithStopwatch(String, java.util.concurrent.Callable)} instead).
@param name name of the Stopwatch
@param runnable wrapped block of code
@since 3.0 | [
"Calls",
"a",
"block",
"of",
"code",
"with",
"stopwatch",
"around",
"can",
"not",
"return",
"any",
"result",
"or",
"throw",
"an",
"exception",
"(",
"use",
"{",
"@link",
"#doWithStopwatch",
"(",
"String",
"java",
".",
"util",
".",
"concurrent",
".",
"Callab... | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/core/src/main/java/org/javasimon/utils/SimonUtils.java#L358-L362 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java | Hierarchy.findMethod | public static @CheckForNull
JavaClassAndMethod findMethod(JavaClass javaClass, String methodName, String methodSig) {
return findMethod(javaClass, methodName, methodSig, ANY_METHOD);
} | java | public static @CheckForNull
JavaClassAndMethod findMethod(JavaClass javaClass, String methodName, String methodSig) {
return findMethod(javaClass, methodName, methodSig, ANY_METHOD);
} | [
"public",
"static",
"@",
"CheckForNull",
"JavaClassAndMethod",
"findMethod",
"(",
"JavaClass",
"javaClass",
",",
"String",
"methodName",
",",
"String",
"methodSig",
")",
"{",
"return",
"findMethod",
"(",
"javaClass",
",",
"methodName",
",",
"methodSig",
",",
"ANY_... | Find a method in given class.
@param javaClass
the class
@param methodName
the name of the method
@param methodSig
the signature of the method
@return the JavaClassAndMethod, or null if no such method exists in the
class | [
"Find",
"a",
"method",
"in",
"given",
"class",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L427-L430 |
apereo/cas | support/cas-server-support-validation/src/main/java/org/apereo/cas/web/AbstractServiceValidateController.java | AbstractServiceValidateController.verifyRegisteredServiceProperties | private static void verifyRegisteredServiceProperties(final RegisteredService registeredService, final Service service) {
if (registeredService == null) {
val msg = String.format("Service [%s] is not found in service registry.", service.getId());
LOGGER.warn(msg);
throw new U... | java | private static void verifyRegisteredServiceProperties(final RegisteredService registeredService, final Service service) {
if (registeredService == null) {
val msg = String.format("Service [%s] is not found in service registry.", service.getId());
LOGGER.warn(msg);
throw new U... | [
"private",
"static",
"void",
"verifyRegisteredServiceProperties",
"(",
"final",
"RegisteredService",
"registeredService",
",",
"final",
"Service",
"service",
")",
"{",
"if",
"(",
"registeredService",
"==",
"null",
")",
"{",
"val",
"msg",
"=",
"String",
".",
"forma... | Ensure that the service is found and enabled in the service registry.
@param registeredService the located entry in the registry
@param service authenticating service
@throws UnauthorizedServiceException if service is determined to be unauthorized | [
"Ensure",
"that",
"the",
"service",
"is",
"found",
"and",
"enabled",
"in",
"the",
"service",
"registry",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-validation/src/main/java/org/apereo/cas/web/AbstractServiceValidateController.java#L67-L78 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java | Text.getName | public static String getName(String path, boolean ignoreTrailingSlash)
{
if (ignoreTrailingSlash && path.endsWith("/") && path.length() > 1)
{
path = path.substring(0, path.length() - 1);
}
return getName(path);
} | java | public static String getName(String path, boolean ignoreTrailingSlash)
{
if (ignoreTrailingSlash && path.endsWith("/") && path.length() > 1)
{
path = path.substring(0, path.length() - 1);
}
return getName(path);
} | [
"public",
"static",
"String",
"getName",
"(",
"String",
"path",
",",
"boolean",
"ignoreTrailingSlash",
")",
"{",
"if",
"(",
"ignoreTrailingSlash",
"&&",
"path",
".",
"endsWith",
"(",
"\"/\"",
")",
"&&",
"path",
".",
"length",
"(",
")",
">",
"1",
")",
"{"... | Same as {@link #getName(String)} but adding the possibility to pass paths that end with a
trailing '/'
@see #getName(String) | [
"Same",
"as",
"{",
"@link",
"#getName",
"(",
"String",
")",
"}",
"but",
"adding",
"the",
"possibility",
"to",
"pass",
"paths",
"that",
"end",
"with",
"a",
"trailing",
"/"
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java#L646-L653 |
albfernandez/itext2 | src/main/java/com/lowagie/text/rtf/headerfooter/RtfHeaderFooterGroup.java | RtfHeaderFooterGroup.setHeaderFooter | public void setHeaderFooter(RtfHeaderFooter headerFooter, int displayAt) {
this.mode = MODE_MULTIPLE;
headerFooter.setRtfDocument(this.document);
headerFooter.setType(this.type);
headerFooter.setDisplayAt(displayAt);
switch(displayAt) {
case RtfHeaderFooter.DISPLAY_AL... | java | public void setHeaderFooter(RtfHeaderFooter headerFooter, int displayAt) {
this.mode = MODE_MULTIPLE;
headerFooter.setRtfDocument(this.document);
headerFooter.setType(this.type);
headerFooter.setDisplayAt(displayAt);
switch(displayAt) {
case RtfHeaderFooter.DISPLAY_AL... | [
"public",
"void",
"setHeaderFooter",
"(",
"RtfHeaderFooter",
"headerFooter",
",",
"int",
"displayAt",
")",
"{",
"this",
".",
"mode",
"=",
"MODE_MULTIPLE",
";",
"headerFooter",
".",
"setRtfDocument",
"(",
"this",
".",
"document",
")",
";",
"headerFooter",
".",
... | Set a RtfHeaderFooter to be displayed at a certain position
@param headerFooter The RtfHeaderFooter to display
@param displayAt The display location to use | [
"Set",
"a",
"RtfHeaderFooter",
"to",
"be",
"displayed",
"at",
"a",
"certain",
"position"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/rtf/headerfooter/RtfHeaderFooterGroup.java#L247-L266 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/utils/DockerfileParser.java | DockerfileParser.dockerfileToCommandList | public static List<DockerCommand> dockerfileToCommandList( File dockerfile ) throws IOException {
List<DockerCommand> result = new ArrayList<>();
FileInputStream in = new FileInputStream( dockerfile );
Logger logger = Logger.getLogger( DockerfileParser.class.getName());
BufferedReader br = null;
try {
br... | java | public static List<DockerCommand> dockerfileToCommandList( File dockerfile ) throws IOException {
List<DockerCommand> result = new ArrayList<>();
FileInputStream in = new FileInputStream( dockerfile );
Logger logger = Logger.getLogger( DockerfileParser.class.getName());
BufferedReader br = null;
try {
br... | [
"public",
"static",
"List",
"<",
"DockerCommand",
">",
"dockerfileToCommandList",
"(",
"File",
"dockerfile",
")",
"throws",
"IOException",
"{",
"List",
"<",
"DockerCommand",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"FileInputStream",
"in",
... | Parses a dockerfile to a list of commands.
@throws IOException
@param dockerfile a file
@return a list of Docker commands | [
"Parses",
"a",
"dockerfile",
"to",
"a",
"list",
"of",
"commands",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/DockerfileParser.java#L59-L84 |
apache/flink | flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/api/environment/PythonStreamExecutionEnvironment.java | PythonStreamExecutionEnvironment.generate_sequence | public PythonDataStream generate_sequence(long from, long to) {
return new PythonDataStream<>(env.generateSequence(from, to).map(new AdapterMap<>()));
} | java | public PythonDataStream generate_sequence(long from, long to) {
return new PythonDataStream<>(env.generateSequence(from, to).map(new AdapterMap<>()));
} | [
"public",
"PythonDataStream",
"generate_sequence",
"(",
"long",
"from",
",",
"long",
"to",
")",
"{",
"return",
"new",
"PythonDataStream",
"<>",
"(",
"env",
".",
"generateSequence",
"(",
"from",
",",
"to",
")",
".",
"map",
"(",
"new",
"AdapterMap",
"<>",
"(... | A thin wrapper layer over {@link StreamExecutionEnvironment#generateSequence(long, long)}.
@param from The number to start at (inclusive)
@param to The number to stop at (inclusive)
@return A python data stream, containing all number in the [from, to] interval | [
"A",
"thin",
"wrapper",
"layer",
"over",
"{",
"@link",
"StreamExecutionEnvironment#generateSequence",
"(",
"long",
"long",
")",
"}",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/api/environment/PythonStreamExecutionEnvironment.java#L176-L178 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.order_orderId_paymentMeans_GET | public OvhPaymentMeans order_orderId_paymentMeans_GET(Long orderId) throws IOException {
String qPath = "/me/order/{orderId}/paymentMeans";
StringBuilder sb = path(qPath, orderId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhPaymentMeans.class);
} | java | public OvhPaymentMeans order_orderId_paymentMeans_GET(Long orderId) throws IOException {
String qPath = "/me/order/{orderId}/paymentMeans";
StringBuilder sb = path(qPath, orderId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhPaymentMeans.class);
} | [
"public",
"OvhPaymentMeans",
"order_orderId_paymentMeans_GET",
"(",
"Long",
"orderId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/order/{orderId}/paymentMeans\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"orderId",
")",
";",
... | Return main data about the object the processing of the order generated
REST: GET /me/order/{orderId}/paymentMeans
@param orderId [required] | [
"Return",
"main",
"data",
"about",
"the",
"object",
"the",
"processing",
"of",
"the",
"order",
"generated"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L1897-L1902 |
pf4j/pf4j | pf4j/src/main/java/org/pf4j/util/DirectedGraph.java | DirectedGraph.addEdge | public void addEdge(V from, V to) {
addVertex(from);
addVertex(to);
neighbors.get(from).add(to);
} | java | public void addEdge(V from, V to) {
addVertex(from);
addVertex(to);
neighbors.get(from).add(to);
} | [
"public",
"void",
"addEdge",
"(",
"V",
"from",
",",
"V",
"to",
")",
"{",
"addVertex",
"(",
"from",
")",
";",
"addVertex",
"(",
"to",
")",
";",
"neighbors",
".",
"get",
"(",
"from",
")",
".",
"add",
"(",
"to",
")",
";",
"}"
] | Add an edge to the graph; if either vertex does not exist, it's added.
This implementation allows the creation of multi-edges and self-loops. | [
"Add",
"an",
"edge",
"to",
"the",
"graph",
";",
"if",
"either",
"vertex",
"does",
"not",
"exist",
"it",
"s",
"added",
".",
"This",
"implementation",
"allows",
"the",
"creation",
"of",
"multi",
"-",
"edges",
"and",
"self",
"-",
"loops",
"."
] | train | https://github.com/pf4j/pf4j/blob/6dd7a6069f0e2fbd842c81e2c8c388918b88ea81/pf4j/src/main/java/org/pf4j/util/DirectedGraph.java#L65-L69 |
xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheSetUtil.java | CacheSetUtil.values | public static <T> Single<Set<T>> values(CacheConfigBean cacheConfigBean, String key, Class<T> vClazz) {
return values(cacheConfigBean, key)
.map(values -> {
Set<T> _values = new TreeSet<>();
if (values != null && !values.isEmpty()) {
... | java | public static <T> Single<Set<T>> values(CacheConfigBean cacheConfigBean, String key, Class<T> vClazz) {
return values(cacheConfigBean, key)
.map(values -> {
Set<T> _values = new TreeSet<>();
if (values != null && !values.isEmpty()) {
... | [
"public",
"static",
"<",
"T",
">",
"Single",
"<",
"Set",
"<",
"T",
">",
">",
"values",
"(",
"CacheConfigBean",
"cacheConfigBean",
",",
"String",
"key",
",",
"Class",
"<",
"T",
">",
"vClazz",
")",
"{",
"return",
"values",
"(",
"cacheConfigBean",
",",
"k... | retrial the cached set
@param cacheConfigBean the datasource configuration
@param key the key
@param vClazz the class for the element
@param <T> generic type of the set
@return the typed value set | [
"retrial",
"the",
"cached",
"set"
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheSetUtil.java#L157-L168 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDConnectionDaoImpl.java | GeneratedDConnectionDaoImpl.queryByProviderUserId | public Iterable<DConnection> queryByProviderUserId(java.lang.String providerUserId) {
return queryByField(null, DConnectionMapper.Field.PROVIDERUSERID.getFieldName(), providerUserId);
} | java | public Iterable<DConnection> queryByProviderUserId(java.lang.String providerUserId) {
return queryByField(null, DConnectionMapper.Field.PROVIDERUSERID.getFieldName(), providerUserId);
} | [
"public",
"Iterable",
"<",
"DConnection",
">",
"queryByProviderUserId",
"(",
"java",
".",
"lang",
".",
"String",
"providerUserId",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DConnectionMapper",
".",
"Field",
".",
"PROVIDERUSERID",
".",
"getFieldName",
... | query-by method for field providerUserId
@param providerUserId the specified attribute
@return an Iterable of DConnections for the specified providerUserId | [
"query",
"-",
"by",
"method",
"for",
"field",
"providerUserId"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDConnectionDaoImpl.java#L124-L126 |
alkacon/opencms-core | src/org/opencms/db/generic/CmsHistoryDriver.java | CmsHistoryDriver.internalCleanup | protected void internalCleanup(CmsDbContext dbc, I_CmsHistoryResource resource) throws CmsDataAccessException {
Connection conn = null;
PreparedStatement stmt = null;
ResultSet res = null;
Map<CmsUUID, Integer> tmpSubResources = new HashMap<CmsUUID, Integer>();
// if is folder ... | java | protected void internalCleanup(CmsDbContext dbc, I_CmsHistoryResource resource) throws CmsDataAccessException {
Connection conn = null;
PreparedStatement stmt = null;
ResultSet res = null;
Map<CmsUUID, Integer> tmpSubResources = new HashMap<CmsUUID, Integer>();
// if is folder ... | [
"protected",
"void",
"internalCleanup",
"(",
"CmsDbContext",
"dbc",
",",
"I_CmsHistoryResource",
"resource",
")",
"throws",
"CmsDataAccessException",
"{",
"Connection",
"conn",
"=",
"null",
";",
"PreparedStatement",
"stmt",
"=",
"null",
";",
"ResultSet",
"res",
"=",... | Deletes all historical entries of subresources of a folder without any historical netry left.<p>
@param dbc the current database context
@param resource the resource to check
@throws CmsDataAccessException if something goes wrong | [
"Deletes",
"all",
"historical",
"entries",
"of",
"subresources",
"of",
"a",
"folder",
"without",
"any",
"historical",
"netry",
"left",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/generic/CmsHistoryDriver.java#L1606-L1643 |
Twitter4J/Twitter4J | twitter4j-core/src/internal-json/java/twitter4j/JSONImplFactory.java | JSONImplFactory.createUserMentionEntity | public static UserMentionEntity createUserMentionEntity(int start, int end, String name, String screenName,
long id) {
return new UserMentionEntityJSONImpl(start, end, name, screenName, id);
} | java | public static UserMentionEntity createUserMentionEntity(int start, int end, String name, String screenName,
long id) {
return new UserMentionEntityJSONImpl(start, end, name, screenName, id);
} | [
"public",
"static",
"UserMentionEntity",
"createUserMentionEntity",
"(",
"int",
"start",
",",
"int",
"end",
",",
"String",
"name",
",",
"String",
"screenName",
",",
"long",
"id",
")",
"{",
"return",
"new",
"UserMentionEntityJSONImpl",
"(",
"start",
",",
"end",
... | static factory method for twitter-text-java
@return user mention entity
@since Twitter4J 2.2.6 | [
"static",
"factory",
"method",
"for",
"twitter",
"-",
"text",
"-",
"java"
] | train | https://github.com/Twitter4J/Twitter4J/blob/8376fade8d557896bb9319fb46e39a55b134b166/twitter4j-core/src/internal-json/java/twitter4j/JSONImplFactory.java#L284-L287 |
axibase/atsd-api-java | src/main/java/com/axibase/tsd/client/MetaDataService.java | MetaDataService.retrieveMetricSeries | public List<Series> retrieveMetricSeries(String metricName) {
return retrieveMetricSeries(metricName, Collections.<String, String>emptyMap());
} | java | public List<Series> retrieveMetricSeries(String metricName) {
return retrieveMetricSeries(metricName, Collections.<String, String>emptyMap());
} | [
"public",
"List",
"<",
"Series",
">",
"retrieveMetricSeries",
"(",
"String",
"metricName",
")",
"{",
"return",
"retrieveMetricSeries",
"(",
"metricName",
",",
"Collections",
".",
"<",
"String",
",",
"String",
">",
"emptyMap",
"(",
")",
")",
";",
"}"
] | Retrieve series list of the specified metric
@param metricName metric name
@return list of series | [
"Retrieve",
"series",
"list",
"of",
"the",
"specified",
"metric"
] | train | https://github.com/axibase/atsd-api-java/blob/63a0767d08b202dad2ebef4372ff947d6fba0246/src/main/java/com/axibase/tsd/client/MetaDataService.java#L585-L587 |
banq/jdonframework | src/main/java/com/jdon/util/UtilDateTime.java | UtilDateTime.toDate | public static java.util.Date toDate(String dateTime) {
// dateTime must have one space between the date and time...
String date = dateTime.substring(0, dateTime.indexOf(" "));
String time = dateTime.substring(dateTime.indexOf(" ") + 1);
return toDate(date, time);
} | java | public static java.util.Date toDate(String dateTime) {
// dateTime must have one space between the date and time...
String date = dateTime.substring(0, dateTime.indexOf(" "));
String time = dateTime.substring(dateTime.indexOf(" ") + 1);
return toDate(date, time);
} | [
"public",
"static",
"java",
".",
"util",
".",
"Date",
"toDate",
"(",
"String",
"dateTime",
")",
"{",
"// dateTime must have one space between the date and time...\r",
"String",
"date",
"=",
"dateTime",
".",
"substring",
"(",
"0",
",",
"dateTime",
".",
"indexOf",
"... | Converts a date and time String into a Date
@param dateTime
A combined data and time string in the format
"MM/DD/YYYY HH:MM:SS", the seconds are optional
@return The corresponding Date | [
"Converts",
"a",
"date",
"and",
"time",
"String",
"into",
"a",
"Date"
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/util/UtilDateTime.java#L303-L309 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/PolicyNodeImpl.java | PolicyNodeImpl.getPolicyNodesExpected | Set<PolicyNodeImpl> getPolicyNodesExpected(int depth,
String expectedOID, boolean matchAny) {
if (expectedOID.equals(ANY_POLICY)) {
return getPolicyNodes(depth);
} else {
return getPolicyNodesExpectedHelper(depth, expectedOID, matchAny);
}
} | java | Set<PolicyNodeImpl> getPolicyNodesExpected(int depth,
String expectedOID, boolean matchAny) {
if (expectedOID.equals(ANY_POLICY)) {
return getPolicyNodes(depth);
} else {
return getPolicyNodesExpectedHelper(depth, expectedOID, matchAny);
}
} | [
"Set",
"<",
"PolicyNodeImpl",
">",
"getPolicyNodesExpected",
"(",
"int",
"depth",
",",
"String",
"expectedOID",
",",
"boolean",
"matchAny",
")",
"{",
"if",
"(",
"expectedOID",
".",
"equals",
"(",
"ANY_POLICY",
")",
")",
"{",
"return",
"getPolicyNodes",
"(",
... | Finds all nodes at the specified depth whose expected_policy_set
contains the specified expected OID (if matchAny is false)
or the special OID "any value" (if matchAny is true).
@param depth an int representing the desired depth
@param expectedOID a String encoding the valid OID to match
@param matchAny a boolean indi... | [
"Finds",
"all",
"nodes",
"at",
"the",
"specified",
"depth",
"whose",
"expected_policy_set",
"contains",
"the",
"specified",
"expected",
"OID",
"(",
"if",
"matchAny",
"is",
"false",
")",
"or",
"the",
"special",
"OID",
"any",
"value",
"(",
"if",
"matchAny",
"i... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/PolicyNodeImpl.java#L334-L342 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/text/TextSimilarity.java | TextSimilarity.similar | public static String similar(String strA, String strB, int scale) {
return NumberUtil.formatPercent(similar(strA, strB), scale);
} | java | public static String similar(String strA, String strB, int scale) {
return NumberUtil.formatPercent(similar(strA, strB), scale);
} | [
"public",
"static",
"String",
"similar",
"(",
"String",
"strA",
",",
"String",
"strB",
",",
"int",
"scale",
")",
"{",
"return",
"NumberUtil",
".",
"formatPercent",
"(",
"similar",
"(",
"strA",
",",
"strB",
")",
",",
"scale",
")",
";",
"}"
] | 计算相似度百分比
@param strA 字符串1
@param strB 字符串2
@param scale 保留小数
@return 百分比 | [
"计算相似度百分比"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/text/TextSimilarity.java#L45-L47 |
languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/markup/AnnotatedTextBuilder.java | AnnotatedTextBuilder.addMarkup | public AnnotatedTextBuilder addMarkup(String markup, String interpretAs) {
parts.add(new TextPart(markup, TextPart.Type.MARKUP));
parts.add(new TextPart(interpretAs, TextPart.Type.FAKE_CONTENT));
return this;
} | java | public AnnotatedTextBuilder addMarkup(String markup, String interpretAs) {
parts.add(new TextPart(markup, TextPart.Type.MARKUP));
parts.add(new TextPart(interpretAs, TextPart.Type.FAKE_CONTENT));
return this;
} | [
"public",
"AnnotatedTextBuilder",
"addMarkup",
"(",
"String",
"markup",
",",
"String",
"interpretAs",
")",
"{",
"parts",
".",
"add",
"(",
"new",
"TextPart",
"(",
"markup",
",",
"TextPart",
".",
"Type",
".",
"MARKUP",
")",
")",
";",
"parts",
".",
"add",
"... | Add a markup text snippet like {@code <b attr='something'>} or {@code <div>}. These
parts will be ignored by LanguageTool when using {@link org.languagetool.JLanguageTool#check(AnnotatedText)}.
@param interpretAs A string that will be used by the checker instead of the markup. This is usually
whitespace, e.g. {@code \n... | [
"Add",
"a",
"markup",
"text",
"snippet",
"like",
"{"
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/markup/AnnotatedTextBuilder.java#L104-L108 |
lucasr/probe | library/src/main/java/org/lucasr/probe/ViewClassUtil.java | ViewClassUtil.findViewClass | static Class<?> findViewClass(Context context, String name)
throws ClassNotFoundException {
if (name.indexOf('.') >= 0) {
return loadViewClass(context, name);
}
for (String prefix : VIEW_CLASS_PREFIX_LIST) {
try {
return loadViewClass(context,... | java | static Class<?> findViewClass(Context context, String name)
throws ClassNotFoundException {
if (name.indexOf('.') >= 0) {
return loadViewClass(context, name);
}
for (String prefix : VIEW_CLASS_PREFIX_LIST) {
try {
return loadViewClass(context,... | [
"static",
"Class",
"<",
"?",
">",
"findViewClass",
"(",
"Context",
"context",
",",
"String",
"name",
")",
"throws",
"ClassNotFoundException",
"{",
"if",
"(",
"name",
".",
"indexOf",
"(",
"'",
"'",
")",
">=",
"0",
")",
"{",
"return",
"loadViewClass",
"(",... | Tries to load class using a predefined list of class prefixes for
Android views. | [
"Tries",
"to",
"load",
"class",
"using",
"a",
"predefined",
"list",
"of",
"class",
"prefixes",
"for",
"Android",
"views",
"."
] | train | https://github.com/lucasr/probe/blob/cd15cc04383a1bf85de2f4c345d2018415b9ddc9/library/src/main/java/org/lucasr/probe/ViewClassUtil.java#L63-L78 |
ops4j/org.ops4j.base | ops4j-base-io/src/main/java/org/ops4j/io/StreamUtils.java | StreamUtils.copyStreamToWriter | public static void copyStreamToWriter( InputStream in, Writer out, String encoding, boolean close )
throws IOException
{
InputStreamReader reader = new InputStreamReader( in, encoding );
copyReaderToWriter( reader, out, close );
} | java | public static void copyStreamToWriter( InputStream in, Writer out, String encoding, boolean close )
throws IOException
{
InputStreamReader reader = new InputStreamReader( in, encoding );
copyReaderToWriter( reader, out, close );
} | [
"public",
"static",
"void",
"copyStreamToWriter",
"(",
"InputStream",
"in",
",",
"Writer",
"out",
",",
"String",
"encoding",
",",
"boolean",
"close",
")",
"throws",
"IOException",
"{",
"InputStreamReader",
"reader",
"=",
"new",
"InputStreamReader",
"(",
"in",
",... | Copies an InputStream to a Writer.
@param in The input byte stream of data.
@param out The Writer to receive the streamed data as characters.
@param encoding The encoding used in the byte stream.
@param close true if the Reader and OutputStream should be closed after the completion.
@throws IOException ... | [
"Copies",
"an",
"InputStream",
"to",
"a",
"Writer",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/StreamUtils.java#L282-L287 |
liferay/com-liferay-commerce | commerce-account-service/src/main/java/com/liferay/commerce/account/service/persistence/impl/CommerceAccountPersistenceImpl.java | CommerceAccountPersistenceImpl.countByU_T | @Override
public int countByU_T(long userId, int type) {
FinderPath finderPath = FINDER_PATH_COUNT_BY_U_T;
Object[] finderArgs = new Object[] { userId, type };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
StringBundler query = new StringBundler(3);
quer... | java | @Override
public int countByU_T(long userId, int type) {
FinderPath finderPath = FINDER_PATH_COUNT_BY_U_T;
Object[] finderArgs = new Object[] { userId, type };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
StringBundler query = new StringBundler(3);
quer... | [
"@",
"Override",
"public",
"int",
"countByU_T",
"(",
"long",
"userId",
",",
"int",
"type",
")",
"{",
"FinderPath",
"finderPath",
"=",
"FINDER_PATH_COUNT_BY_U_T",
";",
"Object",
"[",
"]",
"finderArgs",
"=",
"new",
"Object",
"[",
"]",
"{",
"userId",
",",
"ty... | Returns the number of commerce accounts where userId = ? and type = ?.
@param userId the user ID
@param type the type
@return the number of matching commerce accounts | [
"Returns",
"the",
"number",
"of",
"commerce",
"accounts",
"where",
"userId",
"=",
"?",
";",
"and",
"type",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-account-service/src/main/java/com/liferay/commerce/account/service/persistence/impl/CommerceAccountPersistenceImpl.java#L1786-L1833 |
bwkimmel/jdcp | jdcp-core/src/main/java/ca/eandb/jdcp/remote/JobStatus.java | JobStatus.withIndeterminantProgress | public JobStatus withIndeterminantProgress() {
return new JobStatus(jobId, description, state, Double.NaN, status, eventId);
} | java | public JobStatus withIndeterminantProgress() {
return new JobStatus(jobId, description, state, Double.NaN, status, eventId);
} | [
"public",
"JobStatus",
"withIndeterminantProgress",
"(",
")",
"{",
"return",
"new",
"JobStatus",
"(",
"jobId",
",",
"description",
",",
"state",
",",
"Double",
".",
"NaN",
",",
"status",
",",
"eventId",
")",
";",
"}"
] | Creates a copy of this <code>JobStatus</code> with the progress set to
an indeterminant value (<code>Double.NaN</code>).
@return A copy of this <code>JobStatus</code> with the progress set to
indeterminant. | [
"Creates",
"a",
"copy",
"of",
"this",
"<code",
">",
"JobStatus<",
"/",
"code",
">",
"with",
"the",
"progress",
"set",
"to",
"an",
"indeterminant",
"value",
"(",
"<code",
">",
"Double",
".",
"NaN<",
"/",
"code",
">",
")",
"."
] | train | https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-core/src/main/java/ca/eandb/jdcp/remote/JobStatus.java#L163-L165 |
UrielCh/ovh-java-sdk | ovh-java-sdk-core/src/main/java/net/minidev/ovh/api/ApiOvhAuth.java | ApiOvhAuth.time_GET | public Long time_GET() throws IOException {
String qPath = "/auth/time";
StringBuilder sb = path(qPath);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo(resp, Long.class);
} | java | public Long time_GET() throws IOException {
String qPath = "/auth/time";
StringBuilder sb = path(qPath);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo(resp, Long.class);
} | [
"public",
"Long",
"time_GET",
"(",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/auth/time\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
"String",
"resp",
"=",
"execN",
"(",
"qPath",
",",
"\"GET\"",
",",
"sb",
".",... | Get the current time of the OVH servers, since UNIX epoch
REST: GET /auth/time | [
"Get",
"the",
"current",
"time",
"of",
"the",
"OVH",
"servers",
"since",
"UNIX",
"epoch"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-core/src/main/java/net/minidev/ovh/api/ApiOvhAuth.java#L48-L53 |
Azure/azure-sdk-for-java | datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ServicesInner.java | ServicesInner.getByResourceGroupAsync | public Observable<DataMigrationServiceInner> getByResourceGroupAsync(String groupName, String serviceName) {
return getByResourceGroupWithServiceResponseAsync(groupName, serviceName).map(new Func1<ServiceResponse<DataMigrationServiceInner>, DataMigrationServiceInner>() {
@Override
public... | java | public Observable<DataMigrationServiceInner> getByResourceGroupAsync(String groupName, String serviceName) {
return getByResourceGroupWithServiceResponseAsync(groupName, serviceName).map(new Func1<ServiceResponse<DataMigrationServiceInner>, DataMigrationServiceInner>() {
@Override
public... | [
"public",
"Observable",
"<",
"DataMigrationServiceInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"groupName",
",",
"String",
"serviceName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"groupName",
",",
"serviceName",
")",
".",
"map",
"... | Get DMS Service Instance.
The services resource is the top-level resource that represents the Data Migration Service. The GET method retrieves information about a service instance.
@param groupName Name of the resource group
@param serviceName Name of the service
@throws IllegalArgumentException thrown if parameters f... | [
"Get",
"DMS",
"Service",
"Instance",
".",
"The",
"services",
"resource",
"is",
"the",
"top",
"-",
"level",
"resource",
"that",
"represents",
"the",
"Data",
"Migration",
"Service",
".",
"The",
"GET",
"method",
"retrieves",
"information",
"about",
"a",
"service"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ServicesInner.java#L371-L378 |
roboconf/roboconf-platform | core/roboconf-target-docker/src/main/java/net/roboconf/target/docker/internal/DockerMachineConfigurator.java | DockerMachineConfigurator.createImage | void createImage( String imageId ) throws TargetException {
// If there is no Dockerfile, this method will do nothing
File targetDirectory = this.parameters.getTargetPropertiesDirectory();
String dockerFilePath = this.parameters.getTargetProperties().get( GENERATE_IMAGE_FROM );
if( ! Utils.isEmptyOrWhitespaces... | java | void createImage( String imageId ) throws TargetException {
// If there is no Dockerfile, this method will do nothing
File targetDirectory = this.parameters.getTargetPropertiesDirectory();
String dockerFilePath = this.parameters.getTargetProperties().get( GENERATE_IMAGE_FROM );
if( ! Utils.isEmptyOrWhitespaces... | [
"void",
"createImage",
"(",
"String",
"imageId",
")",
"throws",
"TargetException",
"{",
"// If there is no Dockerfile, this method will do nothing",
"File",
"targetDirectory",
"=",
"this",
".",
"parameters",
".",
"getTargetPropertiesDirectory",
"(",
")",
";",
"String",
"d... | Creates an image.
@param imageId the image ID
@throws TargetException if something went wrong | [
"Creates",
"an",
"image",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-docker/src/main/java/net/roboconf/target/docker/internal/DockerMachineConfigurator.java#L260-L294 |
joniles/mpxj | src/main/java/net/sf/mpxj/common/InputStreamHelper.java | InputStreamHelper.processZipStream | private static void processZipStream(File dir, InputStream inputStream) throws IOException
{
ZipInputStream zip = new ZipInputStream(inputStream);
while (true)
{
ZipEntry entry = zip.getNextEntry();
if (entry == null)
{
break;
}
File file = ... | java | private static void processZipStream(File dir, InputStream inputStream) throws IOException
{
ZipInputStream zip = new ZipInputStream(inputStream);
while (true)
{
ZipEntry entry = zip.getNextEntry();
if (entry == null)
{
break;
}
File file = ... | [
"private",
"static",
"void",
"processZipStream",
"(",
"File",
"dir",
",",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"ZipInputStream",
"zip",
"=",
"new",
"ZipInputStream",
"(",
"inputStream",
")",
";",
"while",
"(",
"true",
")",
"{",
"Zip... | Expands a zip file input stream into a temporary directory.
@param dir temporary directory
@param inputStream zip file input stream | [
"Expands",
"a",
"zip",
"file",
"input",
"stream",
"into",
"a",
"temporary",
"directory",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/common/InputStreamHelper.java#L115-L148 |
flow/caustic | api/src/main/java/com/flowpowered/caustic/api/util/TextureAtlas.java | TextureAtlas.addTexture | public void addTexture(String name, InputStream input) throws TextureTooBigException, IOException {
addTexture(name, ImageIO.read(input));
input.close();
} | java | public void addTexture(String name, InputStream input) throws TextureTooBigException, IOException {
addTexture(name, ImageIO.read(input));
input.close();
} | [
"public",
"void",
"addTexture",
"(",
"String",
"name",
",",
"InputStream",
"input",
")",
"throws",
"TextureTooBigException",
",",
"IOException",
"{",
"addTexture",
"(",
"name",
",",
"ImageIO",
".",
"read",
"(",
"input",
")",
")",
";",
"input",
".",
"close",
... | Adds the provided texture from the {@link java.io.InputStream} into this {@link TextureAtlas}.
@param name The name of this {@link Texture}
@param input The {@link java.io.InputStream} of the texture
@throws com.flowpowered.caustic.api.util.TextureAtlas.TextureTooBigException
@throws java.io.IOException | [
"Adds",
"the",
"provided",
"texture",
"from",
"the",
"{",
"@link",
"java",
".",
"io",
".",
"InputStream",
"}",
"into",
"this",
"{",
"@link",
"TextureAtlas",
"}",
"."
] | train | https://github.com/flow/caustic/blob/88652fcf0621ce158a0e92ce4c570ed6b1f6fca9/api/src/main/java/com/flowpowered/caustic/api/util/TextureAtlas.java#L78-L81 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/helper/JMOptional.java | JMOptional.ifNotNull | public static <T> void ifNotNull(T object, Consumer<T> consumer) {
Optional.ofNullable(object).ifPresent(consumer);
} | java | public static <T> void ifNotNull(T object, Consumer<T> consumer) {
Optional.ofNullable(object).ifPresent(consumer);
} | [
"public",
"static",
"<",
"T",
">",
"void",
"ifNotNull",
"(",
"T",
"object",
",",
"Consumer",
"<",
"T",
">",
"consumer",
")",
"{",
"Optional",
".",
"ofNullable",
"(",
"object",
")",
".",
"ifPresent",
"(",
"consumer",
")",
";",
"}"
] | If not null.
@param <T> the type parameter
@param object the object
@param consumer the consumer | [
"If",
"not",
"null",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/helper/JMOptional.java#L217-L219 |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/datatype/xsd/DurationDatatype.java | DurationDatatype.computeDays | private static BigInteger computeDays(BigInteger months, int refYear, int refMonth) {
switch (months.signum()) {
case 0:
return BigInteger.valueOf(0);
case -1:
return computeDays(months.negate(), refYear, refMonth).negate();
}
// Complete cycle of Gregorian calendar is 400 years
BigI... | java | private static BigInteger computeDays(BigInteger months, int refYear, int refMonth) {
switch (months.signum()) {
case 0:
return BigInteger.valueOf(0);
case -1:
return computeDays(months.negate(), refYear, refMonth).negate();
}
// Complete cycle of Gregorian calendar is 400 years
BigI... | [
"private",
"static",
"BigInteger",
"computeDays",
"(",
"BigInteger",
"months",
",",
"int",
"refYear",
",",
"int",
"refMonth",
")",
"{",
"switch",
"(",
"months",
".",
"signum",
"(",
")",
")",
"{",
"case",
"0",
":",
"return",
"BigInteger",
".",
"valueOf",
... | Returns the number of days spanned by a period of months starting with a particular
reference year and month. | [
"Returns",
"the",
"number",
"of",
"days",
"spanned",
"by",
"a",
"period",
"of",
"months",
"starting",
"with",
"a",
"particular",
"reference",
"year",
"and",
"month",
"."
] | train | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/datatype/xsd/DurationDatatype.java#L179-L199 |
katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/IOUtil.java | IOUtil.readMap | public static Map<String, String[]> readMap(String filename)
throws IOException {
return readMap(filename, DEFAULT_DELIMITER);
} | java | public static Map<String, String[]> readMap(String filename)
throws IOException {
return readMap(filename, DEFAULT_DELIMITER);
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"readMap",
"(",
"String",
"filename",
")",
"throws",
"IOException",
"{",
"return",
"readMap",
"(",
"filename",
",",
"DEFAULT_DELIMITER",
")",
";",
"}"
] | Reads the specified file into a map. The first value is used as key. The
rest is put into a list and used as map value. Each entry is one line of
the file.
<p>
Ensures that no null value is returned.
<p>
Uses the default {@link #DEFAULT_DELIMITER}
@param filename
the name of the specification file (not the path to it)... | [
"Reads",
"the",
"specified",
"file",
"into",
"a",
"map",
".",
"The",
"first",
"value",
"is",
"used",
"as",
"key",
".",
"The",
"rest",
"is",
"put",
"into",
"a",
"list",
"and",
"used",
"as",
"map",
"value",
".",
"Each",
"entry",
"is",
"one",
"line",
... | train | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/IOUtil.java#L367-L370 |
googleapis/cloud-bigtable-client | bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableSession.java | BigtableSession.createChannelPool | protected ManagedChannel createChannelPool(final ChannelPool.ChannelFactory channelFactory, int count)
throws IOException {
return new ChannelPool(channelFactory, count);
} | java | protected ManagedChannel createChannelPool(final ChannelPool.ChannelFactory channelFactory, int count)
throws IOException {
return new ChannelPool(channelFactory, count);
} | [
"protected",
"ManagedChannel",
"createChannelPool",
"(",
"final",
"ChannelPool",
".",
"ChannelFactory",
"channelFactory",
",",
"int",
"count",
")",
"throws",
"IOException",
"{",
"return",
"new",
"ChannelPool",
"(",
"channelFactory",
",",
"count",
")",
";",
"}"
] | Create a new {@link com.google.cloud.bigtable.grpc.io.ChannelPool}, with auth headers. This
method allows users to override the default implementation with their own.
@param channelFactory a {@link ChannelPool.ChannelFactory} object.
@param count The number of channels in the pool.
@return a {@link com.google.cloud.b... | [
"Create",
"a",
"new",
"{",
"@link",
"com",
".",
"google",
".",
"cloud",
".",
"bigtable",
".",
"grpc",
".",
"io",
".",
"ChannelPool",
"}",
"with",
"auth",
"headers",
".",
"This",
"method",
"allows",
"users",
"to",
"override",
"the",
"default",
"implementa... | train | https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableSession.java#L520-L523 |
openengsb/openengsb | components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EngineeringObjectEnhancer.java | EngineeringObjectEnhancer.mergeEngineeringObjectWithReferencedModel | private void mergeEngineeringObjectWithReferencedModel(Field field, EngineeringObjectModelWrapper model) {
AdvancedModelWrapper result = performMerge(loadReferencedModel(model, field), model);
if (result != null) {
model = result.toEngineeringObject();
}
} | java | private void mergeEngineeringObjectWithReferencedModel(Field field, EngineeringObjectModelWrapper model) {
AdvancedModelWrapper result = performMerge(loadReferencedModel(model, field), model);
if (result != null) {
model = result.toEngineeringObject();
}
} | [
"private",
"void",
"mergeEngineeringObjectWithReferencedModel",
"(",
"Field",
"field",
",",
"EngineeringObjectModelWrapper",
"model",
")",
"{",
"AdvancedModelWrapper",
"result",
"=",
"performMerge",
"(",
"loadReferencedModel",
"(",
"model",
",",
"field",
")",
",",
"mode... | Merges the given EngineeringObject with the referenced model which is defined in the given field. | [
"Merges",
"the",
"given",
"EngineeringObject",
"with",
"the",
"referenced",
"model",
"which",
"is",
"defined",
"in",
"the",
"given",
"field",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EngineeringObjectEnhancer.java#L288-L293 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/ChaincodeCollectionConfiguration.java | ChaincodeCollectionConfiguration.fromFile | private static ChaincodeCollectionConfiguration fromFile(File configFile, boolean isJson) throws InvalidArgumentException, IOException, ChaincodeCollectionConfigurationException {
// Sanity check
if (configFile == null) {
throw new InvalidArgumentException("configFile must be specified");
... | java | private static ChaincodeCollectionConfiguration fromFile(File configFile, boolean isJson) throws InvalidArgumentException, IOException, ChaincodeCollectionConfigurationException {
// Sanity check
if (configFile == null) {
throw new InvalidArgumentException("configFile must be specified");
... | [
"private",
"static",
"ChaincodeCollectionConfiguration",
"fromFile",
"(",
"File",
"configFile",
",",
"boolean",
"isJson",
")",
"throws",
"InvalidArgumentException",
",",
"IOException",
",",
"ChaincodeCollectionConfigurationException",
"{",
"// Sanity check",
"if",
"(",
"con... | Loads a ChaincodeCollectionConfiguration object from a Json or Yaml file | [
"Loads",
"a",
"ChaincodeCollectionConfiguration",
"object",
"from",
"a",
"Json",
"or",
"Yaml",
"file"
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/ChaincodeCollectionConfiguration.java#L193-L209 |
telegram-s/telegram-mt | src/main/java/org/telegram/mtproto/MTProto.java | MTProto.sendRpcMessage | public int sendRpcMessage(TLMethod request, long timeout, boolean highPriority) {
int id = scheduller.postMessage(request, true, timeout, highPriority);
Logger.d(TAG, "sendMessage #" + id + " " + request.toString() + " with timeout " + timeout + " ms");
return id;
} | java | public int sendRpcMessage(TLMethod request, long timeout, boolean highPriority) {
int id = scheduller.postMessage(request, true, timeout, highPriority);
Logger.d(TAG, "sendMessage #" + id + " " + request.toString() + " with timeout " + timeout + " ms");
return id;
} | [
"public",
"int",
"sendRpcMessage",
"(",
"TLMethod",
"request",
",",
"long",
"timeout",
",",
"boolean",
"highPriority",
")",
"{",
"int",
"id",
"=",
"scheduller",
".",
"postMessage",
"(",
"request",
",",
"true",
",",
"timeout",
",",
"highPriority",
")",
";",
... | Sending rpc request
@param request request
@param timeout timeout of request
@param highPriority is hight priority request
@return request id | [
"Sending",
"rpc",
"request"
] | train | https://github.com/telegram-s/telegram-mt/blob/57e3f635a6508705081eba9396ae24db050bc943/src/main/java/org/telegram/mtproto/MTProto.java#L264-L268 |
facebookarchive/hadoop-20 | src/tools/org/apache/hadoop/tools/DistCp.java | DistCp.getCopier | public static DistCopier getCopier(final Configuration conf,
final Arguments args) throws IOException {
DistCopier dc = new DistCopier(conf, args);
dc.setupJob();
if (dc.getJobConf() != null) {
return dc;
} else {
return null;
}
} | java | public static DistCopier getCopier(final Configuration conf,
final Arguments args) throws IOException {
DistCopier dc = new DistCopier(conf, args);
dc.setupJob();
if (dc.getJobConf() != null) {
return dc;
} else {
return null;
}
} | [
"public",
"static",
"DistCopier",
"getCopier",
"(",
"final",
"Configuration",
"conf",
",",
"final",
"Arguments",
"args",
")",
"throws",
"IOException",
"{",
"DistCopier",
"dc",
"=",
"new",
"DistCopier",
"(",
"conf",
",",
"args",
")",
";",
"dc",
".",
"setupJob... | Return a DistCopier object for copying the files.
If a MapReduce job is needed, a DistCopier instance will be
initialized and returned.
If no MapReduce job is needed (for empty directories), all the
other work will be done in this function, and NULL will be
returned. If caller sees NULL returned, the copying has
succe... | [
"Return",
"a",
"DistCopier",
"object",
"for",
"copying",
"the",
"files",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/tools/org/apache/hadoop/tools/DistCp.java#L1525-L1534 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java | SDMath.zeroFraction | public SDVariable zeroFraction(String name, SDVariable input) {
validateNumerical("zeroFraction", input);
SDVariable res = f().zeroFraction(input);
return updateVariableNameAndReference(res, name);
} | java | public SDVariable zeroFraction(String name, SDVariable input) {
validateNumerical("zeroFraction", input);
SDVariable res = f().zeroFraction(input);
return updateVariableNameAndReference(res, name);
} | [
"public",
"SDVariable",
"zeroFraction",
"(",
"String",
"name",
",",
"SDVariable",
"input",
")",
"{",
"validateNumerical",
"(",
"\"zeroFraction\"",
",",
"input",
")",
";",
"SDVariable",
"res",
"=",
"f",
"(",
")",
".",
"zeroFraction",
"(",
"input",
")",
";",
... | Full array zero fraction array reduction operation, optionally along specified dimensions: out = (count(x == 0) / length(x))
@param name Name of the output variable
@param input Input variable
@return Reduced array of rank 0 (scalar) | [
"Full",
"array",
"zero",
"fraction",
"array",
"reduction",
"operation",
"optionally",
"along",
"specified",
"dimensions",
":",
"out",
"=",
"(",
"count",
"(",
"x",
"==",
"0",
")",
"/",
"length",
"(",
"x",
"))"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java#L2406-L2410 |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/ltc/impl/LTCUOWCallback.java | LTCUOWCallback.contextChange | @Override
public void contextChange(int typeOfChange, UOWScope scope) throws IllegalStateException {
if (tc.isEntryEnabled())
Tr.entry(tc, "contextChange", new Object[] { typeOfChange, scope, this });
try {
// Determine the Tx change type and process. Ensure we do what
... | java | @Override
public void contextChange(int typeOfChange, UOWScope scope) throws IllegalStateException {
if (tc.isEntryEnabled())
Tr.entry(tc, "contextChange", new Object[] { typeOfChange, scope, this });
try {
// Determine the Tx change type and process. Ensure we do what
... | [
"@",
"Override",
"public",
"void",
"contextChange",
"(",
"int",
"typeOfChange",
",",
"UOWScope",
"scope",
")",
"throws",
"IllegalStateException",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"contextChange... | /*
Notification from UserTransaction or UserActivitySession interface implementations
that the state of a bean-managed UOW has changed. As a result of this bean-managed
UOW change we may have to change the LTC that's on the thread. | [
"/",
"*",
"Notification",
"from",
"UserTransaction",
"or",
"UserActivitySession",
"interface",
"implementations",
"that",
"the",
"state",
"of",
"a",
"bean",
"-",
"managed",
"UOW",
"has",
"changed",
".",
"As",
"a",
"result",
"of",
"this",
"bean",
"-",
"managed"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/ltc/impl/LTCUOWCallback.java#L73-L106 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientNodeData.java | TransientNodeData.createNodeData | public static TransientNodeData createNodeData(NodeData parent, InternalQName name, InternalQName primaryTypeName,
InternalQName[] mixinTypesName, String identifier, AccessControlList acl)
{
TransientNodeData nodeData = null;
QPath path = QPath.makeChildPath(parent.getQPath(), name);
nodeData... | java | public static TransientNodeData createNodeData(NodeData parent, InternalQName name, InternalQName primaryTypeName,
InternalQName[] mixinTypesName, String identifier, AccessControlList acl)
{
TransientNodeData nodeData = null;
QPath path = QPath.makeChildPath(parent.getQPath(), name);
nodeData... | [
"public",
"static",
"TransientNodeData",
"createNodeData",
"(",
"NodeData",
"parent",
",",
"InternalQName",
"name",
",",
"InternalQName",
"primaryTypeName",
",",
"InternalQName",
"[",
"]",
"mixinTypesName",
",",
"String",
"identifier",
",",
"AccessControlList",
"acl",
... | Factory method
@param parent NodeData
@param name InternalQName
@param primaryTypeName InternalQName
@param mixinTypesName InternalQName[]
@param identifier String
@param acl AccessControlList
@return | [
"Factory",
"method"
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientNodeData.java#L274-L282 |
mbenson/therian | core/src/main/java/therian/TherianContext.java | TherianContext.evalIfSupported | public final synchronized <RESULT, OPERATION extends Operation<RESULT>> RESULT evalIfSupported(OPERATION operation,
RESULT defaultValue, Hint... hints) {
return evalSuccess(operation, hints) ? operation.getResult() : defaultValue;
} | java | public final synchronized <RESULT, OPERATION extends Operation<RESULT>> RESULT evalIfSupported(OPERATION operation,
RESULT defaultValue, Hint... hints) {
return evalSuccess(operation, hints) ? operation.getResult() : defaultValue;
} | [
"public",
"final",
"synchronized",
"<",
"RESULT",
",",
"OPERATION",
"extends",
"Operation",
"<",
"RESULT",
">",
">",
"RESULT",
"evalIfSupported",
"(",
"OPERATION",
"operation",
",",
"RESULT",
"defaultValue",
",",
"Hint",
"...",
"hints",
")",
"{",
"return",
"ev... | Evaluates {@code operation} if supported; otherwise returns {@code defaultValue}.
@param operation
@param defaultValue
@param hints
@return RESULT or {@code defaultValue}
@throws NullPointerException on {@code null} input
@throws OperationException potentially, via {@link Operation#getResult()} | [
"Evaluates",
"{",
"@code",
"operation",
"}",
"if",
"supported",
";",
"otherwise",
"returns",
"{",
"@code",
"defaultValue",
"}",
"."
] | train | https://github.com/mbenson/therian/blob/0653505f73e2a6f5b0abc394ea6d83af03408254/core/src/main/java/therian/TherianContext.java#L394-L397 |
kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/SharedInformerFactory.java | SharedInformerFactory.sharedIndexInformerFor | public synchronized <ApiType, ApiListType> SharedIndexInformer<ApiType> sharedIndexInformerFor(
Function<CallGeneratorParams, Call> callGenerator,
Class<ApiType> apiTypeClass,
Class<ApiListType> apiListTypeClass) {
return sharedIndexInformerFor(callGenerator, apiTypeClass, apiListTypeClass, 0);
... | java | public synchronized <ApiType, ApiListType> SharedIndexInformer<ApiType> sharedIndexInformerFor(
Function<CallGeneratorParams, Call> callGenerator,
Class<ApiType> apiTypeClass,
Class<ApiListType> apiListTypeClass) {
return sharedIndexInformerFor(callGenerator, apiTypeClass, apiListTypeClass, 0);
... | [
"public",
"synchronized",
"<",
"ApiType",
",",
"ApiListType",
">",
"SharedIndexInformer",
"<",
"ApiType",
">",
"sharedIndexInformerFor",
"(",
"Function",
"<",
"CallGeneratorParams",
",",
"Call",
">",
"callGenerator",
",",
"Class",
"<",
"ApiType",
">",
"apiTypeClass"... | Shared index informer for shared index informer.
@param <ApiType> the type parameter
@param <ApiListType> the type parameter
@param callGenerator the call generator
@param apiTypeClass the api type class
@param apiListTypeClass the api list type class
@return the shared index informer | [
"Shared",
"index",
"informer",
"for",
"shared",
"index",
"informer",
"."
] | train | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/SharedInformerFactory.java#L53-L58 |
app55/app55-java | src/support/java/com/googlecode/openbeans/Encoder.java | Encoder.setPersistenceDelegate | public void setPersistenceDelegate(Class<?> type, PersistenceDelegate delegate)
{
if (type == null || delegate == null)
{
throw new NullPointerException();
}
delegates.put(type, delegate);
} | java | public void setPersistenceDelegate(Class<?> type, PersistenceDelegate delegate)
{
if (type == null || delegate == null)
{
throw new NullPointerException();
}
delegates.put(type, delegate);
} | [
"public",
"void",
"setPersistenceDelegate",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"PersistenceDelegate",
"delegate",
")",
"{",
"if",
"(",
"type",
"==",
"null",
"||",
"delegate",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
... | Register the <code>PersistenceDelegate</code> of the specified type.
@param type
@param delegate | [
"Register",
"the",
"<code",
">",
"PersistenceDelegate<",
"/",
"code",
">",
"of",
"the",
"specified",
"type",
"."
] | train | https://github.com/app55/app55-java/blob/73e51d0f3141a859dfbd37ca9becef98477e553e/src/support/java/com/googlecode/openbeans/Encoder.java#L296-L303 |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/NumberBindings.java | NumberBindings.divideSafe | public static NumberBinding divideSafe(ObservableValue<Number> dividend, ObservableValue<Number> divisor, ObservableValue<Number> defaultValue) {
return Bindings.createDoubleBinding(() -> {
if (divisor.getValue().doubleValue() == 0) {
return defaultValue.getValue().doubleValue();
... | java | public static NumberBinding divideSafe(ObservableValue<Number> dividend, ObservableValue<Number> divisor, ObservableValue<Number> defaultValue) {
return Bindings.createDoubleBinding(() -> {
if (divisor.getValue().doubleValue() == 0) {
return defaultValue.getValue().doubleValue();
... | [
"public",
"static",
"NumberBinding",
"divideSafe",
"(",
"ObservableValue",
"<",
"Number",
">",
"dividend",
",",
"ObservableValue",
"<",
"Number",
">",
"divisor",
",",
"ObservableValue",
"<",
"Number",
">",
"defaultValue",
")",
"{",
"return",
"Bindings",
".",
"cr... | An number binding of a division that won't throw an {@link java.lang.ArithmeticException}
when a division by zero happens. See {@link #divideSafe(javafx.beans.value.ObservableIntegerValue,
javafx.beans.value.ObservableIntegerValue)}
for more informations.
@param dividend the observable value used as dividend
@para... | [
"An",
"number",
"binding",
"of",
"a",
"division",
"that",
"won",
"t",
"throw",
"an",
"{",
"@link",
"java",
".",
"lang",
".",
"ArithmeticException",
"}",
"when",
"a",
"division",
"by",
"zero",
"happens",
".",
"See",
"{",
"@link",
"#divideSafe",
"(",
"java... | train | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/NumberBindings.java#L110-L120 |
landawn/AbacusUtil | src/com/landawn/abacus/util/CSVUtil.java | CSVUtil.loadCSV | @SuppressWarnings("rawtypes")
public static <E extends Exception> DataSet loadCSV(final File csvFile, final long offset, final long count, final Try.Predicate<String[], E> filter,
final Map<String, ? extends Type> columnTypeMap) throws UncheckedIOException, E {
InputStream csvInputStream = nu... | java | @SuppressWarnings("rawtypes")
public static <E extends Exception> DataSet loadCSV(final File csvFile, final long offset, final long count, final Try.Predicate<String[], E> filter,
final Map<String, ? extends Type> columnTypeMap) throws UncheckedIOException, E {
InputStream csvInputStream = nu... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"static",
"<",
"E",
"extends",
"Exception",
">",
"DataSet",
"loadCSV",
"(",
"final",
"File",
"csvFile",
",",
"final",
"long",
"offset",
",",
"final",
"long",
"count",
",",
"final",
"Try",
".",
"P... | Load the data from CSV.
@param csvFile
@param offset
@param count
@param filter
@param columnTypeMap
@return | [
"Load",
"the",
"data",
"from",
"CSV",
".",
"@param",
"csvFile",
"@param",
"offset",
"@param",
"count",
"@param",
"filter",
"@param",
"columnTypeMap"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/CSVUtil.java#L404-L418 |
google/closure-compiler | src/com/google/javascript/jscomp/PeepholeMinimizeConditions.java | PeepholeMinimizeConditions.maybeReplaceChildWithNumber | private Node maybeReplaceChildWithNumber(Node n, Node parent, int num) {
Node newNode = IR.number(num);
if (!newNode.isEquivalentTo(n)) {
parent.replaceChild(n, newNode);
reportChangeToEnclosingScope(newNode);
markFunctionsDeleted(n);
return newNode;
}
return n;
} | java | private Node maybeReplaceChildWithNumber(Node n, Node parent, int num) {
Node newNode = IR.number(num);
if (!newNode.isEquivalentTo(n)) {
parent.replaceChild(n, newNode);
reportChangeToEnclosingScope(newNode);
markFunctionsDeleted(n);
return newNode;
}
return n;
} | [
"private",
"Node",
"maybeReplaceChildWithNumber",
"(",
"Node",
"n",
",",
"Node",
"parent",
",",
"int",
"num",
")",
"{",
"Node",
"newNode",
"=",
"IR",
".",
"number",
"(",
"num",
")",
";",
"if",
"(",
"!",
"newNode",
".",
"isEquivalentTo",
"(",
"n",
")",
... | Replaces a node with a number node if the new number node is not equivalent
to the current node.
Returns the replacement for n if it was replaced, otherwise returns n. | [
"Replaces",
"a",
"node",
"with",
"a",
"number",
"node",
"if",
"the",
"new",
"number",
"node",
"is",
"not",
"equivalent",
"to",
"the",
"current",
"node",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/PeepholeMinimizeConditions.java#L1140-L1151 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LiveEventsInner.java | LiveEventsInner.resetAsync | public Observable<Void> resetAsync(String resourceGroupName, String accountName, String liveEventName) {
return resetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> res... | java | public Observable<Void> resetAsync(String resourceGroupName, String accountName, String liveEventName) {
return resetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> res... | [
"public",
"Observable",
"<",
"Void",
">",
"resetAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"liveEventName",
")",
"{",
"return",
"resetWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
",",
"liveEvent... | Reset Live Event.
Resets an existing Live Event.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param liveEventName The name of the Live Event.
@throws IllegalArgumentException thrown if parameters fail the validation
@return ... | [
"Reset",
"Live",
"Event",
".",
"Resets",
"an",
"existing",
"Live",
"Event",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LiveEventsInner.java#L1684-L1691 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/RegularFile.java | RegularFile.get | private static int get(byte[] block, int offset, ByteBuffer buf, int len) {
buf.put(block, offset, len);
return len;
} | java | private static int get(byte[] block, int offset, ByteBuffer buf, int len) {
buf.put(block, offset, len);
return len;
} | [
"private",
"static",
"int",
"get",
"(",
"byte",
"[",
"]",
"block",
",",
"int",
"offset",
",",
"ByteBuffer",
"buf",
",",
"int",
"len",
")",
"{",
"buf",
".",
"put",
"(",
"block",
",",
"offset",
",",
"len",
")",
";",
"return",
"len",
";",
"}"
] | Reads len bytes starting at the given offset in the given block into the given byte buffer. | [
"Reads",
"len",
"bytes",
"starting",
"at",
"the",
"given",
"offset",
"in",
"the",
"given",
"block",
"into",
"the",
"given",
"byte",
"buffer",
"."
] | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/RegularFile.java#L657-L660 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/objects/XNodeSet.java | XNodeSet.notEquals | public boolean notEquals(XObject obj2) throws javax.xml.transform.TransformerException
{
return compare(obj2, S_NEQ);
} | java | public boolean notEquals(XObject obj2) throws javax.xml.transform.TransformerException
{
return compare(obj2, S_NEQ);
} | [
"public",
"boolean",
"notEquals",
"(",
"XObject",
"obj2",
")",
"throws",
"javax",
".",
"xml",
".",
"transform",
".",
"TransformerException",
"{",
"return",
"compare",
"(",
"obj2",
",",
"S_NEQ",
")",
";",
"}"
] | Tell if two objects are functionally not equal.
@param obj2 object to compare this nodeset to
@return see this.compare(...)
@throws javax.xml.transform.TransformerException | [
"Tell",
"if",
"two",
"objects",
"are",
"functionally",
"not",
"equal",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/objects/XNodeSet.java#L722-L725 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/ValueEnforcer.java | ValueEnforcer.notNullAndEquals | public static <T> T notNullAndEquals (final T aValue, final String sName, @Nonnull final T aExpectedValue)
{
if (isEnabled ())
return notNullAndEquals (aValue, () -> sName, aExpectedValue);
return aValue;
} | java | public static <T> T notNullAndEquals (final T aValue, final String sName, @Nonnull final T aExpectedValue)
{
if (isEnabled ())
return notNullAndEquals (aValue, () -> sName, aExpectedValue);
return aValue;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"notNullAndEquals",
"(",
"final",
"T",
"aValue",
",",
"final",
"String",
"sName",
",",
"@",
"Nonnull",
"final",
"T",
"aExpectedValue",
")",
"{",
"if",
"(",
"isEnabled",
"(",
")",
")",
"return",
"notNullAndEquals",
... | Check that the passed value is not <code>null</code> and equal to the
provided expected value.
@param <T>
Type to be checked and returned
@param aValue
The value to check.
@param sName
The name of the value (e.g. the parameter name)
@param aExpectedValue
The expected value. May not be <code>null</code>.
@return The pa... | [
"Check",
"that",
"the",
"passed",
"value",
"is",
"not",
"<code",
">",
"null<",
"/",
"code",
">",
"and",
"equal",
"to",
"the",
"provided",
"expected",
"value",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/ValueEnforcer.java#L1370-L1375 |
LAW-Unimi/BUbiNG | src/it/unimi/di/law/warc/io/gzarc/GZIPIndexer.java | GZIPIndexer.index | public static LongBigArrayBigList index(final InputStream in, final ProgressLogger pl) throws IOException {
final LongBigArrayBigList pointers = new LongBigArrayBigList();
long current = 0;
final GZIPArchiveReader gzar = new GZIPArchiveReader(in);
GZIPArchive.ReadEntry re;
for (;;) {
re = gzar.skipEntry();... | java | public static LongBigArrayBigList index(final InputStream in, final ProgressLogger pl) throws IOException {
final LongBigArrayBigList pointers = new LongBigArrayBigList();
long current = 0;
final GZIPArchiveReader gzar = new GZIPArchiveReader(in);
GZIPArchive.ReadEntry re;
for (;;) {
re = gzar.skipEntry();... | [
"public",
"static",
"LongBigArrayBigList",
"index",
"(",
"final",
"InputStream",
"in",
",",
"final",
"ProgressLogger",
"pl",
")",
"throws",
"IOException",
"{",
"final",
"LongBigArrayBigList",
"pointers",
"=",
"new",
"LongBigArrayBigList",
"(",
")",
";",
"long",
"c... | Returns a list of pointers to a GZIP archive entries positions (including the end of file).
@param in the stream from which to read the GZIP archive.
@param pl a progress logger.
@return a list of longs where the <em>i</em>-th long is the offset in the stream of the first byte of the <em>i</em>-th archive entry. | [
"Returns",
"a",
"list",
"of",
"pointers",
"to",
"a",
"GZIP",
"archive",
"entries",
"positions",
"(",
"including",
"the",
"end",
"of",
"file",
")",
"."
] | train | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/warc/io/gzarc/GZIPIndexer.java#L62-L76 |
aws/aws-sdk-java | aws-java-sdk-health/src/main/java/com/amazonaws/services/health/model/AffectedEntity.java | AffectedEntity.withTags | public AffectedEntity withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | java | public AffectedEntity withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"AffectedEntity",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A map of entity tags attached to the affected entity.
</p>
@param tags
A map of entity tags attached to the affected entity.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"A",
"map",
"of",
"entity",
"tags",
"attached",
"to",
"the",
"affected",
"entity",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-health/src/main/java/com/amazonaws/services/health/model/AffectedEntity.java#L456-L459 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Fraction.java | Fraction.of | public static Fraction of(String str) {
if (str == null) {
throw new IllegalArgumentException("The string must not be null");
}
// parse double format
int pos = str.indexOf('.');
if (pos >= 0) {
return of(Double.parseDouble(str));
}
// par... | java | public static Fraction of(String str) {
if (str == null) {
throw new IllegalArgumentException("The string must not be null");
}
// parse double format
int pos = str.indexOf('.');
if (pos >= 0) {
return of(Double.parseDouble(str));
}
// par... | [
"public",
"static",
"Fraction",
"of",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The string must not be null\"",
")",
";",
"}",
"// parse double format",
"int",
"pos",
"=",
"str... | <p>
Creates a Fraction from a <code>String</code>.
</p>
<p>
The formats accepted are:
</p>
<ol>
<li><code>double</code> String containing a dot</li>
<li>'X Y/Z'</li>
<li>'Y/Z'</li>
<li>'X' (a simple whole number)</li>
</ol>
<p>
and a .
</p>
@param str
the string to parse, must not be <code>null</code>
@return the ne... | [
"<p",
">",
"Creates",
"a",
"Fraction",
"from",
"a",
"<code",
">",
"String<",
"/",
"code",
">",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Fraction.java#L366-L401 |
samskivert/samskivert | src/main/java/com/samskivert/util/QuickSort.java | QuickSort.rsort | public static <T> void rsort (List<T> a, Comparator<? super T> comp)
{
sort(a, Collections.reverseOrder(comp));
} | java | public static <T> void rsort (List<T> a, Comparator<? super T> comp)
{
sort(a, Collections.reverseOrder(comp));
} | [
"public",
"static",
"<",
"T",
">",
"void",
"rsort",
"(",
"List",
"<",
"T",
">",
"a",
",",
"Comparator",
"<",
"?",
"super",
"T",
">",
"comp",
")",
"{",
"sort",
"(",
"a",
",",
"Collections",
".",
"reverseOrder",
"(",
"comp",
")",
")",
";",
"}"
] | Sort the elements in the specified List according to the reverse ordering imposed by the
specified Comparator. | [
"Sort",
"the",
"elements",
"in",
"the",
"specified",
"List",
"according",
"to",
"the",
"reverse",
"ordering",
"imposed",
"by",
"the",
"specified",
"Comparator",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/QuickSort.java#L354-L357 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.ip_arp_ipBlocked_unblock_POST | public void ip_arp_ipBlocked_unblock_POST(String ip, String ipBlocked) throws IOException {
String qPath = "/ip/{ip}/arp/{ipBlocked}/unblock";
StringBuilder sb = path(qPath, ip, ipBlocked);
exec(qPath, "POST", sb.toString(), null);
} | java | public void ip_arp_ipBlocked_unblock_POST(String ip, String ipBlocked) throws IOException {
String qPath = "/ip/{ip}/arp/{ipBlocked}/unblock";
StringBuilder sb = path(qPath, ip, ipBlocked);
exec(qPath, "POST", sb.toString(), null);
} | [
"public",
"void",
"ip_arp_ipBlocked_unblock_POST",
"(",
"String",
"ip",
",",
"String",
"ipBlocked",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/{ip}/arp/{ipBlocked}/unblock\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"ip",
... | Unblock this IP
REST: POST /ip/{ip}/arp/{ipBlocked}/unblock
@param ip [required]
@param ipBlocked [required] your IP | [
"Unblock",
"this",
"IP"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L286-L290 |
apache/groovy | src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java | StaticTypeCheckingVisitor.inferReturnTypeGenerics | protected ClassNode inferReturnTypeGenerics(ClassNode receiver, MethodNode method, Expression arguments) {
return inferReturnTypeGenerics(receiver, method, arguments, null);
} | java | protected ClassNode inferReturnTypeGenerics(ClassNode receiver, MethodNode method, Expression arguments) {
return inferReturnTypeGenerics(receiver, method, arguments, null);
} | [
"protected",
"ClassNode",
"inferReturnTypeGenerics",
"(",
"ClassNode",
"receiver",
",",
"MethodNode",
"method",
",",
"Expression",
"arguments",
")",
"{",
"return",
"inferReturnTypeGenerics",
"(",
"receiver",
",",
"method",
",",
"arguments",
",",
"null",
")",
";",
... | If a method call returns a parameterized type, then we can perform additional inference on the
return type, so that the type gets actual type parameters. For example, the method
Arrays.asList(T...) is generified with type T which can be deduced from actual type
arguments.
@param method the method node
@param argume... | [
"If",
"a",
"method",
"call",
"returns",
"a",
"parameterized",
"type",
"then",
"we",
"can",
"perform",
"additional",
"inference",
"on",
"the",
"return",
"type",
"so",
"that",
"the",
"type",
"gets",
"actual",
"type",
"parameters",
".",
"For",
"example",
"the",... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java#L5204-L5206 |
OpenFeign/feign | core/src/main/java/feign/Request.java | Request.create | public static Request create(HttpMethod httpMethod,
String url,
Map<String, Collection<String>> headers,
Body body) {
return new Request(httpMethod, url, headers, body);
} | java | public static Request create(HttpMethod httpMethod,
String url,
Map<String, Collection<String>> headers,
Body body) {
return new Request(httpMethod, url, headers, body);
} | [
"public",
"static",
"Request",
"create",
"(",
"HttpMethod",
"httpMethod",
",",
"String",
"url",
",",
"Map",
"<",
"String",
",",
"Collection",
"<",
"String",
">",
">",
"headers",
",",
"Body",
"body",
")",
"{",
"return",
"new",
"Request",
"(",
"httpMethod",
... | Builds a Request. All parameters must be effectively immutable, via safe copies.
@param httpMethod for the request.
@param url for the request.
@param headers to include.
@param body of the request, can be {@literal null}
@return a Request | [
"Builds",
"a",
"Request",
".",
"All",
"parameters",
"must",
"be",
"effectively",
"immutable",
"via",
"safe",
"copies",
"."
] | train | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/Request.java#L134-L139 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/ZoneId.java | ZoneId.getDisplayName | public String getDisplayName(TextStyle style, Locale locale) {
return new DateTimeFormatterBuilder().appendZoneText(style).toFormatter(locale).format(toTemporal());
} | java | public String getDisplayName(TextStyle style, Locale locale) {
return new DateTimeFormatterBuilder().appendZoneText(style).toFormatter(locale).format(toTemporal());
} | [
"public",
"String",
"getDisplayName",
"(",
"TextStyle",
"style",
",",
"Locale",
"locale",
")",
"{",
"return",
"new",
"DateTimeFormatterBuilder",
"(",
")",
".",
"appendZoneText",
"(",
"style",
")",
".",
"toFormatter",
"(",
"locale",
")",
".",
"format",
"(",
"... | Gets the textual representation of the zone, such as 'British Time' or
'+02:00'.
<p>
This returns the textual name used to identify the time-zone ID,
suitable for presentation to the user.
The parameters control the style of the returned text and the locale.
<p>
If no textual mapping is found then the {@link #getId() f... | [
"Gets",
"the",
"textual",
"representation",
"of",
"the",
"zone",
"such",
"as",
"British",
"Time",
"or",
"+",
"02",
":",
"00",
".",
"<p",
">",
"This",
"returns",
"the",
"textual",
"name",
"used",
"to",
"identify",
"the",
"time",
"-",
"zone",
"ID",
"suit... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/ZoneId.java#L515-L517 |
vkostyukov/la4j | src/main/java/org/la4j/matrix/SparseMatrix.java | SparseMatrix.nonZeroRowMajorIterator | public RowMajorMatrixIterator nonZeroRowMajorIterator() {
return new RowMajorMatrixIterator(rows, columns) {
private long limit = (long) rows * columns;
private long i = -1;
@Override
public int rowIndex() {
return (int) (i / columns);
... | java | public RowMajorMatrixIterator nonZeroRowMajorIterator() {
return new RowMajorMatrixIterator(rows, columns) {
private long limit = (long) rows * columns;
private long i = -1;
@Override
public int rowIndex() {
return (int) (i / columns);
... | [
"public",
"RowMajorMatrixIterator",
"nonZeroRowMajorIterator",
"(",
")",
"{",
"return",
"new",
"RowMajorMatrixIterator",
"(",
"rows",
",",
"columns",
")",
"{",
"private",
"long",
"limit",
"=",
"(",
"long",
")",
"rows",
"*",
"columns",
";",
"private",
"long",
"... | Returns a non-zero row-major matrix iterator.
@return a non-zero row-major matrix iterator. | [
"Returns",
"a",
"non",
"-",
"zero",
"row",
"-",
"major",
"matrix",
"iterator",
"."
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/matrix/SparseMatrix.java#L419-L466 |
easymock/objenesis | main/src/main/java/org/objenesis/instantiator/util/ClassDefinitionUtils.java | ClassDefinitionUtils.writeClass | public static void writeClass(String fileName, byte[] bytes) throws IOException {
try (BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(fileName))) {
out.write(bytes);
}
} | java | public static void writeClass(String fileName, byte[] bytes) throws IOException {
try (BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(fileName))) {
out.write(bytes);
}
} | [
"public",
"static",
"void",
"writeClass",
"(",
"String",
"fileName",
",",
"byte",
"[",
"]",
"bytes",
")",
"throws",
"IOException",
"{",
"try",
"(",
"BufferedOutputStream",
"out",
"=",
"new",
"BufferedOutputStream",
"(",
"new",
"FileOutputStream",
"(",
"fileName"... | Write all class bytes to a file.
@param fileName file where the bytes will be written
@param bytes bytes representing the class
@throws IOException if we fail to write the class | [
"Write",
"all",
"class",
"bytes",
"to",
"a",
"file",
"."
] | train | https://github.com/easymock/objenesis/blob/8f601c8ba1aa20bbc640e2c2bc48d55df52c489f/main/src/main/java/org/objenesis/instantiator/util/ClassDefinitionUtils.java#L133-L137 |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/chart/CcgBeamSearchChart.java | CcgBeamSearchChart.offerEntry | private final void offerEntry(ChartEntry entry, double probability, int spanStart, int spanEnd) {
HeapUtils.offer(chart[spanStart][spanEnd], probabilities[spanStart][spanEnd],
chartSizes[spanEnd + (numTerminals * spanStart)], entry, probability);
chartSizes[spanEnd + (numTerminals * spanStart)]++;
t... | java | private final void offerEntry(ChartEntry entry, double probability, int spanStart, int spanEnd) {
HeapUtils.offer(chart[spanStart][spanEnd], probabilities[spanStart][spanEnd],
chartSizes[spanEnd + (numTerminals * spanStart)], entry, probability);
chartSizes[spanEnd + (numTerminals * spanStart)]++;
t... | [
"private",
"final",
"void",
"offerEntry",
"(",
"ChartEntry",
"entry",
",",
"double",
"probability",
",",
"int",
"spanStart",
",",
"int",
"spanEnd",
")",
"{",
"HeapUtils",
".",
"offer",
"(",
"chart",
"[",
"spanStart",
"]",
"[",
"spanEnd",
"]",
",",
"probabi... | Adds a chart entry to the heap for {@code spanStart} to
{@code spanEnd}. This operation implements beam truncation by
discarding the minimum probability entry when a heap reaches the
beam size. | [
"Adds",
"a",
"chart",
"entry",
"to",
"the",
"heap",
"for",
"{"
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/chart/CcgBeamSearchChart.java#L214-L226 |
trellis-ldp/trellis | components/webdav/src/main/java/org/trellisldp/webdav/TrellisWebDAV.java | TrellisWebDAV.moveResource | @MOVE
@Timed
public void moveResource(@Suspended final AsyncResponse response, @Context final Request request,
@Context final UriInfo uriInfo, @Context final HttpHeaders headers,
@Context final SecurityContext security) {
final TrellisRequest req = new TrellisRequest(request, uri... | java | @MOVE
@Timed
public void moveResource(@Suspended final AsyncResponse response, @Context final Request request,
@Context final UriInfo uriInfo, @Context final HttpHeaders headers,
@Context final SecurityContext security) {
final TrellisRequest req = new TrellisRequest(request, uri... | [
"@",
"MOVE",
"@",
"Timed",
"public",
"void",
"moveResource",
"(",
"@",
"Suspended",
"final",
"AsyncResponse",
"response",
",",
"@",
"Context",
"final",
"Request",
"request",
",",
"@",
"Context",
"final",
"UriInfo",
"uriInfo",
",",
"@",
"Context",
"final",
"H... | Move a resource.
@param response the async response
@param request the request
@param uriInfo the URI info
@param headers the headers
@param security the security context | [
"Move",
"a",
"resource",
"."
] | train | https://github.com/trellis-ldp/trellis/blob/789fd7a3df86cab7ebba63e72bf4e58397e5f42d/components/webdav/src/main/java/org/trellisldp/webdav/TrellisWebDAV.java#L195-L227 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java | MDAG.getStrings | private void getStrings(HashSet<String> strHashSet, SearchCondition searchCondition, String searchConditionString, String prefixString, TreeMap<Character, MDAGNode> transitionTreeMap)
{
//Traverse all the valid _transition paths beginning from each _transition in transitionTreeMap, inserting the
//c... | java | private void getStrings(HashSet<String> strHashSet, SearchCondition searchCondition, String searchConditionString, String prefixString, TreeMap<Character, MDAGNode> transitionTreeMap)
{
//Traverse all the valid _transition paths beginning from each _transition in transitionTreeMap, inserting the
//c... | [
"private",
"void",
"getStrings",
"(",
"HashSet",
"<",
"String",
">",
"strHashSet",
",",
"SearchCondition",
"searchCondition",
",",
"String",
"searchConditionString",
",",
"String",
"prefixString",
",",
"TreeMap",
"<",
"Character",
",",
"MDAGNode",
">",
"transitionTr... | Retrieves Strings corresponding to all valid _transition paths from a given node that satisfy a given condition.
@param strHashSet a HashSet of Strings to contain all those in the MDAG satisfying
{@code searchCondition} with {@code conditionString}
@param searchCondition the SearchCondition enum field... | [
"Retrieves",
"Strings",
"corresponding",
"to",
"all",
"valid",
"_transition",
"paths",
"from",
"a",
"given",
"node",
"that",
"satisfy",
"a",
"given",
"condition",
"."
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java#L861-L877 |
wildfly/wildfly-core | host-controller/src/main/java/org/jboss/as/host/controller/HostControllerEnvironment.java | HostControllerEnvironment.getFileFromProperty | private File getFileFromProperty(final String name) {
String value = hostSystemProperties.get(name);
File result = (value != null) ? new File(value) : null;
// AS7-1752 see if a non-existent relative path exists relative to the home dir
if (result != null && homeDir != null && !result.ex... | java | private File getFileFromProperty(final String name) {
String value = hostSystemProperties.get(name);
File result = (value != null) ? new File(value) : null;
// AS7-1752 see if a non-existent relative path exists relative to the home dir
if (result != null && homeDir != null && !result.ex... | [
"private",
"File",
"getFileFromProperty",
"(",
"final",
"String",
"name",
")",
"{",
"String",
"value",
"=",
"hostSystemProperties",
".",
"get",
"(",
"name",
")",
";",
"File",
"result",
"=",
"(",
"value",
"!=",
"null",
")",
"?",
"new",
"File",
"(",
"value... | Get a File from configuration.
@param name the name of the property
@return the CanonicalFile form for the given name. | [
"Get",
"a",
"File",
"from",
"configuration",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/host/controller/HostControllerEnvironment.java#L839-L850 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/face/AipFace.java | AipFace.search | public JSONObject search(String image, String imageType, String groupIdList, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("image", image);
request.addBody("image_type", imageType);
requ... | java | public JSONObject search(String image, String imageType, String groupIdList, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("image", image);
request.addBody("image_type", imageType);
requ... | [
"public",
"JSONObject",
"search",
"(",
"String",
"image",
",",
"String",
"imageType",
",",
"String",
"groupIdList",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"p... | 人脸搜索接口
@param image - 图片信息(**总数据大小应小于10M**),图片上传方式根据image_type来判断
@param imageType - 图片类型 **BASE64**:图片的base64值,base64编码后的图片数据,需urlencode,编码后的图片大小不超过2M;**URL**:图片的 URL地址( 可能由于网络等原因导致下载图片时间过长)**;FACE_TOKEN**: 人脸图片的唯一标识,调用人脸检测接口时,会为每个人脸图片赋予一个唯一的FACE_TOKEN,同一张图片多次检测得到的FACE_TOKEN是同一个
@param groupIdList - 从指定的group中进行查找 用逗... | [
"人脸搜索接口"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/face/AipFace.java#L77-L93 |
Impetus/Kundera | src/kundera-rdbms/src/main/java/com/impetus/client/rdbms/HibernateClient.java | HibernateClient.getFromClause | private String getFromClause(String schemaName, String tableName)
{
String clause = tableName;
if (schemaName != null && !schemaName.isEmpty())
{
clause = schemaName + "." + tableName;
}
return clause;
} | java | private String getFromClause(String schemaName, String tableName)
{
String clause = tableName;
if (schemaName != null && !schemaName.isEmpty())
{
clause = schemaName + "." + tableName;
}
return clause;
} | [
"private",
"String",
"getFromClause",
"(",
"String",
"schemaName",
",",
"String",
"tableName",
")",
"{",
"String",
"clause",
"=",
"tableName",
";",
"if",
"(",
"schemaName",
"!=",
"null",
"&&",
"!",
"schemaName",
".",
"isEmpty",
"(",
")",
")",
"{",
"clause"... | Gets the from clause.
@param schemaName
the schema name
@param tableName
the table name
@return the from clause | [
"Gets",
"the",
"from",
"clause",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-rdbms/src/main/java/com/impetus/client/rdbms/HibernateClient.java#L791-L799 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/gui/overview/OverviewPlot.java | OverviewPlot.triggerSubplotSelectEvent | protected void triggerSubplotSelectEvent(PlotItem it) {
// forward event to all listeners.
for(ActionListener actionListener : actionListeners) {
actionListener.actionPerformed(new DetailViewSelectedEvent(this, ActionEvent.ACTION_PERFORMED, null, 0, it));
}
} | java | protected void triggerSubplotSelectEvent(PlotItem it) {
// forward event to all listeners.
for(ActionListener actionListener : actionListeners) {
actionListener.actionPerformed(new DetailViewSelectedEvent(this, ActionEvent.ACTION_PERFORMED, null, 0, it));
}
} | [
"protected",
"void",
"triggerSubplotSelectEvent",
"(",
"PlotItem",
"it",
")",
"{",
"// forward event to all listeners.",
"for",
"(",
"ActionListener",
"actionListener",
":",
"actionListeners",
")",
"{",
"actionListener",
".",
"actionPerformed",
"(",
"new",
"DetailViewSele... | When a subplot was selected, forward the event to listeners.
@param it PlotItem selected | [
"When",
"a",
"subplot",
"was",
"selected",
"forward",
"the",
"event",
"to",
"listeners",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/gui/overview/OverviewPlot.java#L523-L528 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/annotations/CitrusAnnotations.java | CitrusAnnotations.injectAll | public static final void injectAll(final Object target, final Citrus citrusFramework, final TestContext context) {
injectCitrusFramework(target, citrusFramework);
injectEndpoints(target, context);
} | java | public static final void injectAll(final Object target, final Citrus citrusFramework, final TestContext context) {
injectCitrusFramework(target, citrusFramework);
injectEndpoints(target, context);
} | [
"public",
"static",
"final",
"void",
"injectAll",
"(",
"final",
"Object",
"target",
",",
"final",
"Citrus",
"citrusFramework",
",",
"final",
"TestContext",
"context",
")",
"{",
"injectCitrusFramework",
"(",
"target",
",",
"citrusFramework",
")",
";",
"injectEndpoi... | Injects all supported components and endpoints to target object using annotations.
@param target | [
"Injects",
"all",
"supported",
"components",
"and",
"endpoints",
"to",
"target",
"object",
"using",
"annotations",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/annotations/CitrusAnnotations.java#L68-L71 |
datastax/java-driver | core/src/main/java/com/datastax/oss/driver/internal/core/util/ArrayUtils.java | ArrayUtils.shuffleHead | public static <ElementT> void shuffleHead(@NonNull ElementT[] elements, int n) {
shuffleHead(elements, n, ThreadLocalRandom.current());
} | java | public static <ElementT> void shuffleHead(@NonNull ElementT[] elements, int n) {
shuffleHead(elements, n, ThreadLocalRandom.current());
} | [
"public",
"static",
"<",
"ElementT",
">",
"void",
"shuffleHead",
"(",
"@",
"NonNull",
"ElementT",
"[",
"]",
"elements",
",",
"int",
"n",
")",
"{",
"shuffleHead",
"(",
"elements",
",",
"n",
",",
"ThreadLocalRandom",
".",
"current",
"(",
")",
")",
";",
"... | Shuffles the first n elements of the array in-place.
@param elements the array to shuffle.
@param n the number of elements to shuffle; must be {@code <= elements.length}.
@see <a
href="https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm">Modern
Fisher-Yates shuffle</a> | [
"Shuffles",
"the",
"first",
"n",
"elements",
"of",
"the",
"array",
"in",
"-",
"place",
"."
] | train | https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/core/src/main/java/com/datastax/oss/driver/internal/core/util/ArrayUtils.java#L62-L64 |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java | GroupHandlerImpl.preSave | private void preSave(Group group, boolean isNew) throws Exception
{
for (GroupEventListener listener : listeners)
{
listener.preSave(group, isNew);
}
} | java | private void preSave(Group group, boolean isNew) throws Exception
{
for (GroupEventListener listener : listeners)
{
listener.preSave(group, isNew);
}
} | [
"private",
"void",
"preSave",
"(",
"Group",
"group",
",",
"boolean",
"isNew",
")",
"throws",
"Exception",
"{",
"for",
"(",
"GroupEventListener",
"listener",
":",
"listeners",
")",
"{",
"listener",
".",
"preSave",
"(",
"group",
",",
"isNew",
")",
";",
"}",
... | Notifying listeners before group creation.
@param group
the group which is used in create operation
@param isNew
true, if we have a deal with new group, otherwise it is false
which mean update operation is in progress
@throws Exception
if any listener failed to handle the event | [
"Notifying",
"listeners",
"before",
"group",
"creation",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java#L553-L559 |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java | XMLAssert.assertXMLEqual | public static void assertXMLEqual(String err, Document control,
Document test) {
Diff diff = new Diff(control, test);
assertXMLEqual(err, diff, true);
} | java | public static void assertXMLEqual(String err, Document control,
Document test) {
Diff diff = new Diff(control, test);
assertXMLEqual(err, diff, true);
} | [
"public",
"static",
"void",
"assertXMLEqual",
"(",
"String",
"err",
",",
"Document",
"control",
",",
"Document",
"test",
")",
"{",
"Diff",
"diff",
"=",
"new",
"Diff",
"(",
"control",
",",
"test",
")",
";",
"assertXMLEqual",
"(",
"err",
",",
"diff",
",",
... | Assert that two XML documents are similar
@param err Message to be displayed on assertion failure
@param control XML to be compared against
@param test XML to be tested | [
"Assert",
"that",
"two",
"XML",
"documents",
"are",
"similar"
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L242-L246 |
openbase/jul | communication/controller/src/main/java/org/openbase/jul/communication/controller/AbstractRemoteClient.java | AbstractRemoteClient.waitForData | @Override
public void waitForData(long timeout, TimeUnit timeUnit) throws CouldNotPerformException, InterruptedException {
try {
if (isDataAvailable()) {
return;
}
long startTime = System.currentTimeMillis();
getDataFuture().get(timeout, timeUn... | java | @Override
public void waitForData(long timeout, TimeUnit timeUnit) throws CouldNotPerformException, InterruptedException {
try {
if (isDataAvailable()) {
return;
}
long startTime = System.currentTimeMillis();
getDataFuture().get(timeout, timeUn... | [
"@",
"Override",
"public",
"void",
"waitForData",
"(",
"long",
"timeout",
",",
"TimeUnit",
"timeUnit",
")",
"throws",
"CouldNotPerformException",
",",
"InterruptedException",
"{",
"try",
"{",
"if",
"(",
"isDataAvailable",
"(",
")",
")",
"{",
"return",
";",
"}"... | {@inheritDoc}
@param timeout {@inheritDoc}
@param timeUnit {@inheritDoc}
@throws CouldNotPerformException {@inheritDoc}
@throws java.lang.InterruptedException {@inheritDoc} | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/communication/controller/src/main/java/org/openbase/jul/communication/controller/AbstractRemoteClient.java#L1201-L1220 |
aboutsip/pkts | pkts-sip/src/main/java/io/pkts/packet/sip/impl/SipMessageStreamBuilder.java | SipMessageStreamBuilder.onInit | private final State onInit(final Buffer buffer) {
try {
while (buffer.hasReadableBytes()) {
final byte b = buffer.peekByte();
if (b == SipParser.SP || b == SipParser.HTAB || b == SipParser.CR || b == SipParser.LF) {
buffer.readByte();
... | java | private final State onInit(final Buffer buffer) {
try {
while (buffer.hasReadableBytes()) {
final byte b = buffer.peekByte();
if (b == SipParser.SP || b == SipParser.HTAB || b == SipParser.CR || b == SipParser.LF) {
buffer.readByte();
... | [
"private",
"final",
"State",
"onInit",
"(",
"final",
"Buffer",
"buffer",
")",
"{",
"try",
"{",
"while",
"(",
"buffer",
".",
"hasReadableBytes",
"(",
")",
")",
"{",
"final",
"byte",
"b",
"=",
"buffer",
".",
"peekByte",
"(",
")",
";",
"if",
"(",
"b",
... | While in the INIT state, we are just consuming any empty space
before heading off to start parsing the initial line
@param b
@return | [
"While",
"in",
"the",
"INIT",
"state",
"we",
"are",
"just",
"consuming",
"any",
"empty",
"space",
"before",
"heading",
"off",
"to",
"start",
"parsing",
"the",
"initial",
"line"
] | train | https://github.com/aboutsip/pkts/blob/0f06bb0dac76c812187829f580a8d476ca99a1a1/pkts-sip/src/main/java/io/pkts/packet/sip/impl/SipMessageStreamBuilder.java#L241-L257 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.