repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 192 | func_name stringlengths 5 108 | whole_func_string stringlengths 75 3.91k | language stringclasses 1
value | func_code_string stringlengths 75 3.91k | func_code_tokens listlengths 21 629 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 111 306 |
|---|---|---|---|---|---|---|---|---|---|---|
eclipse/xtext-extras | org.eclipse.xtext.common.types/src/org/eclipse/xtext/common/types/access/binary/asm/SignatureUtil.java | SignatureUtil.scanTypeBoundSignature | private static int scanTypeBoundSignature(String string, int start) {
// need a minimum 1 char for wildcard
if (start >= string.length()) {
throw new IllegalArgumentException();
}
char c = string.charAt(start);
switch (c) {
case C_STAR :
return start;
case C_SUPER :
case C_EXTENDS :
// nee... | java | private static int scanTypeBoundSignature(String string, int start) {
// need a minimum 1 char for wildcard
if (start >= string.length()) {
throw new IllegalArgumentException();
}
char c = string.charAt(start);
switch (c) {
case C_STAR :
return start;
case C_SUPER :
case C_EXTENDS :
// nee... | [
"private",
"static",
"int",
"scanTypeBoundSignature",
"(",
"String",
"string",
",",
"int",
"start",
")",
"{",
"// need a minimum 1 char for wildcard",
"if",
"(",
"start",
">=",
"string",
".",
"length",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException"... | Scans the given string for a type bound signature starting at the given
index and returns the index of the last character.
<pre>
TypeBoundSignature:
<b>[-+]</b> TypeSignature <b>;</b>
<b>*</b></b>
</pre>
@param string the signature string
@param start the 0-based character index of the first character
@return the 0-ba... | [
"Scans",
"the",
"given",
"string",
"for",
"a",
"type",
"bound",
"signature",
"starting",
"at",
"the",
"given",
"index",
"and",
"returns",
"the",
"index",
"of",
"the",
"last",
"character",
".",
"<pre",
">",
"TypeBoundSignature",
":",
"<b",
">",
"[",
"-",
... | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.common.types/src/org/eclipse/xtext/common/types/access/binary/asm/SignatureUtil.java#L416-L456 |
samskivert/samskivert | src/main/java/com/samskivert/swing/util/SwingUtil.java | SwingUtil.createPointComparator | public static <P extends Point2D> Comparator<P> createPointComparator (final P origin)
{
return new Comparator<P>() {
public int compare (P p1, P p2)
{
double dist1 = origin.distance(p1);
double dist2 = origin.distance(p2);
return (dist... | java | public static <P extends Point2D> Comparator<P> createPointComparator (final P origin)
{
return new Comparator<P>() {
public int compare (P p1, P p2)
{
double dist1 = origin.distance(p1);
double dist2 = origin.distance(p2);
return (dist... | [
"public",
"static",
"<",
"P",
"extends",
"Point2D",
">",
"Comparator",
"<",
"P",
">",
"createPointComparator",
"(",
"final",
"P",
"origin",
")",
"{",
"return",
"new",
"Comparator",
"<",
"P",
">",
"(",
")",
"{",
"public",
"int",
"compare",
"(",
"P",
"p1... | Create a comparator that compares against the distance from the specified point.
Note: The comparator will continue to sort by distance from the origin point, even if the
origin point's coordinates are modified after the comparator is created.
Used by positionRect(). | [
"Create",
"a",
"comparator",
"that",
"compares",
"against",
"the",
"distance",
"from",
"the",
"specified",
"point",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/SwingUtil.java#L232-L242 |
twitter/hraven | hraven-etl/src/main/java/com/twitter/hraven/etl/JobFileProcessor.java | JobFileProcessor.runJobs | private boolean runJobs(int threadCount, List<JobRunner> jobRunners)
throws InterruptedException, ExecutionException {
ExecutorService execSvc = Executors.newFixedThreadPool(threadCount);
if ((jobRunners == null) || (jobRunners.size() == 0)) {
return true;
}
boolean success = true;
try... | java | private boolean runJobs(int threadCount, List<JobRunner> jobRunners)
throws InterruptedException, ExecutionException {
ExecutorService execSvc = Executors.newFixedThreadPool(threadCount);
if ((jobRunners == null) || (jobRunners.size() == 0)) {
return true;
}
boolean success = true;
try... | [
"private",
"boolean",
"runJobs",
"(",
"int",
"threadCount",
",",
"List",
"<",
"JobRunner",
">",
"jobRunners",
")",
"throws",
"InterruptedException",
",",
"ExecutionException",
"{",
"ExecutorService",
"execSvc",
"=",
"Executors",
".",
"newFixedThreadPool",
"(",
"thre... | Run the jobs and wait for all of them to complete.
@param threadCount up to how many jobs to run in parallel
@param jobRunners the list of jobs to run.
@return whether all jobs completed successfully or not.
@throws InterruptedException when interrupted while running jobs.
@throws ExecutionException when at least one ... | [
"Run",
"the",
"jobs",
"and",
"wait",
"for",
"all",
"of",
"them",
"to",
"complete",
"."
] | train | https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/JobFileProcessor.java#L450-L486 |
defei/codelogger-utils | src/main/java/org/codelogger/utils/StringUtils.java | StringUtils.containsWord | public static boolean containsWord(final String text, final String word) {
if (text == null || word == null) {
return false;
}
if (text.contains(word)) {
Matcher matcher = matchText(text);
for (; matcher.find();) {
String matchedWord = matcher.group(0);
if (matchedWord.equ... | java | public static boolean containsWord(final String text, final String word) {
if (text == null || word == null) {
return false;
}
if (text.contains(word)) {
Matcher matcher = matchText(text);
for (; matcher.find();) {
String matchedWord = matcher.group(0);
if (matchedWord.equ... | [
"public",
"static",
"boolean",
"containsWord",
"(",
"final",
"String",
"text",
",",
"final",
"String",
"word",
")",
"{",
"if",
"(",
"text",
"==",
"null",
"||",
"word",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"text",
".",
"cont... | Returns true if given text contains given word; false otherwise.
@param text string text to be tested.
@param word string word to be tested.
@return true if given text contains given word; false otherwise. | [
"Returns",
"true",
"if",
"given",
"text",
"contains",
"given",
"word",
";",
"false",
"otherwise",
"."
] | train | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/StringUtils.java#L254-L269 |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/map/OpenLongObjectHashMap.java | OpenLongObjectHashMap.pairsMatching | public void pairsMatching(final LongObjectProcedure condition, final LongArrayList keyList, final ObjectArrayList valueList) {
keyList.clear();
valueList.clear();
for (int i = table.length ; i-- > 0 ;) {
if (state[i]==FULL && condition.apply(table[i],values[i])) {
keyList.add(table[i]);
valueList.ad... | java | public void pairsMatching(final LongObjectProcedure condition, final LongArrayList keyList, final ObjectArrayList valueList) {
keyList.clear();
valueList.clear();
for (int i = table.length ; i-- > 0 ;) {
if (state[i]==FULL && condition.apply(table[i],values[i])) {
keyList.add(table[i]);
valueList.ad... | [
"public",
"void",
"pairsMatching",
"(",
"final",
"LongObjectProcedure",
"condition",
",",
"final",
"LongArrayList",
"keyList",
",",
"final",
"ObjectArrayList",
"valueList",
")",
"{",
"keyList",
".",
"clear",
"(",
")",
";",
"valueList",
".",
"clear",
"(",
")",
... | Fills all pairs satisfying a given condition into the specified lists.
Fills into the lists, starting at index 0.
After this call returns the specified lists both have a new size, the number of pairs satisfying the condition.
Iteration order is guaranteed to be <i>identical</i> to the order used by method {@link #forEa... | [
"Fills",
"all",
"pairs",
"satisfying",
"a",
"given",
"condition",
"into",
"the",
"specified",
"lists",
".",
"Fills",
"into",
"the",
"lists",
"starting",
"at",
"index",
"0",
".",
"After",
"this",
"call",
"returns",
"the",
"specified",
"lists",
"both",
"have",... | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/map/OpenLongObjectHashMap.java#L326-L336 |
togglz/togglz | benchmarks/src/main/java/org/togglz/benchmark/TogglzOverheadBenchmark.java | TogglzOverheadBenchmark.toggleEnabledState | @Setup(Level.Iteration)
public void toggleEnabledState() {
enabled = !enabled;
manager.setFeatureState(new FeatureState(OverheadFeature.FEATURE, enabled));
} | java | @Setup(Level.Iteration)
public void toggleEnabledState() {
enabled = !enabled;
manager.setFeatureState(new FeatureState(OverheadFeature.FEATURE, enabled));
} | [
"@",
"Setup",
"(",
"Level",
".",
"Iteration",
")",
"public",
"void",
"toggleEnabledState",
"(",
")",
"{",
"enabled",
"=",
"!",
"enabled",
";",
"manager",
".",
"setFeatureState",
"(",
"new",
"FeatureState",
"(",
"OverheadFeature",
".",
"FEATURE",
",",
"enable... | toggle the state between iterations to keep the compiler honest | [
"toggle",
"the",
"state",
"between",
"iterations",
"to",
"keep",
"the",
"compiler",
"honest"
] | train | https://github.com/togglz/togglz/blob/76d3ffbc8e3fac5a6cb566cc4afbd8dd5f06c4e5/benchmarks/src/main/java/org/togglz/benchmark/TogglzOverheadBenchmark.java#L63-L67 |
JoeKerouac/utils | src/main/java/com/joe/utils/serialize/json/JsonParser.java | JsonParser.readAsObject | @SuppressWarnings("unchecked")
public <T> T readAsObject(byte[] content, Class<T> type) {
try {
if (content == null || content.length == 0 || type == null) {
log.debug("content为{},type为:{}", content, type);
return null;
} else if (type.equals(String.cl... | java | @SuppressWarnings("unchecked")
public <T> T readAsObject(byte[] content, Class<T> type) {
try {
if (content == null || content.length == 0 || type == null) {
log.debug("content为{},type为:{}", content, type);
return null;
} else if (type.equals(String.cl... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"readAsObject",
"(",
"byte",
"[",
"]",
"content",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"try",
"{",
"if",
"(",
"content",
"==",
"null",
"||",
"content",
".",
... | 解析json
@param content json字符串
@param type json解析后对应的实体类型
@param <T> 实体类型的实际类型
@return 解析失败将返回null | [
"解析json"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/serialize/json/JsonParser.java#L139-L153 |
seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/format/standard/AddressDivisionGrouping.java | AddressDivisionGrouping.increment | protected static <R extends AddressSection, S extends AddressSegment> R increment(
R section,
long increment,
AddressCreator<?, R, ?, S> addrCreator,
long count,
long lowerValue,
long upperValue,
Supplier<R> lowerProducer,
Supplier<R> upperProducer,
Integer prefixLength) {
if(!section.isMu... | java | protected static <R extends AddressSection, S extends AddressSegment> R increment(
R section,
long increment,
AddressCreator<?, R, ?, S> addrCreator,
long count,
long lowerValue,
long upperValue,
Supplier<R> lowerProducer,
Supplier<R> upperProducer,
Integer prefixLength) {
if(!section.isMu... | [
"protected",
"static",
"<",
"R",
"extends",
"AddressSection",
",",
"S",
"extends",
"AddressSegment",
">",
"R",
"increment",
"(",
"R",
"section",
",",
"long",
"increment",
",",
"AddressCreator",
"<",
"?",
",",
"R",
",",
"?",
",",
"S",
">",
"addrCreator",
... | this does not handle overflow, overflow should be checked before calling this | [
"this",
"does",
"not",
"handle",
"overflow",
"overflow",
"should",
"be",
"checked",
"before",
"calling",
"this"
] | train | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/standard/AddressDivisionGrouping.java#L1132-L1160 |
strator-dev/greenpepper | greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/velocity/ConfluenceGreenPepper.java | ConfluenceGreenPepper.saveExecuteChildren | public void saveExecuteChildren(Page page, Boolean doExecuteChildren) {
ContentEntityObject entityObject = getContentEntityManager().getById(page.getId());
getContentPropertyManager().setStringProperty(entityObject, ConfluenceGreenPepper.EXECUTE_CHILDREN, doExecuteChildren != null ? String.valueOf(doExe... | java | public void saveExecuteChildren(Page page, Boolean doExecuteChildren) {
ContentEntityObject entityObject = getContentEntityManager().getById(page.getId());
getContentPropertyManager().setStringProperty(entityObject, ConfluenceGreenPepper.EXECUTE_CHILDREN, doExecuteChildren != null ? String.valueOf(doExe... | [
"public",
"void",
"saveExecuteChildren",
"(",
"Page",
"page",
",",
"Boolean",
"doExecuteChildren",
")",
"{",
"ContentEntityObject",
"entityObject",
"=",
"getContentEntityManager",
"(",
")",
".",
"getById",
"(",
"page",
".",
"getId",
"(",
")",
")",
";",
"getConte... | <p>saveExecuteChildren.</p>
@param page a {@link com.atlassian.confluence.pages.Page} object.
@param doExecuteChildren a {@link java.lang.Boolean} object. | [
"<p",
">",
"saveExecuteChildren",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/velocity/ConfluenceGreenPepper.java#L676-L679 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailpro/src/main/java/net/minidev/ovh/api/ApiOvhEmailpro.java | ApiOvhEmailpro.service_account_email_alias_alias_GET | public OvhAccountAlias service_account_email_alias_alias_GET(String service, String email, String alias) throws IOException {
String qPath = "/email/pro/{service}/account/{email}/alias/{alias}";
StringBuilder sb = path(qPath, service, email, alias);
String resp = exec(qPath, "GET", sb.toString(), null);
return ... | java | public OvhAccountAlias service_account_email_alias_alias_GET(String service, String email, String alias) throws IOException {
String qPath = "/email/pro/{service}/account/{email}/alias/{alias}";
StringBuilder sb = path(qPath, service, email, alias);
String resp = exec(qPath, "GET", sb.toString(), null);
return ... | [
"public",
"OvhAccountAlias",
"service_account_email_alias_alias_GET",
"(",
"String",
"service",
",",
"String",
"email",
",",
"String",
"alias",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/pro/{service}/account/{email}/alias/{alias}\"",
";",
"StringB... | Get this object properties
REST: GET /email/pro/{service}/account/{email}/alias/{alias}
@param service [required] The internal name of your pro organization
@param email [required] Default email for this mailbox
@param alias [required] Alias
API beta | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailpro/src/main/java/net/minidev/ovh/api/ApiOvhEmailpro.java#L487-L492 |
bladecoder/blade-ink | src/main/java/com/bladecoder/ink/runtime/Story.java | Story.observeVariable | public void observeVariable(String variableName, VariableObserver observer) throws StoryException, Exception {
ifAsyncWeCant("observe a new variable");
if (variableObservers == null)
variableObservers = new HashMap<String, List<VariableObserver>>();
if (!state.getVariablesState().globalVariableExistsWithName... | java | public void observeVariable(String variableName, VariableObserver observer) throws StoryException, Exception {
ifAsyncWeCant("observe a new variable");
if (variableObservers == null)
variableObservers = new HashMap<String, List<VariableObserver>>();
if (!state.getVariablesState().globalVariableExistsWithName... | [
"public",
"void",
"observeVariable",
"(",
"String",
"variableName",
",",
"VariableObserver",
"observer",
")",
"throws",
"StoryException",
",",
"Exception",
"{",
"ifAsyncWeCant",
"(",
"\"observe a new variable\"",
")",
";",
"if",
"(",
"variableObservers",
"==",
"null",... | When the named global variable changes it's value, the observer will be
called to notify it of the change. Note that if the value changes multiple
times within the ink, the observer will only be called once, at the end of
the ink's evaluation. If, during the evaluation, it changes and then changes
back again to its ori... | [
"When",
"the",
"named",
"global",
"variable",
"changes",
"it",
"s",
"value",
"the",
"observer",
"will",
"be",
"called",
"to",
"notify",
"it",
"of",
"the",
"change",
".",
"Note",
"that",
"if",
"the",
"value",
"changes",
"multiple",
"times",
"within",
"the",... | train | https://github.com/bladecoder/blade-ink/blob/930922099f7073f50f956479adaa3cbd47c70225/src/main/java/com/bladecoder/ink/runtime/Story.java#L1039-L1056 |
RestComm/media-core | network/src/main/java/org/restcomm/media/core/network/netty/NettyNetworkManager.java | NettyNetworkManager.openChannel | @Override
public Channel openChannel() throws IOException, IllegalStateException {
assertOpen();
try {
return this.bootstrap.clone().register().sync().channel();
} catch (Exception e) {
throw new IOException("Could not open channel.", e);
}
} | java | @Override
public Channel openChannel() throws IOException, IllegalStateException {
assertOpen();
try {
return this.bootstrap.clone().register().sync().channel();
} catch (Exception e) {
throw new IOException("Could not open channel.", e);
}
} | [
"@",
"Override",
"public",
"Channel",
"openChannel",
"(",
")",
"throws",
"IOException",
",",
"IllegalStateException",
"{",
"assertOpen",
"(",
")",
";",
"try",
"{",
"return",
"this",
".",
"bootstrap",
".",
"clone",
"(",
")",
".",
"register",
"(",
")",
".",
... | {@inheritDoc}
@throws IllegalStateException If manager is already closed. | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/network/src/main/java/org/restcomm/media/core/network/netty/NettyNetworkManager.java#L79-L87 |
amaembo/streamex | src/main/java/one/util/streamex/LongStreamEx.java | LongStreamEx.maxByInt | public OptionalLong maxByInt(LongToIntFunction keyExtractor) {
return collect(PrimitiveBox::new, (box, l) -> {
int key = keyExtractor.applyAsInt(l);
if (!box.b || box.i < key) {
box.b = true;
box.i = key;
box.l = l;
}
... | java | public OptionalLong maxByInt(LongToIntFunction keyExtractor) {
return collect(PrimitiveBox::new, (box, l) -> {
int key = keyExtractor.applyAsInt(l);
if (!box.b || box.i < key) {
box.b = true;
box.i = key;
box.l = l;
}
... | [
"public",
"OptionalLong",
"maxByInt",
"(",
"LongToIntFunction",
"keyExtractor",
")",
"{",
"return",
"collect",
"(",
"PrimitiveBox",
"::",
"new",
",",
"(",
"box",
",",
"l",
")",
"->",
"{",
"int",
"key",
"=",
"keyExtractor",
".",
"applyAsInt",
"(",
"l",
")",... | Returns the maximum element of this stream according to the provided key
extractor function.
<p>
This is a terminal operation.
@param keyExtractor a non-interfering, stateless function
@return an {@code OptionalLong} describing the first element of this
stream for which the highest value was returned by key extractor... | [
"Returns",
"the",
"maximum",
"element",
"of",
"this",
"stream",
"according",
"to",
"the",
"provided",
"key",
"extractor",
"function",
"."
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/LongStreamEx.java#L1065-L1074 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/RandomUtils.java | RandomUtils.nextFloat | public static float nextFloat(final float startInclusive, final float endInclusive) {
Validate.isTrue(endInclusive >= startInclusive,
"Start value must be smaller or equal to end value.");
Validate.isTrue(startInclusive >= 0, "Both range values must be non-negative.");
if (start... | java | public static float nextFloat(final float startInclusive, final float endInclusive) {
Validate.isTrue(endInclusive >= startInclusive,
"Start value must be smaller or equal to end value.");
Validate.isTrue(startInclusive >= 0, "Both range values must be non-negative.");
if (start... | [
"public",
"static",
"float",
"nextFloat",
"(",
"final",
"float",
"startInclusive",
",",
"final",
"float",
"endInclusive",
")",
"{",
"Validate",
".",
"isTrue",
"(",
"endInclusive",
">=",
"startInclusive",
",",
"\"Start value must be smaller or equal to end value.\"",
")"... | <p>
Returns a random float within the specified range.
</p>
@param startInclusive
the smallest value that can be returned, must be non-negative
@param endInclusive
the upper bound (included)
@throws IllegalArgumentException
if {@code startInclusive > endInclusive} or if
{@code startInclusive} is negative
@return the r... | [
"<p",
">",
"Returns",
"a",
"random",
"float",
"within",
"the",
"specified",
"range",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/RandomUtils.java#L205-L215 |
apache/incubator-gobblin | gobblin-core/src/main/java/org/apache/gobblin/source/extractor/watermark/DateWatermark.java | DateWatermark.adjustWatermark | public static long adjustWatermark(String baseWatermark, int diff) {
SimpleDateFormat parser = new SimpleDateFormat(INPUTFORMAT);
Date date = Utils.toDate(baseWatermark, INPUTFORMAT, OUTPUTFORMAT);
return Long.parseLong(parser.format(Utils.addDaysToDate(date, diff)));
} | java | public static long adjustWatermark(String baseWatermark, int diff) {
SimpleDateFormat parser = new SimpleDateFormat(INPUTFORMAT);
Date date = Utils.toDate(baseWatermark, INPUTFORMAT, OUTPUTFORMAT);
return Long.parseLong(parser.format(Utils.addDaysToDate(date, diff)));
} | [
"public",
"static",
"long",
"adjustWatermark",
"(",
"String",
"baseWatermark",
",",
"int",
"diff",
")",
"{",
"SimpleDateFormat",
"parser",
"=",
"new",
"SimpleDateFormat",
"(",
"INPUTFORMAT",
")",
";",
"Date",
"date",
"=",
"Utils",
".",
"toDate",
"(",
"baseWate... | Adjust the given watermark by diff
@param baseWatermark the original watermark
@param diff the amount to change
@return the adjusted watermark value | [
"Adjust",
"the",
"given",
"watermark",
"by",
"diff"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/source/extractor/watermark/DateWatermark.java#L162-L166 |
landawn/AbacusUtil | src/com/landawn/abacus/util/JdbcUtil.java | JdbcUtil.importData | public static int importData(final DataSet dataset, final Connection conn, final String insertSQL,
final Try.BiConsumer<? super PreparedStatement, ? super Object[], SQLException> stmtSetter) throws UncheckedSQLException {
return importData(dataset, 0, dataset.size(), conn, insertSQL, stmtSetter);
... | java | public static int importData(final DataSet dataset, final Connection conn, final String insertSQL,
final Try.BiConsumer<? super PreparedStatement, ? super Object[], SQLException> stmtSetter) throws UncheckedSQLException {
return importData(dataset, 0, dataset.size(), conn, insertSQL, stmtSetter);
... | [
"public",
"static",
"int",
"importData",
"(",
"final",
"DataSet",
"dataset",
",",
"final",
"Connection",
"conn",
",",
"final",
"String",
"insertSQL",
",",
"final",
"Try",
".",
"BiConsumer",
"<",
"?",
"super",
"PreparedStatement",
",",
"?",
"super",
"Object",
... | Imports the data from <code>DataSet</code> to database.
@param dataset
@param conn
@param insertSQL the column order in the sql must be consistent with the column order in the DataSet. Here is sample about how to create the sql:
<pre><code>
List<String> columnNameList = new ArrayList<>(dataset.columnNameList());
colum... | [
"Imports",
"the",
"data",
"from",
"<code",
">",
"DataSet<",
"/",
"code",
">",
"to",
"database",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/JdbcUtil.java#L2081-L2084 |
netty/netty | transport-native-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueChannel.java | AbstractKQueueChannel.newDirectBuffer | protected final ByteBuf newDirectBuffer(Object holder, ByteBuf buf) {
final int readableBytes = buf.readableBytes();
if (readableBytes == 0) {
ReferenceCountUtil.release(holder);
return Unpooled.EMPTY_BUFFER;
}
final ByteBufAllocator alloc = alloc();
if (... | java | protected final ByteBuf newDirectBuffer(Object holder, ByteBuf buf) {
final int readableBytes = buf.readableBytes();
if (readableBytes == 0) {
ReferenceCountUtil.release(holder);
return Unpooled.EMPTY_BUFFER;
}
final ByteBufAllocator alloc = alloc();
if (... | [
"protected",
"final",
"ByteBuf",
"newDirectBuffer",
"(",
"Object",
"holder",
",",
"ByteBuf",
"buf",
")",
"{",
"final",
"int",
"readableBytes",
"=",
"buf",
".",
"readableBytes",
"(",
")",
";",
"if",
"(",
"readableBytes",
"==",
"0",
")",
"{",
"ReferenceCountUt... | Returns an off-heap copy of the specified {@link ByteBuf}, and releases the specified holder.
The caller must ensure that the holder releases the original {@link ByteBuf} when the holder is released by
this method. | [
"Returns",
"an",
"off",
"-",
"heap",
"copy",
"of",
"the",
"specified",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueChannel.java#L210-L230 |
Alluxio/alluxio | core/common/src/main/java/alluxio/grpc/GrpcServerBuilder.java | GrpcServerBuilder.forAddress | public static GrpcServerBuilder forAddress(String hostName, SocketAddress address,
AlluxioConfiguration conf) {
return new GrpcServerBuilder(hostName, address, null, conf);
} | java | public static GrpcServerBuilder forAddress(String hostName, SocketAddress address,
AlluxioConfiguration conf) {
return new GrpcServerBuilder(hostName, address, null, conf);
} | [
"public",
"static",
"GrpcServerBuilder",
"forAddress",
"(",
"String",
"hostName",
",",
"SocketAddress",
"address",
",",
"AlluxioConfiguration",
"conf",
")",
"{",
"return",
"new",
"GrpcServerBuilder",
"(",
"hostName",
",",
"address",
",",
"null",
",",
"conf",
")",
... | Create an new instance of {@link GrpcServerBuilder} with authentication support.
@param hostName the host name
@param address the address
@param conf Alluxio configuration
@return a new instance of {@link GrpcServerBuilder} | [
"Create",
"an",
"new",
"instance",
"of",
"{",
"@link",
"GrpcServerBuilder",
"}",
"with",
"authentication",
"support",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/grpc/GrpcServerBuilder.java#L74-L77 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java | GVRVertexBuffer.setIntArray | public void setIntArray(String attributeName, int[] data)
{
if (!NativeVertexBuffer.setIntArray(getNative(), attributeName, data, 0, 0))
{
throw new IllegalArgumentException("Attribute name " + attributeName + " cannot be updated");
}
} | java | public void setIntArray(String attributeName, int[] data)
{
if (!NativeVertexBuffer.setIntArray(getNative(), attributeName, data, 0, 0))
{
throw new IllegalArgumentException("Attribute name " + attributeName + " cannot be updated");
}
} | [
"public",
"void",
"setIntArray",
"(",
"String",
"attributeName",
",",
"int",
"[",
"]",
"data",
")",
"{",
"if",
"(",
"!",
"NativeVertexBuffer",
".",
"setIntArray",
"(",
"getNative",
"(",
")",
",",
"attributeName",
",",
"data",
",",
"0",
",",
"0",
")",
"... | Updates a vertex attribute from an integer array.
All of the entries of the input integer array are copied into
the storage for the named vertex attribute. Other vertex
attributes are not affected.
The attribute name must be one of the attributes named
in the descriptor passed to the constructor.
<p>
All vertex attribu... | [
"Updates",
"a",
"vertex",
"attribute",
"from",
"an",
"integer",
"array",
".",
"All",
"of",
"the",
"entries",
"of",
"the",
"input",
"integer",
"array",
"are",
"copied",
"into",
"the",
"storage",
"for",
"the",
"named",
"vertex",
"attribute",
".",
"Other",
"v... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java#L254-L260 |
undertow-io/undertow | core/src/main/java/io/undertow/server/HttpServerExchange.java | HttpServerExchange.getRequestChannel | public StreamSourceChannel getRequestChannel() {
if (requestChannel != null) {
if(anyAreSet(state, FLAG_REQUEST_RESET)) {
state &= ~FLAG_REQUEST_RESET;
return requestChannel;
}
return null;
}
if (anyAreSet(state, FLAG_REQUEST_TE... | java | public StreamSourceChannel getRequestChannel() {
if (requestChannel != null) {
if(anyAreSet(state, FLAG_REQUEST_RESET)) {
state &= ~FLAG_REQUEST_RESET;
return requestChannel;
}
return null;
}
if (anyAreSet(state, FLAG_REQUEST_TE... | [
"public",
"StreamSourceChannel",
"getRequestChannel",
"(",
")",
"{",
"if",
"(",
"requestChannel",
"!=",
"null",
")",
"{",
"if",
"(",
"anyAreSet",
"(",
"state",
",",
"FLAG_REQUEST_RESET",
")",
")",
"{",
"state",
"&=",
"~",
"FLAG_REQUEST_RESET",
";",
"return",
... | Get the inbound request. If there is no request body, calling this method
may cause the next request to immediately be processed. The {@link StreamSourceChannel#close()} or {@link StreamSourceChannel#shutdownReads()}
method must be called at some point after the request is processed to prevent resource leakage and to... | [
"Get",
"the",
"inbound",
"request",
".",
"If",
"there",
"is",
"no",
"request",
"body",
"calling",
"this",
"method",
"may",
"cause",
"the",
"next",
"request",
"to",
"immediately",
"be",
"processed",
".",
"The",
"{",
"@link",
"StreamSourceChannel#close",
"()",
... | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/HttpServerExchange.java#L1194-L1213 |
SonarSource/sonarqube | sonar-core/src/main/java/org/sonar/core/util/stream/MoreCollectors.java | MoreCollectors.uniqueIndex | public static <K, E> Collector<E, Map<K, E>, ImmutableMap<K, E>> uniqueIndex(Function<? super E, K> keyFunction) {
return uniqueIndex(keyFunction, Function.<E>identity());
} | java | public static <K, E> Collector<E, Map<K, E>, ImmutableMap<K, E>> uniqueIndex(Function<? super E, K> keyFunction) {
return uniqueIndex(keyFunction, Function.<E>identity());
} | [
"public",
"static",
"<",
"K",
",",
"E",
">",
"Collector",
"<",
"E",
",",
"Map",
"<",
"K",
",",
"E",
">",
",",
"ImmutableMap",
"<",
"K",
",",
"E",
">",
">",
"uniqueIndex",
"(",
"Function",
"<",
"?",
"super",
"E",
",",
"K",
">",
"keyFunction",
")... | Creates an {@link ImmutableMap} from the stream where the values are the values in the stream and the keys are the
result of the provided {@link Function keyFunction} applied to each value in the stream.
<p>
The {@link Function keyFunction} must return a unique (according to the key's type {@link Object#equals(Object)... | [
"Creates",
"an",
"{",
"@link",
"ImmutableMap",
"}",
"from",
"the",
"stream",
"where",
"the",
"values",
"are",
"the",
"values",
"in",
"the",
"stream",
"and",
"the",
"keys",
"are",
"the",
"result",
"of",
"the",
"provided",
"{",
"@link",
"Function",
"keyFunct... | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-core/src/main/java/org/sonar/core/util/stream/MoreCollectors.java#L186-L188 |
vznet/mongo-jackson-mapper | src/main/java/net/vz/mongodb/jackson/JacksonDBCollection.java | JacksonDBCollection.getCount | public long getCount(T query, T fields, long limit, long skip) throws MongoException {
return dbCollection.getCount(convertToBasicDbObject(query), convertToBasicDbObject(fields), limit, skip);
} | java | public long getCount(T query, T fields, long limit, long skip) throws MongoException {
return dbCollection.getCount(convertToBasicDbObject(query), convertToBasicDbObject(fields), limit, skip);
} | [
"public",
"long",
"getCount",
"(",
"T",
"query",
",",
"T",
"fields",
",",
"long",
"limit",
",",
"long",
"skip",
")",
"throws",
"MongoException",
"{",
"return",
"dbCollection",
".",
"getCount",
"(",
"convertToBasicDbObject",
"(",
"query",
")",
",",
"convertTo... | Returns the number of documents in the collection
that match the specified query
@param query query to select documents to count
@param fields fields to return
@param limit limit the count to this value
@param skip number of entries to skip
@return number of documents that match query and fields
@throws MongoExcep... | [
"Returns",
"the",
"number",
"of",
"documents",
"in",
"the",
"collection",
"that",
"match",
"the",
"specified",
"query"
] | train | https://github.com/vznet/mongo-jackson-mapper/blob/ecd189aefa89636cddf70fb383f5d676be347976/src/main/java/net/vz/mongodb/jackson/JacksonDBCollection.java#L1150-L1152 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.getCertificateAsync | public ServiceFuture<CertificateBundle> getCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion, final ServiceCallback<CertificateBundle> serviceCallback) {
return ServiceFuture.fromResponse(getCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersi... | java | public ServiceFuture<CertificateBundle> getCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion, final ServiceCallback<CertificateBundle> serviceCallback) {
return ServiceFuture.fromResponse(getCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersi... | [
"public",
"ServiceFuture",
"<",
"CertificateBundle",
">",
"getCertificateAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"certificateName",
",",
"String",
"certificateVersion",
",",
"final",
"ServiceCallback",
"<",
"CertificateBundle",
">",
"serviceCallback",
")",
... | Gets information about a certificate.
Gets information about a specific certificate. This operation requires the certificates/get permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param certificateName The name of the certificate in the given vault.
@param certificateVersion... | [
"Gets",
"information",
"about",
"a",
"certificate",
".",
"Gets",
"information",
"about",
"a",
"specific",
"certificate",
".",
"This",
"operation",
"requires",
"the",
"certificates",
"/",
"get",
"permission",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L7561-L7563 |
CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java | DBAdapter.deleteMessageForId | synchronized boolean deleteMessageForId(String messageId, String userId){
if(messageId == null || userId == null) return false;
final String tName = Table.INBOX_MESSAGES.getName();
try {
final SQLiteDatabase db = dbHelper.getWritableDatabase();
db.delete(tName, _ID + " ... | java | synchronized boolean deleteMessageForId(String messageId, String userId){
if(messageId == null || userId == null) return false;
final String tName = Table.INBOX_MESSAGES.getName();
try {
final SQLiteDatabase db = dbHelper.getWritableDatabase();
db.delete(tName, _ID + " ... | [
"synchronized",
"boolean",
"deleteMessageForId",
"(",
"String",
"messageId",
",",
"String",
"userId",
")",
"{",
"if",
"(",
"messageId",
"==",
"null",
"||",
"userId",
"==",
"null",
")",
"return",
"false",
";",
"final",
"String",
"tName",
"=",
"Table",
".",
... | Deletes the inbox message for given messageId
@param messageId String messageId
@return boolean value based on success of operation | [
"Deletes",
"the",
"inbox",
"message",
"for",
"given",
"messageId"
] | train | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java#L672-L687 |
vkostyukov/la4j | src/main/java/org/la4j/matrix/SparseMatrix.java | SparseMatrix.eachNonZeroInRow | public void eachNonZeroInRow(int i, VectorProcedure procedure) {
VectorIterator it = nonZeroIteratorOfRow(i);
while (it.hasNext()) {
double x = it.next();
int j = it.index();
procedure.apply(j, x);
}
} | java | public void eachNonZeroInRow(int i, VectorProcedure procedure) {
VectorIterator it = nonZeroIteratorOfRow(i);
while (it.hasNext()) {
double x = it.next();
int j = it.index();
procedure.apply(j, x);
}
} | [
"public",
"void",
"eachNonZeroInRow",
"(",
"int",
"i",
",",
"VectorProcedure",
"procedure",
")",
"{",
"VectorIterator",
"it",
"=",
"nonZeroIteratorOfRow",
"(",
"i",
")",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"{",
"double",
"x",
"=",
"it... | Applies the given {@code procedure} to each non-zero element of the specified row of this matrix.
@param i the row index.
@param procedure the {@link VectorProcedure}. | [
"Applies",
"the",
"given",
"{",
"@code",
"procedure",
"}",
"to",
"each",
"non",
"-",
"zero",
"element",
"of",
"the",
"specified",
"row",
"of",
"this",
"matrix",
"."
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/matrix/SparseMatrix.java#L307-L315 |
dkpro/dkpro-argumentation | dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java | JCasUtil2.getPrecedingSentences | public static List<Sentence> getPrecedingSentences(JCas jCas, Sentence annotation)
{
List<Sentence> result = new ArrayList<Sentence>();
for (Sentence sentence : JCasUtil.select(getInitialView(jCas), Sentence.class)) {
if (sentence.getBegin() < annotation.getBegin()) {
re... | java | public static List<Sentence> getPrecedingSentences(JCas jCas, Sentence annotation)
{
List<Sentence> result = new ArrayList<Sentence>();
for (Sentence sentence : JCasUtil.select(getInitialView(jCas), Sentence.class)) {
if (sentence.getBegin() < annotation.getBegin()) {
re... | [
"public",
"static",
"List",
"<",
"Sentence",
">",
"getPrecedingSentences",
"(",
"JCas",
"jCas",
",",
"Sentence",
"annotation",
")",
"{",
"List",
"<",
"Sentence",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"Sentence",
">",
"(",
")",
";",
"for",
"(",
"Se... | Returns a list of annotations of the same type preceding the given annotation
@param jCas jcas
@param annotation sentence
@return list of sentences sorted incrementally by position | [
"Returns",
"a",
"list",
"of",
"annotations",
"of",
"the",
"same",
"type",
"preceding",
"the",
"given",
"annotation"
] | train | https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java#L408-L427 |
ops4j/org.ops4j.pax.logging | pax-logging-service/src/main/java/org/apache/log4j/rule/LikeRule.java | LikeRule.getRule | public static Rule getRule(final String field, final String pattern) {
try {
return new LikeRule(field, Pattern.compile(pattern, Pattern.CASE_INSENSITIVE));
} catch (PatternSyntaxException e) {
throw new IllegalArgumentException(
"Invalid LIKE rule - " + e.getMessage());
}
... | java | public static Rule getRule(final String field, final String pattern) {
try {
return new LikeRule(field, Pattern.compile(pattern, Pattern.CASE_INSENSITIVE));
} catch (PatternSyntaxException e) {
throw new IllegalArgumentException(
"Invalid LIKE rule - " + e.getMessage());
}
... | [
"public",
"static",
"Rule",
"getRule",
"(",
"final",
"String",
"field",
",",
"final",
"String",
"pattern",
")",
"{",
"try",
"{",
"return",
"new",
"LikeRule",
"(",
"field",
",",
"Pattern",
".",
"compile",
"(",
"pattern",
",",
"Pattern",
".",
"CASE_INSENSITI... | Create new instance.
@param field field
@param pattern pattern
@return new instance | [
"Create",
"new",
"instance",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/rule/LikeRule.java#L100-L107 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/persist/HsqlProperties.java | HsqlProperties.addError | private void addError(int code, String key) {
errorCodes = (int[]) ArrayUtil.resizeArray(errorCodes,
errorCodes.length + 1);
errorKeys = (String[]) ArrayUtil.resizeArray(errorKeys,
errorKeys.length + 1);
errorCodes[errorCodes.length - 1] = code;
errorKeys... | java | private void addError(int code, String key) {
errorCodes = (int[]) ArrayUtil.resizeArray(errorCodes,
errorCodes.length + 1);
errorKeys = (String[]) ArrayUtil.resizeArray(errorKeys,
errorKeys.length + 1);
errorCodes[errorCodes.length - 1] = code;
errorKeys... | [
"private",
"void",
"addError",
"(",
"int",
"code",
",",
"String",
"key",
")",
"{",
"errorCodes",
"=",
"(",
"int",
"[",
"]",
")",
"ArrayUtil",
".",
"resizeArray",
"(",
"errorCodes",
",",
"errorCodes",
".",
"length",
"+",
"1",
")",
";",
"errorKeys",
"=",... | Adds the error code and the key to the list of errors. This list
is populated during construction or addition of elements and is used
outside this class to act upon the errors. | [
"Adds",
"the",
"error",
"code",
"and",
"the",
"key",
"to",
"the",
"list",
"of",
"errors",
".",
"This",
"list",
"is",
"populated",
"during",
"construction",
"or",
"addition",
"of",
"elements",
"and",
"is",
"used",
"outside",
"this",
"class",
"to",
"act",
... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/persist/HsqlProperties.java#L315-L323 |
amplexus/java-flac-encoder | src/main/java/net/sourceforge/javaflacencoder/EncodedElement.java | EncodedElement.addInt | public EncodedElement addInt(int input, int bitCount) {
if(next != null) {
EncodedElement end = EncodedElement.getEnd_S(next);
return end.addInt(input, bitCount);
}
else if(data.length*8 < usableBits+bitCount) {
//create child and attach to next.
//Set child's offset appropriately(i.... | java | public EncodedElement addInt(int input, int bitCount) {
if(next != null) {
EncodedElement end = EncodedElement.getEnd_S(next);
return end.addInt(input, bitCount);
}
else if(data.length*8 < usableBits+bitCount) {
//create child and attach to next.
//Set child's offset appropriately(i.... | [
"public",
"EncodedElement",
"addInt",
"(",
"int",
"input",
",",
"int",
"bitCount",
")",
"{",
"if",
"(",
"next",
"!=",
"null",
")",
"{",
"EncodedElement",
"end",
"=",
"EncodedElement",
".",
"getEnd_S",
"(",
"next",
")",
";",
"return",
"end",
".",
"addInt"... | Add a number of bits from an int to the end of this list's data. Will
add a new element if necessary. The bits stored are taken from the lower-
order of input.
@param input Int containing bits to append to end.
@param bitCount Number of bits to append.
@return EncodedElement which actually contains the appended value. | [
"Add",
"a",
"number",
"of",
"bits",
"from",
"an",
"int",
"to",
"the",
"end",
"of",
"this",
"list",
"s",
"data",
".",
"Will",
"add",
"a",
"new",
"element",
"if",
"necessary",
".",
"The",
"bits",
"stored",
"are",
"taken",
"from",
"the",
"lower",
"-",
... | train | https://github.com/amplexus/java-flac-encoder/blob/3d536b877dee2a3fd4ab2e0d9569e292cae93bc9/src/main/java/net/sourceforge/javaflacencoder/EncodedElement.java#L326-L360 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/text/StrBuilder.java | StrBuilder.replaceFirst | public StrBuilder replaceFirst(final StrMatcher matcher, final String replaceStr) {
return replace(matcher, replaceStr, 0, size, 1);
} | java | public StrBuilder replaceFirst(final StrMatcher matcher, final String replaceStr) {
return replace(matcher, replaceStr, 0, size, 1);
} | [
"public",
"StrBuilder",
"replaceFirst",
"(",
"final",
"StrMatcher",
"matcher",
",",
"final",
"String",
"replaceStr",
")",
"{",
"return",
"replace",
"(",
"matcher",
",",
"replaceStr",
",",
"0",
",",
"size",
",",
"1",
")",
";",
"}"
] | Replaces the first match within the builder with the replace string.
<p>
Matchers can be used to perform advanced replace behaviour.
For example you could write a matcher to replace
where the character 'a' is followed by a number.
@param matcher the matcher to use to find the deletion, null causes no action
@param re... | [
"Replaces",
"the",
"first",
"match",
"within",
"the",
"builder",
"with",
"the",
"replace",
"string",
".",
"<p",
">",
"Matchers",
"can",
"be",
"used",
"to",
"perform",
"advanced",
"replace",
"behaviour",
".",
"For",
"example",
"you",
"could",
"write",
"a",
... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L2065-L2067 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java | Error.classesAbsent | public static void classesAbsent(String fieldName,Class<?> aClass){
throw new MappingErrorException(MSG.INSTANCE.message(mappingErrorRelationalException2,fieldName, aClass.getSimpleName()));
} | java | public static void classesAbsent(String fieldName,Class<?> aClass){
throw new MappingErrorException(MSG.INSTANCE.message(mappingErrorRelationalException2,fieldName, aClass.getSimpleName()));
} | [
"public",
"static",
"void",
"classesAbsent",
"(",
"String",
"fieldName",
",",
"Class",
"<",
"?",
">",
"aClass",
")",
"{",
"throw",
"new",
"MappingErrorException",
"(",
"MSG",
".",
"INSTANCE",
".",
"message",
"(",
"mappingErrorRelationalException2",
",",
"fieldNa... | Thrown if the configured field hasn't classes parameter.
@param fieldName name of the field
@param aClass class's field | [
"Thrown",
"if",
"the",
"configured",
"field",
"hasn",
"t",
"classes",
"parameter",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java#L558-L560 |
haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/util/CollectionUtil.java | CollectionUtil.subArray | @SuppressWarnings({"SuspiciousSystemArraycopy"})
public static Object subArray(Object pArray, int pStart, int pLength) {
Validate.notNull(pArray, "array");
// Get component type
Class type;
// Sanity check start index
if (pStart < 0) {
throw new ArrayIn... | java | @SuppressWarnings({"SuspiciousSystemArraycopy"})
public static Object subArray(Object pArray, int pStart, int pLength) {
Validate.notNull(pArray, "array");
// Get component type
Class type;
// Sanity check start index
if (pStart < 0) {
throw new ArrayIn... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"SuspiciousSystemArraycopy\"",
"}",
")",
"public",
"static",
"Object",
"subArray",
"(",
"Object",
"pArray",
",",
"int",
"pStart",
",",
"int",
"pLength",
")",
"{",
"Validate",
".",
"notNull",
"(",
"pArray",
",",
"\"array\"",... | Creates an array containing a subset of the original array.
If the {@code pLength} parameter is negative, it will be ignored.
If there are not {@code pLength} elements in the original array
after {@code pStart}, the {@code pLength} parameter will be
ignored.
If the sub array is same length as the original, the original... | [
"Creates",
"an",
"array",
"containing",
"a",
"subset",
"of",
"the",
"original",
"array",
".",
"If",
"the",
"{",
"@code",
"pLength",
"}",
"parameter",
"is",
"negative",
"it",
"will",
"be",
"ignored",
".",
"If",
"there",
"are",
"not",
"{",
"@code",
"pLengt... | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/util/CollectionUtil.java#L314-L355 |
Samsung/GearVRf | GVRf/Extensions/gvrf-physics/src/main/java/org/gearvrf/physics/GVRRigidBody.java | GVRRigidBody.setAngularVelocity | public void setAngularVelocity(float x, float y, float z) {
Native3DRigidBody.setAngularVelocity(getNative(), x, y, z);
} | java | public void setAngularVelocity(float x, float y, float z) {
Native3DRigidBody.setAngularVelocity(getNative(), x, y, z);
} | [
"public",
"void",
"setAngularVelocity",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"Native3DRigidBody",
".",
"setAngularVelocity",
"(",
"getNative",
"(",
")",
",",
"x",
",",
"y",
",",
"z",
")",
";",
"}"
] | Sets an angular velocity [X, Y, Z] on this {@linkplain GVRRigidBody rigid body}
@param x factor on the 'X' axis.
@param y factor on the 'Y' axis.
@param z factor on the 'Z' axis. | [
"Sets",
"an",
"angular",
"velocity",
"[",
"X",
"Y",
"Z",
"]",
"on",
"this",
"{",
"@linkplain",
"GVRRigidBody",
"rigid",
"body",
"}"
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/gvrf-physics/src/main/java/org/gearvrf/physics/GVRRigidBody.java#L319-L321 |
Azure/azure-sdk-for-java | datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/AccountsInner.java | AccountsInner.listAsync | public Observable<Page<DataLakeAnalyticsAccountBasicInner>> listAsync(final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) {
return listWithServiceResponseAsync(filter, top, skip, select, orderby, count)
.map(new Func1<ServiceRes... | java | public Observable<Page<DataLakeAnalyticsAccountBasicInner>> listAsync(final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) {
return listWithServiceResponseAsync(filter, top, skip, select, orderby, count)
.map(new Func1<ServiceRes... | [
"public",
"Observable",
"<",
"Page",
"<",
"DataLakeAnalyticsAccountBasicInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"filter",
",",
"final",
"Integer",
"top",
",",
"final",
"Integer",
"skip",
",",
"final",
"String",
"select",
",",
"final",
"String",
... | Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any.
@param filter OData filter. Optional.
@param top The number of items to return. Optional.
@param skip The number of items to skip over before returning elements. Optional.
@param... | [
"Gets",
"the",
"first",
"page",
"of",
"Data",
"Lake",
"Analytics",
"accounts",
"if",
"any",
"within",
"the",
"current",
"subscription",
".",
"This",
"includes",
"a",
"link",
"to",
"the",
"next",
"page",
"if",
"any",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/AccountsInner.java#L289-L297 |
adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/util/OptionsUtil.java | OptionsUtil.getSeriesIndex | public static int getSeriesIndex(final Options options, final int wickedChartsId) {
int index = 0;
if (options.getSeries() == null) {
throw new IllegalStateException("The given Options object does not contain any series!");
}
for (Series<?> series : options.getSeries()) {
... | java | public static int getSeriesIndex(final Options options, final int wickedChartsId) {
int index = 0;
if (options.getSeries() == null) {
throw new IllegalStateException("The given Options object does not contain any series!");
}
for (Series<?> series : options.getSeries()) {
... | [
"public",
"static",
"int",
"getSeriesIndex",
"(",
"final",
"Options",
"options",
",",
"final",
"int",
"wickedChartsId",
")",
"{",
"int",
"index",
"=",
"0",
";",
"if",
"(",
"options",
".",
"getSeries",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"... | Returns the (0-based) index of the series with the given wickedChartsId or
null.
@param options the options in which to search
@param wickedChartsId the wickedChartsId of the series
@return the index of the series with the given id. Returns 0 if no series
was found. | [
"Returns",
"the",
"(",
"0",
"-",
"based",
")",
"index",
"of",
"the",
"series",
"with",
"the",
"given",
"wickedChartsId",
"or",
"null",
"."
] | train | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/util/OptionsUtil.java#L231-L243 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/ArtFinder.java | ArtFinder.deliverAlbumArtUpdate | private void deliverAlbumArtUpdate(int player, AlbumArt art) {
if (!getAlbumArtListeners().isEmpty()) {
final AlbumArtUpdate update = new AlbumArtUpdate(player, art);
for (final AlbumArtListener listener : getAlbumArtListeners()) {
try {
listener.album... | java | private void deliverAlbumArtUpdate(int player, AlbumArt art) {
if (!getAlbumArtListeners().isEmpty()) {
final AlbumArtUpdate update = new AlbumArtUpdate(player, art);
for (final AlbumArtListener listener : getAlbumArtListeners()) {
try {
listener.album... | [
"private",
"void",
"deliverAlbumArtUpdate",
"(",
"int",
"player",
",",
"AlbumArt",
"art",
")",
"{",
"if",
"(",
"!",
"getAlbumArtListeners",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"final",
"AlbumArtUpdate",
"update",
"=",
"new",
"AlbumArtUpdate",
"(",
... | Send an album art update announcement to all registered listeners. | [
"Send",
"an",
"album",
"art",
"update",
"announcement",
"to",
"all",
"registered",
"listeners",
"."
] | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/ArtFinder.java#L450-L462 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.line_offer_phones_GET | public ArrayList<OvhLinePhone> line_offer_phones_GET(OvhNumberCountryEnum country, String offer) throws IOException {
String qPath = "/telephony/line/offer/phones";
StringBuilder sb = path(qPath);
query(sb, "country", country);
query(sb, "offer", offer);
String resp = execN(qPath, "GET", sb.toString(), null);... | java | public ArrayList<OvhLinePhone> line_offer_phones_GET(OvhNumberCountryEnum country, String offer) throws IOException {
String qPath = "/telephony/line/offer/phones";
StringBuilder sb = path(qPath);
query(sb, "country", country);
query(sb, "offer", offer);
String resp = execN(qPath, "GET", sb.toString(), null);... | [
"public",
"ArrayList",
"<",
"OvhLinePhone",
">",
"line_offer_phones_GET",
"(",
"OvhNumberCountryEnum",
"country",
",",
"String",
"offer",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/line/offer/phones\"",
";",
"StringBuilder",
"sb",
"=",
"p... | Get all available phone brands compatible with lines
REST: GET /telephony/line/offer/phones
@param offer [required] The selected offer
@param country [required] The country | [
"Get",
"all",
"available",
"phone",
"brands",
"compatible",
"with",
"lines"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L8866-L8873 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java | CheckpointCoordinator.failUnacknowledgedPendingCheckpointsFor | public void failUnacknowledgedPendingCheckpointsFor(ExecutionAttemptID executionAttemptId, Throwable cause) {
synchronized (lock) {
Iterator<PendingCheckpoint> pendingCheckpointIterator = pendingCheckpoints.values().iterator();
while (pendingCheckpointIterator.hasNext()) {
final PendingCheckpoint pendingCh... | java | public void failUnacknowledgedPendingCheckpointsFor(ExecutionAttemptID executionAttemptId, Throwable cause) {
synchronized (lock) {
Iterator<PendingCheckpoint> pendingCheckpointIterator = pendingCheckpoints.values().iterator();
while (pendingCheckpointIterator.hasNext()) {
final PendingCheckpoint pendingCh... | [
"public",
"void",
"failUnacknowledgedPendingCheckpointsFor",
"(",
"ExecutionAttemptID",
"executionAttemptId",
",",
"Throwable",
"cause",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"Iterator",
"<",
"PendingCheckpoint",
">",
"pendingCheckpointIterator",
"=",
"pendingC... | Fails all pending checkpoints which have not been acknowledged by the given execution
attempt id.
@param executionAttemptId for which to discard unacknowledged pending checkpoints
@param cause of the failure | [
"Fails",
"all",
"pending",
"checkpoints",
"which",
"have",
"not",
"been",
"acknowledged",
"by",
"the",
"given",
"execution",
"attempt",
"id",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java#L964-L977 |
VoltDB/voltdb | src/frontend/org/voltdb/plannodes/PlanNodeTree.java | PlanNodeTree.loadFromJSONPlan | public void loadFromJSONPlan(JSONObject jobj, Database db) throws JSONException {
if (jobj.has(Members.PLAN_NODES_LISTS)) {
JSONArray jplanNodesArray = jobj.getJSONArray(Members.PLAN_NODES_LISTS);
for (int i = 0; i < jplanNodesArray.length(); ++i) {
JSONObject jplanNodes... | java | public void loadFromJSONPlan(JSONObject jobj, Database db) throws JSONException {
if (jobj.has(Members.PLAN_NODES_LISTS)) {
JSONArray jplanNodesArray = jobj.getJSONArray(Members.PLAN_NODES_LISTS);
for (int i = 0; i < jplanNodesArray.length(); ++i) {
JSONObject jplanNodes... | [
"public",
"void",
"loadFromJSONPlan",
"(",
"JSONObject",
"jobj",
",",
"Database",
"db",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"jobj",
".",
"has",
"(",
"Members",
".",
"PLAN_NODES_LISTS",
")",
")",
"{",
"JSONArray",
"jplanNodesArray",
"=",
"jobj",
"... | Load json plan. The plan must have either "PLAN_NODE" array in case of a statement without
subqueries or "PLAN_NODES_LISTS" array of "PLAN_NODE" arrays for each sub statement.
@param jobj
@param db
@throws JSONException | [
"Load",
"json",
"plan",
".",
"The",
"plan",
"must",
"have",
"either",
"PLAN_NODE",
"array",
"in",
"case",
"of",
"a",
"statement",
"without",
"subqueries",
"or",
"PLAN_NODES_LISTS",
"array",
"of",
"PLAN_NODE",
"arrays",
"for",
"each",
"sub",
"statement",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/plannodes/PlanNodeTree.java#L133-L156 |
radkovo/SwingBox | src/main/java/org/fit/cssbox/swingbox/util/DefaultHyperlinkHandler.java | DefaultHyperlinkHandler.loadPage | protected void loadPage(JEditorPane pane, HyperlinkEvent evt)
{
// if some security, or other interaction is needed, override this
// method
try
{
pane.setPage(evt.getURL());
} catch (IOException e)
{
System.err.println(e.getLocalizedMessage())... | java | protected void loadPage(JEditorPane pane, HyperlinkEvent evt)
{
// if some security, or other interaction is needed, override this
// method
try
{
pane.setPage(evt.getURL());
} catch (IOException e)
{
System.err.println(e.getLocalizedMessage())... | [
"protected",
"void",
"loadPage",
"(",
"JEditorPane",
"pane",
",",
"HyperlinkEvent",
"evt",
")",
"{",
"// if some security, or other interaction is needed, override this",
"// method",
"try",
"{",
"pane",
".",
"setPage",
"(",
"evt",
".",
"getURL",
"(",
")",
")",
";",... | Loads given page as HyperlinkEvent.
@param pane
the pane
@param evt
the event | [
"Loads",
"given",
"page",
"as",
"HyperlinkEvent",
"."
] | train | https://github.com/radkovo/SwingBox/blob/ff370f3dc54d248e4c8852c17513618c83c25984/src/main/java/org/fit/cssbox/swingbox/util/DefaultHyperlinkHandler.java#L67-L78 |
tobykurien/Xtendroid | Xtendroid/src/asia/sonix/android/orm/AbatisService.java | AbatisService.getInstance | protected static AbatisService getInstance(Context context, String dbName, int version) {
if (instance == null) {
instance = new AbatisService(context, dbName, version);
}
return instance;
} | java | protected static AbatisService getInstance(Context context, String dbName, int version) {
if (instance == null) {
instance = new AbatisService(context, dbName, version);
}
return instance;
} | [
"protected",
"static",
"AbatisService",
"getInstance",
"(",
"Context",
"context",
",",
"String",
"dbName",
",",
"int",
"version",
")",
"{",
"if",
"(",
"instance",
"==",
"null",
")",
"{",
"instance",
"=",
"new",
"AbatisService",
"(",
"context",
",",
"dbName",... | 指定DB file nameを利用する外部Constructor
@param context
呼び出し元Contextオブジェクト
@param dbName
生成するDB file name | [
"指定DB",
"file",
"nameを利用する外部Constructor"
] | train | https://github.com/tobykurien/Xtendroid/blob/758bf1d06f4cf3b64f9c10632fe9c6fb30bcebd4/Xtendroid/src/asia/sonix/android/orm/AbatisService.java#L137-L142 |
EvidentSolutions/dalesbred | dalesbred/src/main/java/org/dalesbred/internal/instantiation/InstantiatorProvider.java | InstantiatorProvider.implicitInstantiatorFrom | private @NotNull <T> Optional<Instantiator<T>> implicitInstantiatorFrom(@NotNull Constructor<T> constructor, @NotNull NamedTypeList types) {
if (!isPublic(constructor.getModifiers()))
return Optional.empty();
List<String> columnNames = types.getNames();
return findTargetTypes(constr... | java | private @NotNull <T> Optional<Instantiator<T>> implicitInstantiatorFrom(@NotNull Constructor<T> constructor, @NotNull NamedTypeList types) {
if (!isPublic(constructor.getModifiers()))
return Optional.empty();
List<String> columnNames = types.getNames();
return findTargetTypes(constr... | [
"private",
"@",
"NotNull",
"<",
"T",
">",
"Optional",
"<",
"Instantiator",
"<",
"T",
">",
">",
"implicitInstantiatorFrom",
"(",
"@",
"NotNull",
"Constructor",
"<",
"T",
">",
"constructor",
",",
"@",
"NotNull",
"NamedTypeList",
"types",
")",
"{",
"if",
"(",... | Returns an instantiator that uses given constructor and given types to create instances,
or empty if there are no conversions that can be made to instantiate the type. | [
"Returns",
"an",
"instantiator",
"that",
"uses",
"given",
"constructor",
"and",
"given",
"types",
"to",
"create",
"instances",
"or",
"empty",
"if",
"there",
"are",
"no",
"conversions",
"that",
"can",
"be",
"made",
"to",
"instantiate",
"the",
"type",
"."
] | train | https://github.com/EvidentSolutions/dalesbred/blob/713f5b6e152d97e1672ca68b9ff9c7c6c288ceb1/dalesbred/src/main/java/org/dalesbred/internal/instantiation/InstantiatorProvider.java#L152-L160 |
craftercms/deployer | src/main/java/org/craftercms/deployer/utils/ConfigUtils.java | ConfigUtils.getStringArrayProperty | public static String[] getStringArrayProperty(Configuration config,
String key) throws DeployerConfigurationException {
try {
return config.getStringArray(key);
} catch (Exception e) {
throw new DeployerConfigurationException("Fai... | java | public static String[] getStringArrayProperty(Configuration config,
String key) throws DeployerConfigurationException {
try {
return config.getStringArray(key);
} catch (Exception e) {
throw new DeployerConfigurationException("Fai... | [
"public",
"static",
"String",
"[",
"]",
"getStringArrayProperty",
"(",
"Configuration",
"config",
",",
"String",
"key",
")",
"throws",
"DeployerConfigurationException",
"{",
"try",
"{",
"return",
"config",
".",
"getStringArray",
"(",
"key",
")",
";",
"}",
"catch... | Returns the specified String array property from the configuration. A String array property is normally
specified as
a String with values separated by commas in the configuration.
@param config the configuration
@param key the key of the property
@return the String array value of the property, or null if not found
... | [
"Returns",
"the",
"specified",
"String",
"array",
"property",
"from",
"the",
"configuration",
".",
"A",
"String",
"array",
"property",
"is",
"normally",
"specified",
"as",
"a",
"String",
"with",
"values",
"separated",
"by",
"commas",
"in",
"the",
"configuration"... | train | https://github.com/craftercms/deployer/blob/3ed446e3cc8af1055de2de6f871907f90ef27f63/src/main/java/org/craftercms/deployer/utils/ConfigUtils.java#L232-L239 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataCore.java | CoverageDataCore.getUnsignedPixelValue | public int getUnsignedPixelValue(GriddedTile griddedTile, Double value) {
int unsignedPixelValue = 0;
if (value == null) {
if (griddedCoverage != null) {
unsignedPixelValue = griddedCoverage.getDataNull().intValue();
}
} else {
double pixelValue = valueToPixelValue(griddedTile, value);
unsignedP... | java | public int getUnsignedPixelValue(GriddedTile griddedTile, Double value) {
int unsignedPixelValue = 0;
if (value == null) {
if (griddedCoverage != null) {
unsignedPixelValue = griddedCoverage.getDataNull().intValue();
}
} else {
double pixelValue = valueToPixelValue(griddedTile, value);
unsignedP... | [
"public",
"int",
"getUnsignedPixelValue",
"(",
"GriddedTile",
"griddedTile",
",",
"Double",
"value",
")",
"{",
"int",
"unsignedPixelValue",
"=",
"0",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"if",
"(",
"griddedCoverage",
"!=",
"null",
")",
"{",
"un... | Get the unsigned 16 bit integer pixel value of the coverage data value
@param griddedTile
gridded tile
@param value
coverage data value
@return 16 bit integer pixel value | [
"Get",
"the",
"unsigned",
"16",
"bit",
"integer",
"pixel",
"value",
"of",
"the",
"coverage",
"data",
"value"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataCore.java#L1544-L1558 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java | ByteArrayUtil.writeUnsignedVarint | public static void writeUnsignedVarint(ByteBuffer buffer, int val) {
// Extra bytes have the high bit set
while((val & 0x7F) != val) {
buffer.put((byte) ((val & 0x7F) | 0x80));
val >>>= 7;
}
// Last byte doesn't have high bit set
buffer.put((byte) (val & 0x7F));
} | java | public static void writeUnsignedVarint(ByteBuffer buffer, int val) {
// Extra bytes have the high bit set
while((val & 0x7F) != val) {
buffer.put((byte) ((val & 0x7F) | 0x80));
val >>>= 7;
}
// Last byte doesn't have high bit set
buffer.put((byte) (val & 0x7F));
} | [
"public",
"static",
"void",
"writeUnsignedVarint",
"(",
"ByteBuffer",
"buffer",
",",
"int",
"val",
")",
"{",
"// Extra bytes have the high bit set",
"while",
"(",
"(",
"val",
"&",
"0x7F",
")",
"!=",
"val",
")",
"{",
"buffer",
".",
"put",
"(",
"(",
"byte",
... | Write an unsigned integer using a variable-length encoding.
Data is always written in 7-bit little-endian, where the 8th bit is the
continuation flag.
@param buffer Buffer to write to
@param val number to write | [
"Write",
"an",
"unsigned",
"integer",
"using",
"a",
"variable",
"-",
"length",
"encoding",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java#L647-L655 |
SteelBridgeLabs/neo4j-gremlin-bolt | src/main/java/com/steelbridgelabs/oss/neo4j/structure/providers/DatabaseSequenceElementIdProvider.java | DatabaseSequenceElementIdProvider.processIdentifier | @Override
public Long processIdentifier(Object id) {
Objects.requireNonNull(id, "Element identifier cannot be null");
// check for Long
if (id instanceof Long)
return (Long)id;
// check for numeric types
if (id instanceof Number)
return ((Number)id).lo... | java | @Override
public Long processIdentifier(Object id) {
Objects.requireNonNull(id, "Element identifier cannot be null");
// check for Long
if (id instanceof Long)
return (Long)id;
// check for numeric types
if (id instanceof Number)
return ((Number)id).lo... | [
"@",
"Override",
"public",
"Long",
"processIdentifier",
"(",
"Object",
"id",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"id",
",",
"\"Element identifier cannot be null\"",
")",
";",
"// check for Long",
"if",
"(",
"id",
"instanceof",
"Long",
")",
"return",
... | Process the given identifier converting it to the correct type if necessary.
@param id The {@link org.apache.tinkerpop.gremlin.structure.Element} identifier.
@return The {@link org.apache.tinkerpop.gremlin.structure.Element} identifier converted to the correct type if necessary. | [
"Process",
"the",
"given",
"identifier",
"converting",
"it",
"to",
"the",
"correct",
"type",
"if",
"necessary",
"."
] | train | https://github.com/SteelBridgeLabs/neo4j-gremlin-bolt/blob/df3ab429e0c83affae6cd43d41edd90de80c032e/src/main/java/com/steelbridgelabs/oss/neo4j/structure/providers/DatabaseSequenceElementIdProvider.java#L173-L187 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java | ApiOvhDedicatedCloud.serviceName_datacenter_datacenterId_PUT | public void serviceName_datacenter_datacenterId_PUT(String serviceName, Long datacenterId, OvhDatacenter body) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/datacenter/{datacenterId}";
StringBuilder sb = path(qPath, serviceName, datacenterId);
exec(qPath, "PUT", sb.toString(), body);
} | java | public void serviceName_datacenter_datacenterId_PUT(String serviceName, Long datacenterId, OvhDatacenter body) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/datacenter/{datacenterId}";
StringBuilder sb = path(qPath, serviceName, datacenterId);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"serviceName_datacenter_datacenterId_PUT",
"(",
"String",
"serviceName",
",",
"Long",
"datacenterId",
",",
"OvhDatacenter",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicatedCloud/{serviceName}/datacenter/{datacenterId}\"",
";",... | Alter this object properties
REST: PUT /dedicatedCloud/{serviceName}/datacenter/{datacenterId}
@param body [required] New object properties
@param serviceName [required] Domain of the service
@param datacenterId [required] | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L1944-L1948 |
Jasig/uPortal | uPortal-rendering/src/main/java/org/apereo/portal/url/UrlSyntaxProviderImpl.java | UrlSyntaxProviderImpl.determineUrlState | protected UrlState determineUrlState(
final IPortletWindow portletWindow,
final IPortletUrlBuilder targetedPortletUrlBuilder) {
final WindowState requestedWindowState;
if (targetedPortletUrlBuilder == null) {
requestedWindowState = null;
} else {
r... | java | protected UrlState determineUrlState(
final IPortletWindow portletWindow,
final IPortletUrlBuilder targetedPortletUrlBuilder) {
final WindowState requestedWindowState;
if (targetedPortletUrlBuilder == null) {
requestedWindowState = null;
} else {
r... | [
"protected",
"UrlState",
"determineUrlState",
"(",
"final",
"IPortletWindow",
"portletWindow",
",",
"final",
"IPortletUrlBuilder",
"targetedPortletUrlBuilder",
")",
"{",
"final",
"WindowState",
"requestedWindowState",
";",
"if",
"(",
"targetedPortletUrlBuilder",
"==",
"null... | Determine the {@link UrlState} to use for the targeted portlet window | [
"Determine",
"the",
"{"
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-rendering/src/main/java/org/apereo/portal/url/UrlSyntaxProviderImpl.java#L1402-L1413 |
h2oai/h2o-3 | h2o-automl/src/main/java/ai/h2o/automl/AutoML.java | AutoML.startAutoML | public static void startAutoML(AutoML aml) {
// Currently AutoML can only run one job at a time
if (aml.job == null || !aml.job.isRunning()) {
H2OJob j = new H2OJob(aml, aml._key, aml.runCountdown.remainingTime());
aml.job = j._job;
j.start(aml.workAllocations.remainingWork());
DKV.put(a... | java | public static void startAutoML(AutoML aml) {
// Currently AutoML can only run one job at a time
if (aml.job == null || !aml.job.isRunning()) {
H2OJob j = new H2OJob(aml, aml._key, aml.runCountdown.remainingTime());
aml.job = j._job;
j.start(aml.workAllocations.remainingWork());
DKV.put(a... | [
"public",
"static",
"void",
"startAutoML",
"(",
"AutoML",
"aml",
")",
"{",
"// Currently AutoML can only run one job at a time",
"if",
"(",
"aml",
".",
"job",
"==",
"null",
"||",
"!",
"aml",
".",
"job",
".",
"isRunning",
"(",
")",
")",
"{",
"H2OJob",
"j",
... | Takes in an AutoML instance and starts running it. Progress can be tracked via its job().
@param aml
@return | [
"Takes",
"in",
"an",
"AutoML",
"instance",
"and",
"starts",
"running",
"it",
".",
"Progress",
"can",
"be",
"tracked",
"via",
"its",
"job",
"()",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-automl/src/main/java/ai/h2o/automl/AutoML.java#L166-L174 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Normalizer.java | Normalizer.isNormalized | @Deprecated
public static boolean isNormalized(int char32, Mode mode,int options) {
return isNormalized(UTF16.valueOf(char32), mode, options);
} | java | @Deprecated
public static boolean isNormalized(int char32, Mode mode,int options) {
return isNormalized(UTF16.valueOf(char32), mode, options);
} | [
"@",
"Deprecated",
"public",
"static",
"boolean",
"isNormalized",
"(",
"int",
"char32",
",",
"Mode",
"mode",
",",
"int",
"options",
")",
"{",
"return",
"isNormalized",
"(",
"UTF16",
".",
"valueOf",
"(",
"char32",
")",
",",
"mode",
",",
"options",
")",
";... | Convenience Method
@param char32 the input code point to be checked to see if it is
normalized
@param mode the normalization mode
@param options Options for use with exclusion set and tailored Normalization
The only option that is currently recognized is UNICODE_3_2
@see #isNormalized
@deprecated ICU 56 Use ... | [
"Convenience",
"Method",
"@param",
"char32",
"the",
"input",
"code",
"point",
"to",
"be",
"checked",
"to",
"see",
"if",
"it",
"is",
"normalized",
"@param",
"mode",
"the",
"normalization",
"mode",
"@param",
"options",
"Options",
"for",
"use",
"with",
"exclusion... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Normalizer.java#L1127-L1130 |
auth0/jwks-rsa-java | src/main/java/com/auth0/jwk/JwkProviderBuilder.java | JwkProviderBuilder.rateLimited | public JwkProviderBuilder rateLimited(long bucketSize, long refillRate, TimeUnit unit) {
bucket = new BucketImpl(bucketSize, refillRate, unit);
return this;
} | java | public JwkProviderBuilder rateLimited(long bucketSize, long refillRate, TimeUnit unit) {
bucket = new BucketImpl(bucketSize, refillRate, unit);
return this;
} | [
"public",
"JwkProviderBuilder",
"rateLimited",
"(",
"long",
"bucketSize",
",",
"long",
"refillRate",
",",
"TimeUnit",
"unit",
")",
"{",
"bucket",
"=",
"new",
"BucketImpl",
"(",
"bucketSize",
",",
"refillRate",
",",
"unit",
")",
";",
"return",
"this",
";",
"}... | Enable the cache specifying size and expire time.
@param bucketSize max number of jwks to deliver in the given rate.
@param refillRate amount of time to wait before a jwk can the jwk will be cached
@param unit unit of time for the expire of jwk
@return the builder | [
"Enable",
"the",
"cache",
"specifying",
"size",
"and",
"expire",
"time",
"."
] | train | https://github.com/auth0/jwks-rsa-java/blob/9deba212be4278e50ae75a54b3bc6c96359b7e69/src/main/java/com/auth0/jwk/JwkProviderBuilder.java#L110-L113 |
overturetool/overture | core/parser/src/main/java/org/overture/parser/syntax/SyntaxReader.java | SyntaxReader.throwMessage | protected void throwMessage(int number, String message, ILexToken token)
throws ParserException
{
throw new ParserException(number, message, token.getLocation(), reader.getTokensRead());
} | java | protected void throwMessage(int number, String message, ILexToken token)
throws ParserException
{
throw new ParserException(number, message, token.getLocation(), reader.getTokensRead());
} | [
"protected",
"void",
"throwMessage",
"(",
"int",
"number",
",",
"String",
"message",
",",
"ILexToken",
"token",
")",
"throws",
"ParserException",
"{",
"throw",
"new",
"ParserException",
"(",
"number",
",",
"message",
",",
"token",
".",
"getLocation",
"(",
")",... | Raise a {@link ParserException} at the location of the token passed in.
@param number
The error number.
@param message
The error message.
@param token
The location of the error.
@throws ParserException | [
"Raise",
"a",
"{",
"@link",
"ParserException",
"}",
"at",
"the",
"location",
"of",
"the",
"token",
"passed",
"in",
"."
] | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/parser/src/main/java/org/overture/parser/syntax/SyntaxReader.java#L507-L511 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.addCustomPrebuiltDomainWithServiceResponseAsync | public Observable<ServiceResponse<List<UUID>>> addCustomPrebuiltDomainWithServiceResponseAsync(UUID appId, String versionId, AddCustomPrebuiltDomainModelsOptionalParameter addCustomPrebuiltDomainOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter ... | java | public Observable<ServiceResponse<List<UUID>>> addCustomPrebuiltDomainWithServiceResponseAsync(UUID appId, String versionId, AddCustomPrebuiltDomainModelsOptionalParameter addCustomPrebuiltDomainOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter ... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"List",
"<",
"UUID",
">",
">",
">",
"addCustomPrebuiltDomainWithServiceResponseAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"AddCustomPrebuiltDomainModelsOptionalParameter",
"addCustomPrebuiltDomainOptiona... | Adds a customizable prebuilt domain along with all of its models to this application.
@param appId The application ID.
@param versionId The version ID.
@param addCustomPrebuiltDomainOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thro... | [
"Adds",
"a",
"customizable",
"prebuilt",
"domain",
"along",
"with",
"all",
"of",
"its",
"models",
"to",
"this",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L5588-L5601 |
biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/WrapLayout.java | WrapLayout.addRow | private void addRow(Dimension dim, int rowWidth, int rowHeight)
{
dim.width = Math.max(dim.width, rowWidth);
if (dim.height > 0)
{
dim.height += getVgap();
}
dim.height += rowHeight;
} | java | private void addRow(Dimension dim, int rowWidth, int rowHeight)
{
dim.width = Math.max(dim.width, rowWidth);
if (dim.height > 0)
{
dim.height += getVgap();
}
dim.height += rowHeight;
} | [
"private",
"void",
"addRow",
"(",
"Dimension",
"dim",
",",
"int",
"rowWidth",
",",
"int",
"rowHeight",
")",
"{",
"dim",
".",
"width",
"=",
"Math",
".",
"max",
"(",
"dim",
".",
"width",
",",
"rowWidth",
")",
";",
"if",
"(",
"dim",
".",
"height",
">"... | /*
A new row has been completed. Use the dimensions of this row
to update the preferred size for the container.
@param dim update the width and height when appropriate
@param rowWidth the width of the row to add
@param rowHeight the height of the row to add | [
"/",
"*",
"A",
"new",
"row",
"has",
"been",
"completed",
".",
"Use",
"the",
"dimensions",
"of",
"this",
"row",
"to",
"update",
"the",
"preferred",
"size",
"for",
"the",
"container",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/WrapLayout.java#L204-L214 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/endpoint/util/ByteBufJsonHelper.java | ByteBufJsonHelper.findNextCharNotPrefixedBy | public static final int findNextCharNotPrefixedBy(ByteBuf buf, char c, char prefix) {
int found = buf.bytesBefore((byte) c);
if (found < 1) {
return found;
} else {
int from;
while (found > -1 && (char) buf.getByte(
buf.readerIndex() + fou... | java | public static final int findNextCharNotPrefixedBy(ByteBuf buf, char c, char prefix) {
int found = buf.bytesBefore((byte) c);
if (found < 1) {
return found;
} else {
int from;
while (found > -1 && (char) buf.getByte(
buf.readerIndex() + fou... | [
"public",
"static",
"final",
"int",
"findNextCharNotPrefixedBy",
"(",
"ByteBuf",
"buf",
",",
"char",
"c",
",",
"char",
"prefix",
")",
"{",
"int",
"found",
"=",
"buf",
".",
"bytesBefore",
"(",
"(",
"byte",
")",
"c",
")",
";",
"if",
"(",
"found",
"<",
... | Find the number of bytes until next occurrence of the character c
from the current {@link ByteBuf#readerIndex() readerIndex} in buf,
with the twist that if this occurrence is prefixed by the prefix
character, we try to find another occurrence.
@param buf the {@link ByteBuf buffer} to look into.
@param c the character ... | [
"Find",
"the",
"number",
"of",
"bytes",
"until",
"next",
"occurrence",
"of",
"the",
"character",
"c",
"from",
"the",
"current",
"{",
"@link",
"ByteBuf#readerIndex",
"()",
"readerIndex",
"}",
"in",
"buf",
"with",
"the",
"twist",
"that",
"if",
"this",
"occurre... | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/endpoint/util/ByteBufJsonHelper.java#L57-L77 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsXmlContainerPageFactory.java | CmsXmlContainerPageFactory.setCache | private static void setCache(CmsObject cms, CmsXmlContainerPage xmlCntPage, boolean keepEncoding) {
if (xmlCntPage.getFile() instanceof I_CmsHistoryResource) {
return;
}
boolean online = cms.getRequestContext().getCurrentProject().isOnlineProject();
getCache().setCacheContai... | java | private static void setCache(CmsObject cms, CmsXmlContainerPage xmlCntPage, boolean keepEncoding) {
if (xmlCntPage.getFile() instanceof I_CmsHistoryResource) {
return;
}
boolean online = cms.getRequestContext().getCurrentProject().isOnlineProject();
getCache().setCacheContai... | [
"private",
"static",
"void",
"setCache",
"(",
"CmsObject",
"cms",
",",
"CmsXmlContainerPage",
"xmlCntPage",
",",
"boolean",
"keepEncoding",
")",
"{",
"if",
"(",
"xmlCntPage",
".",
"getFile",
"(",
")",
"instanceof",
"I_CmsHistoryResource",
")",
"{",
"return",
";"... | Stores the given container page in the cache.<p>
@param cms the cms context
@param xmlCntPage the container page to cache
@param keepEncoding if the encoding was kept while unmarshalling | [
"Stores",
"the",
"given",
"container",
"page",
"in",
"the",
"cache",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsXmlContainerPageFactory.java#L453-L463 |
qiniu/java-sdk | src/main/java/com/qiniu/streaming/StreamingManager.java | StreamingManager.listStreams | public StreamListing listStreams(boolean live, String prefix, String marker) throws QiniuException {
StringMap map = new StringMap();
map.putWhen("liveonly", live, live);
map.putNotEmpty("prefix", prefix);
map.putNotEmpty("marker", marker);
String path = "";
if (map.si... | java | public StreamListing listStreams(boolean live, String prefix, String marker) throws QiniuException {
StringMap map = new StringMap();
map.putWhen("liveonly", live, live);
map.putNotEmpty("prefix", prefix);
map.putNotEmpty("marker", marker);
String path = "";
if (map.si... | [
"public",
"StreamListing",
"listStreams",
"(",
"boolean",
"live",
",",
"String",
"prefix",
",",
"String",
"marker",
")",
"throws",
"QiniuException",
"{",
"StringMap",
"map",
"=",
"new",
"StringMap",
"(",
")",
";",
"map",
".",
"putWhen",
"(",
"\"liveonly\"",
... | 获取直播流列表
@param live 是否直播中
@param prefix 流名称前缀
@param marker 下一次列举的位置 | [
"获取直播流列表"
] | train | https://github.com/qiniu/java-sdk/blob/6c05f3fb718403a496c725b048e9241f80171499/src/main/java/com/qiniu/streaming/StreamingManager.java#L89-L102 |
apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/Serializers.java | Serializers.getContainedGenericTypes | private static void getContainedGenericTypes(CompositeType<?> typeInfo, List<GenericTypeInfo<?>> target) {
for (int i = 0; i < typeInfo.getArity(); i++) {
TypeInformation<?> type = typeInfo.getTypeAt(i);
if (type instanceof CompositeType) {
getContainedGenericTypes((CompositeType<?>) type, target);
} els... | java | private static void getContainedGenericTypes(CompositeType<?> typeInfo, List<GenericTypeInfo<?>> target) {
for (int i = 0; i < typeInfo.getArity(); i++) {
TypeInformation<?> type = typeInfo.getTypeAt(i);
if (type instanceof CompositeType) {
getContainedGenericTypes((CompositeType<?>) type, target);
} els... | [
"private",
"static",
"void",
"getContainedGenericTypes",
"(",
"CompositeType",
"<",
"?",
">",
"typeInfo",
",",
"List",
"<",
"GenericTypeInfo",
"<",
"?",
">",
">",
"target",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"typeInfo",
".",
"ge... | Returns all GenericTypeInfos contained in a composite type.
@param typeInfo {@link CompositeType} | [
"Returns",
"all",
"GenericTypeInfos",
"contained",
"in",
"a",
"composite",
"type",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/Serializers.java#L135-L146 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.GET | public ArrayList<String> GET(String description, String ip, String routedTo_serviceName, OvhIpTypeEnum type) throws IOException {
String qPath = "/ip";
StringBuilder sb = path(qPath);
query(sb, "description", description);
query(sb, "ip", ip);
query(sb, "routedTo.serviceName", routedTo_serviceName);
query(s... | java | public ArrayList<String> GET(String description, String ip, String routedTo_serviceName, OvhIpTypeEnum type) throws IOException {
String qPath = "/ip";
StringBuilder sb = path(qPath);
query(sb, "description", description);
query(sb, "ip", ip);
query(sb, "routedTo.serviceName", routedTo_serviceName);
query(s... | [
"public",
"ArrayList",
"<",
"String",
">",
"GET",
"(",
"String",
"description",
",",
"String",
"ip",
",",
"String",
"routedTo_serviceName",
",",
"OvhIpTypeEnum",
"type",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip\"",
";",
"StringBuilder",
... | Your OVH IPs
REST: GET /ip
@param description [required] Filter the value of description property (like)
@param ip [required] Filter the value of ip property (contains or equals)
@param routedTo_serviceName [required] Filter the value of routedTo.serviceName property (like)
@param type [required] Filter the value of t... | [
"Your",
"OVH",
"IPs"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L1244-L1253 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslservicegroup.java | sslservicegroup.get | public static sslservicegroup get(nitro_service service, String servicegroupname) throws Exception{
sslservicegroup obj = new sslservicegroup();
obj.set_servicegroupname(servicegroupname);
sslservicegroup response = (sslservicegroup) obj.get_resource(service);
return response;
} | java | public static sslservicegroup get(nitro_service service, String servicegroupname) throws Exception{
sslservicegroup obj = new sslservicegroup();
obj.set_servicegroupname(servicegroupname);
sslservicegroup response = (sslservicegroup) obj.get_resource(service);
return response;
} | [
"public",
"static",
"sslservicegroup",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"servicegroupname",
")",
"throws",
"Exception",
"{",
"sslservicegroup",
"obj",
"=",
"new",
"sslservicegroup",
"(",
")",
";",
"obj",
".",
"set_servicegroupname",
"(",
"ser... | Use this API to fetch sslservicegroup resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"sslservicegroup",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslservicegroup.java#L607-L612 |
rolfl/MicroBench | src/main/java/net/tuis/ubench/UUtils.java | UUtils.readResource | public static String readResource(String path) {
final long start = System.nanoTime();
try (InputStream is = UScale.class.getClassLoader().getResourceAsStream(path);) {
int len = 0;
byte[] buffer = new byte[2048];
ByteArrayOutputStream baos = new ByteArrayOutputStream... | java | public static String readResource(String path) {
final long start = System.nanoTime();
try (InputStream is = UScale.class.getClassLoader().getResourceAsStream(path);) {
int len = 0;
byte[] buffer = new byte[2048];
ByteArrayOutputStream baos = new ByteArrayOutputStream... | [
"public",
"static",
"String",
"readResource",
"(",
"String",
"path",
")",
"{",
"final",
"long",
"start",
"=",
"System",
".",
"nanoTime",
"(",
")",
";",
"try",
"(",
"InputStream",
"is",
"=",
"UScale",
".",
"class",
".",
"getClassLoader",
"(",
")",
".",
... | Load a resource stored in the classpath, as a String.
@param path
the system resource to read
@return the resource as a String. | [
"Load",
"a",
"resource",
"stored",
"in",
"the",
"classpath",
"as",
"a",
"String",
"."
] | train | https://github.com/rolfl/MicroBench/blob/f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce/src/main/java/net/tuis/ubench/UUtils.java#L138-L158 |
pvanassen/ns-api | src/main/java/nl/pvanassen/ns/RequestBuilder.java | RequestBuilder.getPrijzen | public static ApiRequest<Prijzen> getPrijzen(String fromStation, String toStation, String viaStation,
Date dateTime) {
return new PrijzenRequest(fromStation, toStation, viaStation, dateTime);
} | java | public static ApiRequest<Prijzen> getPrijzen(String fromStation, String toStation, String viaStation,
Date dateTime) {
return new PrijzenRequest(fromStation, toStation, viaStation, dateTime);
} | [
"public",
"static",
"ApiRequest",
"<",
"Prijzen",
">",
"getPrijzen",
"(",
"String",
"fromStation",
",",
"String",
"toStation",
",",
"String",
"viaStation",
",",
"Date",
"dateTime",
")",
"{",
"return",
"new",
"PrijzenRequest",
"(",
"fromStation",
",",
"toStation"... | Builds a request to get all fares for a ride between station from, to station to. See <a
href="http://www.ns.nl/api/api#api-documentatie-prijzen">prijzen</a>
@param fromStation Starting point of the trip
@param toStation End point of the trip
@param viaStation Also go to this station
@param dateTime Date and time to u... | [
"Builds",
"a",
"request",
"to",
"get",
"all",
"fares",
"for",
"a",
"ride",
"between",
"station",
"from",
"to",
"station",
"to",
".",
"See",
"<a",
"href",
"=",
"http",
":",
"//",
"www",
".",
"ns",
".",
"nl",
"/",
"api",
"/",
"api#api",
"-",
"documen... | train | https://github.com/pvanassen/ns-api/blob/e90e01028a0eb24006e4fddd4c85e7a25c4fe0ae/src/main/java/nl/pvanassen/ns/RequestBuilder.java#L136-L139 |
eclipse/hawkbit | hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/BaseAmqpService.java | BaseAmqpService.convertMessage | @SuppressWarnings("unchecked")
public <T> T convertMessage(@NotNull final Message message, final Class<T> clazz) {
checkMessageBody(message);
message.getMessageProperties().getHeaders().put(AbstractJavaTypeMapper.DEFAULT_CLASSID_FIELD_NAME,
clazz.getName());
return (T) rabbit... | java | @SuppressWarnings("unchecked")
public <T> T convertMessage(@NotNull final Message message, final Class<T> clazz) {
checkMessageBody(message);
message.getMessageProperties().getHeaders().put(AbstractJavaTypeMapper.DEFAULT_CLASSID_FIELD_NAME,
clazz.getName());
return (T) rabbit... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"convertMessage",
"(",
"@",
"NotNull",
"final",
"Message",
"message",
",",
"final",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"checkMessageBody",
"(",
"message",
")",
";",
... | Is needed to convert a incoming message to is originally object type.
@param message
the message to convert.
@param clazz
the class of the originally object.
@return the converted object | [
"Is",
"needed",
"to",
"convert",
"a",
"incoming",
"message",
"to",
"is",
"originally",
"object",
"type",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/BaseAmqpService.java#L60-L66 |
languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/rules/patterns/MatchState.java | MatchState.convertCase | String convertCase(String s, String sample, Language lang) {
return CaseConversionHelper.convertCase(match.getCaseConversionType(), s, sample, lang);
} | java | String convertCase(String s, String sample, Language lang) {
return CaseConversionHelper.convertCase(match.getCaseConversionType(), s, sample, lang);
} | [
"String",
"convertCase",
"(",
"String",
"s",
",",
"String",
"sample",
",",
"Language",
"lang",
")",
"{",
"return",
"CaseConversionHelper",
".",
"convertCase",
"(",
"match",
".",
"getCaseConversionType",
"(",
")",
",",
"s",
",",
"sample",
",",
"lang",
")",
... | Converts case of the string token according to match element attributes.
@param s Token to be converted.
@param sample the sample string used to determine how the original string looks like (used only on case preservation)
@return Converted string. | [
"Converts",
"case",
"of",
"the",
"string",
"token",
"according",
"to",
"match",
"element",
"attributes",
"."
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/rules/patterns/MatchState.java#L181-L183 |
FINRAOS/DataGenerator | dg-core/src/main/java/org/finra/datagenerator/engine/scxml/tags/InLineTransformerExtension.java | InLineTransformerExtension.pipelinePossibleStates | public List<Map<String, String>> pipelinePossibleStates(TransformTag action,
List<Map<String, String>> possibleStateList) {
DataTransformer tr = transformers.get(action.getName());
DataPipe pipe = new DataPipe(0, null);
for (Map<St... | java | public List<Map<String, String>> pipelinePossibleStates(TransformTag action,
List<Map<String, String>> possibleStateList) {
DataTransformer tr = transformers.get(action.getName());
DataPipe pipe = new DataPipe(0, null);
for (Map<St... | [
"public",
"List",
"<",
"Map",
"<",
"String",
",",
"String",
">",
">",
"pipelinePossibleStates",
"(",
"TransformTag",
"action",
",",
"List",
"<",
"Map",
"<",
"String",
",",
"String",
">",
">",
"possibleStateList",
")",
"{",
"DataTransformer",
"tr",
"=",
"tr... | Applies a stated DataTransformer (given by name in a TransformTag Action) against every possible state
@param action a TransformTag Action
@param possibleStateList a current list of possible states produced so far from expanding a model state
@return the same list of possible states, each processed with the stated Da... | [
"Applies",
"a",
"stated",
"DataTransformer",
"(",
"given",
"by",
"name",
"in",
"a",
"TransformTag",
"Action",
")",
"against",
"every",
"possible",
"state"
] | train | https://github.com/FINRAOS/DataGenerator/blob/1f69f949401cbed4db4f553c3eb8350832c4d45a/dg-core/src/main/java/org/finra/datagenerator/engine/scxml/tags/InLineTransformerExtension.java#L69-L81 |
googleads/googleads-java-lib | modules/ads_lib/src/main/java/com/google/api/ads/adwords/lib/utils/logging/ReportServiceLogger.java | ReportServiceLogger.logRequest | public void logRequest(
@Nullable HttpRequest request, int statusCode, @Nullable String statusMessage) {
boolean isSuccess = HttpStatusCodes.isSuccess(statusCode);
if (!loggerDelegate.isSummaryLoggable(isSuccess)
&& !loggerDelegate.isDetailsLoggable(isSuccess)) {
return;
}
// Popula... | java | public void logRequest(
@Nullable HttpRequest request, int statusCode, @Nullable String statusMessage) {
boolean isSuccess = HttpStatusCodes.isSuccess(statusCode);
if (!loggerDelegate.isSummaryLoggable(isSuccess)
&& !loggerDelegate.isDetailsLoggable(isSuccess)) {
return;
}
// Popula... | [
"public",
"void",
"logRequest",
"(",
"@",
"Nullable",
"HttpRequest",
"request",
",",
"int",
"statusCode",
",",
"@",
"Nullable",
"String",
"statusMessage",
")",
"{",
"boolean",
"isSuccess",
"=",
"HttpStatusCodes",
".",
"isSuccess",
"(",
"statusCode",
")",
";",
... | Logs the specified request and response information.
<p>Note that in order to avoid any temptation to consume the contents of the response, this
does <em>not</em> take an {@link com.google.api.client.http.HttpResponse} object, but instead
accepts the status code and message from the response. | [
"Logs",
"the",
"specified",
"request",
"and",
"response",
"information",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/ads_lib/src/main/java/com/google/api/ads/adwords/lib/utils/logging/ReportServiceLogger.java#L90-L113 |
alkacon/opencms-core | src/org/opencms/workplace/CmsWorkplace.java | CmsWorkplace.buttonBarLabel | public String buttonBarLabel(String label, String className) {
StringBuffer result = new StringBuffer(128);
result.append("<td><span class=\"");
result.append(className);
result.append("\"><span unselectable=\"on\" class=\"txtbutton\">");
result.append(key(label));
resul... | java | public String buttonBarLabel(String label, String className) {
StringBuffer result = new StringBuffer(128);
result.append("<td><span class=\"");
result.append(className);
result.append("\"><span unselectable=\"on\" class=\"txtbutton\">");
result.append(key(label));
resul... | [
"public",
"String",
"buttonBarLabel",
"(",
"String",
"label",
",",
"String",
"className",
")",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
"128",
")",
";",
"result",
".",
"append",
"(",
"\"<td><span class=\\\"\"",
")",
";",
"result",
".",
... | Generates a button bar label.<p>
@param label the label to show
@param className the css class name for the formatting
@return a button bar label | [
"Generates",
"a",
"button",
"bar",
"label",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplace.java#L1330-L1339 |
huahang/crypto-utils | crypto-utils/src/main/java/im/chic/utils/crypto/DigestUtils.java | DigestUtils.dgstHex | public static String dgstHex(InputStream is, Digest digest) throws IOException {
checkNotNull(is);
byte[] dgstBytes = dgst(is, digest);
return BaseEncoding.base16().encode(dgstBytes);
} | java | public static String dgstHex(InputStream is, Digest digest) throws IOException {
checkNotNull(is);
byte[] dgstBytes = dgst(is, digest);
return BaseEncoding.base16().encode(dgstBytes);
} | [
"public",
"static",
"String",
"dgstHex",
"(",
"InputStream",
"is",
",",
"Digest",
"digest",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"is",
")",
";",
"byte",
"[",
"]",
"dgstBytes",
"=",
"dgst",
"(",
"is",
",",
"digest",
")",
";",
"return",
... | Calculates digest and returns the value as a hex string.
@param is input stream
@param digest digest algorithm
@return digest as a hex string
@throws IOException On error reading from the stream | [
"Calculates",
"digest",
"and",
"returns",
"the",
"value",
"as",
"a",
"hex",
"string",
"."
] | train | https://github.com/huahang/crypto-utils/blob/5f158478612698ecfd65fb0a0f9862a54ca17a8d/crypto-utils/src/main/java/im/chic/utils/crypto/DigestUtils.java#L97-L101 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java | ComputeNodesImpl.disableSchedulingAsync | public Observable<Void> disableSchedulingAsync(String poolId, String nodeId) {
return disableSchedulingWithServiceResponseAsync(poolId, nodeId).map(new Func1<ServiceResponseWithHeaders<Void, ComputeNodeDisableSchedulingHeaders>, Void>() {
@Override
public Void call(ServiceResponseWithHea... | java | public Observable<Void> disableSchedulingAsync(String poolId, String nodeId) {
return disableSchedulingWithServiceResponseAsync(poolId, nodeId).map(new Func1<ServiceResponseWithHeaders<Void, ComputeNodeDisableSchedulingHeaders>, Void>() {
@Override
public Void call(ServiceResponseWithHea... | [
"public",
"Observable",
"<",
"Void",
">",
"disableSchedulingAsync",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
")",
"{",
"return",
"disableSchedulingWithServiceResponseAsync",
"(",
"poolId",
",",
"nodeId",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"Servi... | Disables task scheduling on the specified compute node.
You can disable task scheduling on a node only if its current scheduling state is enabled.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the compute node on which you want to disable task scheduling.
@throws IllegalArgum... | [
"Disables",
"task",
"scheduling",
"on",
"the",
"specified",
"compute",
"node",
".",
"You",
"can",
"disable",
"task",
"scheduling",
"on",
"a",
"node",
"only",
"if",
"its",
"current",
"scheduling",
"state",
"is",
"enabled",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java#L1529-L1536 |
hector-client/hector | core/src/main/java/me/prettyprint/cassandra/connection/security/KerberosHelper.java | KerberosHelper.loginService | public static Subject loginService(String serviceName) throws LoginException {
LoginContext loginCtx = new LoginContext(serviceName, new CallbackHandler() {
// as we use .keytab file there is no need to specify any options in callback
public void handle(Callback[] callbacks) throws IOException,
... | java | public static Subject loginService(String serviceName) throws LoginException {
LoginContext loginCtx = new LoginContext(serviceName, new CallbackHandler() {
// as we use .keytab file there is no need to specify any options in callback
public void handle(Callback[] callbacks) throws IOException,
... | [
"public",
"static",
"Subject",
"loginService",
"(",
"String",
"serviceName",
")",
"throws",
"LoginException",
"{",
"LoginContext",
"loginCtx",
"=",
"new",
"LoginContext",
"(",
"serviceName",
",",
"new",
"CallbackHandler",
"(",
")",
"{",
"// as we use .keytab file ther... | Log in using the service name for jaas.conf file and .keytab instead of specifying username and password
@param serviceName service name defined in jass.conf file
@return the authenticated Subject or <code>null</code> is the authentication failed
@throws LoginException if there is any error during the login | [
"Log",
"in",
"using",
"the",
"service",
"name",
"for",
"jaas",
".",
"conf",
"file",
"and",
".",
"keytab",
"instead",
"of",
"specifying",
"username",
"and",
"password"
] | train | https://github.com/hector-client/hector/blob/a302e68ca8d91b45d332e8c9afd7d98030b54de1/core/src/main/java/me/prettyprint/cassandra/connection/security/KerberosHelper.java#L34-L44 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/MessageMap.java | MessageMap.getMultiChoice | private static BigInteger getMultiChoice(int[] choices, JSchema schema, JSVariant var) throws JMFUninitializedAccessException {
int choice = choices[var.getIndex()];
if (choice == -1)
throw new JMFUninitializedAccessException(schema.getPathName(var));
BigInteger ans = BigInteger.ZERO;
// First, ad... | java | private static BigInteger getMultiChoice(int[] choices, JSchema schema, JSVariant var) throws JMFUninitializedAccessException {
int choice = choices[var.getIndex()];
if (choice == -1)
throw new JMFUninitializedAccessException(schema.getPathName(var));
BigInteger ans = BigInteger.ZERO;
// First, ad... | [
"private",
"static",
"BigInteger",
"getMultiChoice",
"(",
"int",
"[",
"]",
"choices",
",",
"JSchema",
"schema",
",",
"JSVariant",
"var",
")",
"throws",
"JMFUninitializedAccessException",
"{",
"int",
"choice",
"=",
"choices",
"[",
"var",
".",
"getIndex",
"(",
"... | Compute the multiChoice code or contribution for an individual variant | [
"Compute",
"the",
"multiChoice",
"code",
"or",
"contribution",
"for",
"an",
"individual",
"variant"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/MessageMap.java#L194-L209 |
Samsung/GearVRf | GVRf/Extensions/3DCursor/IODevices/io_hand_template/src/main/java/com/sample/hand/template/IOBaseComponent.java | IOBaseComponent.setRotation | public void setRotation(float w, float x, float y, float z) {
componentRotation.set(w, x, y, z);
if (sceneObject != null) {
sceneObject.getTransform().setRotation(w, x, y, z);
}
} | java | public void setRotation(float w, float x, float y, float z) {
componentRotation.set(w, x, y, z);
if (sceneObject != null) {
sceneObject.getTransform().setRotation(w, x, y, z);
}
} | [
"public",
"void",
"setRotation",
"(",
"float",
"w",
",",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"componentRotation",
".",
"set",
"(",
"w",
",",
"x",
",",
"y",
",",
"z",
")",
";",
"if",
"(",
"sceneObject",
"!=",
"null",
")",... | Set the rotation for the {@link IOBaseComponent}
@param w the w value of the quaternion
@param x the x value of the quaternion
@param y the y value of the quaternion
@param z the z value of the quaternion | [
"Set",
"the",
"rotation",
"for",
"the",
"{",
"@link",
"IOBaseComponent",
"}"
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/3DCursor/IODevices/io_hand_template/src/main/java/com/sample/hand/template/IOBaseComponent.java#L73-L78 |
landawn/AbacusUtil | src/com/landawn/abacus/util/stream/Collectors.java | Collectors.maxAll | @SuppressWarnings("rawtypes")
public static <T extends Comparable> Collector<T, ?, List<T>> maxAll(final boolean areAllLargestSame) {
return maxAll(Integer.MAX_VALUE, areAllLargestSame);
} | java | @SuppressWarnings("rawtypes")
public static <T extends Comparable> Collector<T, ?, List<T>> maxAll(final boolean areAllLargestSame) {
return maxAll(Integer.MAX_VALUE, areAllLargestSame);
} | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"static",
"<",
"T",
"extends",
"Comparable",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"List",
"<",
"T",
">",
">",
"maxAll",
"(",
"final",
"boolean",
"areAllLargestSame",
")",
"{",
"return",
"... | Use occurrences to save the count of largest objects if {@code areAllLargestSame = true}(e.g. {@code Number/String/...}) and return a list by repeat the largest object {@code n} times.
@param areAllLargestSame
@return
@see Collectors#maxAll(Comparator, int, boolean) | [
"Use",
"occurrences",
"to",
"save",
"the",
"count",
"of",
"largest",
"objects",
"if",
"{",
"@code",
"areAllLargestSame",
"=",
"true",
"}",
"(",
"e",
".",
"g",
".",
"{",
"@code",
"Number",
"/",
"String",
"/",
"...",
"}",
")",
"and",
"return",
"a",
"li... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/stream/Collectors.java#L2173-L2176 |
c2nes/ircbot | brewtab-irc/src/main/java/com/brewtab/irc/impl/ChannelImpl.java | ChannelImpl.refreshNames | public void refreshNames() {
Message namesMessage = new Message(MessageType.NAMES, this.channelName);
List<Message> response;
try {
response = connection.request(
MessageFilters.message(MessageType.RPL_NAMREPLY, null, "=", channelName),
MessageFilters... | java | public void refreshNames() {
Message namesMessage = new Message(MessageType.NAMES, this.channelName);
List<Message> response;
try {
response = connection.request(
MessageFilters.message(MessageType.RPL_NAMREPLY, null, "=", channelName),
MessageFilters... | [
"public",
"void",
"refreshNames",
"(",
")",
"{",
"Message",
"namesMessage",
"=",
"new",
"Message",
"(",
"MessageType",
".",
"NAMES",
",",
"this",
".",
"channelName",
")",
";",
"List",
"<",
"Message",
">",
"response",
";",
"try",
"{",
"response",
"=",
"co... | Makes a NAMES request to the server for this channel. Store the result
replacing any existing names list. The list can be retrieved with
IRCChannel#getNames | [
"Makes",
"a",
"NAMES",
"request",
"to",
"the",
"server",
"for",
"this",
"channel",
".",
"Store",
"the",
"result",
"replacing",
"any",
"existing",
"names",
"list",
".",
"The",
"list",
"can",
"be",
"retrieved",
"with",
"IRCChannel#getNames"
] | train | https://github.com/c2nes/ircbot/blob/29cfc5b921ceee2a35e7d6077c5660e6db63ef35/brewtab-irc/src/main/java/com/brewtab/irc/impl/ChannelImpl.java#L203-L229 |
Activiti/Activiti | activiti-engine/src/main/java/org/activiti/engine/impl/calendar/CronExpression.java | CronExpression.setCalendarHour | protected void setCalendarHour(Calendar cal, int hour) {
cal.set(Calendar.HOUR_OF_DAY, hour);
if (cal.get(Calendar.HOUR_OF_DAY) != hour && hour != 24) {
cal.set(Calendar.HOUR_OF_DAY, hour + 1);
}
} | java | protected void setCalendarHour(Calendar cal, int hour) {
cal.set(Calendar.HOUR_OF_DAY, hour);
if (cal.get(Calendar.HOUR_OF_DAY) != hour && hour != 24) {
cal.set(Calendar.HOUR_OF_DAY, hour + 1);
}
} | [
"protected",
"void",
"setCalendarHour",
"(",
"Calendar",
"cal",
",",
"int",
"hour",
")",
"{",
"cal",
".",
"set",
"(",
"Calendar",
".",
"HOUR_OF_DAY",
",",
"hour",
")",
";",
"if",
"(",
"cal",
".",
"get",
"(",
"Calendar",
".",
"HOUR_OF_DAY",
")",
"!=",
... | Advance the calendar to the particular hour paying particular attention to daylight saving problems.
@param cal
@param hour | [
"Advance",
"the",
"calendar",
"to",
"the",
"particular",
"hour",
"paying",
"particular",
"attention",
"to",
"daylight",
"saving",
"problems",
"."
] | train | https://github.com/Activiti/Activiti/blob/82e2b2cd2083b2f734ca0efc7815389c0f2517d9/activiti-engine/src/main/java/org/activiti/engine/impl/calendar/CronExpression.java#L1313-L1318 |
Azure/azure-sdk-for-java | policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java | PolicyStatesInner.summarizeForResource | public SummarizeResultsInner summarizeForResource(String resourceId, QueryOptions queryOptions) {
return summarizeForResourceWithServiceResponseAsync(resourceId, queryOptions).toBlocking().single().body();
} | java | public SummarizeResultsInner summarizeForResource(String resourceId, QueryOptions queryOptions) {
return summarizeForResourceWithServiceResponseAsync(resourceId, queryOptions).toBlocking().single().body();
} | [
"public",
"SummarizeResultsInner",
"summarizeForResource",
"(",
"String",
"resourceId",
",",
"QueryOptions",
"queryOptions",
")",
"{",
"return",
"summarizeForResourceWithServiceResponseAsync",
"(",
"resourceId",
",",
"queryOptions",
")",
".",
"toBlocking",
"(",
")",
".",
... | Summarizes policy states for the resource.
@param resourceId Resource ID.
@param queryOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@throws QueryFailureException thrown if the request is rejected by server
@throws RuntimeException all other wr... | [
"Summarizes",
"policy",
"states",
"for",
"the",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java#L1565-L1567 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java | SqlExecutor.execute | public static int execute(Connection conn, String sql, Object... params) throws SQLException {
PreparedStatement ps = null;
try {
ps = StatementUtil.prepareStatement(conn, sql, params);
return ps.executeUpdate();
} finally {
DbUtil.close(ps);
}
} | java | public static int execute(Connection conn, String sql, Object... params) throws SQLException {
PreparedStatement ps = null;
try {
ps = StatementUtil.prepareStatement(conn, sql, params);
return ps.executeUpdate();
} finally {
DbUtil.close(ps);
}
} | [
"public",
"static",
"int",
"execute",
"(",
"Connection",
"conn",
",",
"String",
"sql",
",",
"Object",
"...",
"params",
")",
"throws",
"SQLException",
"{",
"PreparedStatement",
"ps",
"=",
"null",
";",
"try",
"{",
"ps",
"=",
"StatementUtil",
".",
"prepareState... | 执行非查询语句<br>
语句包括 插入、更新、删除<br>
此方法不会关闭Connection
@param conn 数据库连接对象
@param sql SQL
@param params 参数
@return 影响的行数
@throws SQLException SQL执行异常 | [
"执行非查询语句<br",
">",
"语句包括",
"插入、更新、删除<br",
">",
"此方法不会关闭Connection"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java#L53-L61 |
Azure/azure-sdk-for-java | eventgrid/resource-manager/v2018_05_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_05_01_preview/implementation/EventSubscriptionsInner.java | EventSubscriptionsInner.createOrUpdateAsync | public Observable<EventSubscriptionInner> createOrUpdateAsync(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo) {
return createOrUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionInfo).map(new Func1<ServiceResponse<EventSubscriptionInner>, Even... | java | public Observable<EventSubscriptionInner> createOrUpdateAsync(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo) {
return createOrUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionInfo).map(new Func1<ServiceResponse<EventSubscriptionInner>, Even... | [
"public",
"Observable",
"<",
"EventSubscriptionInner",
">",
"createOrUpdateAsync",
"(",
"String",
"scope",
",",
"String",
"eventSubscriptionName",
",",
"EventSubscriptionInner",
"eventSubscriptionInfo",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"scope... | Create or update an event subscription.
Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope.
@param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource grou... | [
"Create",
"or",
"update",
"an",
"event",
"subscription",
".",
"Asynchronously",
"creates",
"a",
"new",
"event",
"subscription",
"or",
"updates",
"an",
"existing",
"event",
"subscription",
"based",
"on",
"the",
"specified",
"scope",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2018_05_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_05_01_preview/implementation/EventSubscriptionsInner.java#L264-L271 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java | SqlQueryStatement.setTableAliasForPath | private void setTableAliasForPath(String aPath, List hintClasses, TableAlias anAlias)
{
m_pathToAlias.put(buildAliasKey(aPath, hintClasses), anAlias);
} | java | private void setTableAliasForPath(String aPath, List hintClasses, TableAlias anAlias)
{
m_pathToAlias.put(buildAliasKey(aPath, hintClasses), anAlias);
} | [
"private",
"void",
"setTableAliasForPath",
"(",
"String",
"aPath",
",",
"List",
"hintClasses",
",",
"TableAlias",
"anAlias",
")",
"{",
"m_pathToAlias",
".",
"put",
"(",
"buildAliasKey",
"(",
"aPath",
",",
"hintClasses",
")",
",",
"anAlias",
")",
";",
"}"
] | Set the TableAlias for aPath
@param aPath
@param hintClasses
@param TableAlias | [
"Set",
"the",
"TableAlias",
"for",
"aPath"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java#L1370-L1373 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/utils/BtcFormat.java | BtcFormat.getMicroInstance | public static BtcFormat getMicroInstance(Locale locale, int scale, int... groups) {
return getInstance(MICROCOIN_SCALE, locale, scale, boxAsList(groups));
} | java | public static BtcFormat getMicroInstance(Locale locale, int scale, int... groups) {
return getInstance(MICROCOIN_SCALE, locale, scale, boxAsList(groups));
} | [
"public",
"static",
"BtcFormat",
"getMicroInstance",
"(",
"Locale",
"locale",
",",
"int",
"scale",
",",
"int",
"...",
"groups",
")",
"{",
"return",
"getInstance",
"(",
"MICROCOIN_SCALE",
",",
"locale",
",",
"scale",
",",
"boxAsList",
"(",
"groups",
")",
")",... | Return a new microcoin-denominated formatter for the given locale with the specified
fractional decimal placing. The returned object will format the fractional part of
numbers with the given minimum number of fractional decimal places. Optionally,
repeating integer arguments can be passed, each indicating the size of... | [
"Return",
"a",
"new",
"microcoin",
"-",
"denominated",
"formatter",
"for",
"the",
"given",
"locale",
"with",
"the",
"specified",
"fractional",
"decimal",
"placing",
".",
"The",
"returned",
"object",
"will",
"format",
"the",
"fractional",
"part",
"of",
"numbers",... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/utils/BtcFormat.java#L1048-L1050 |
roboconf/roboconf-platform | core/roboconf-dm-templating/src/main/java/net/roboconf/dm/templating/internal/helpers/AllHelper.java | AllHelper.safeApply | private String safeApply( Collection<InstanceContextBean> instances, Options options, String componentPath )
throws IOException {
// Parse the filter.
String installerName = (String) options.hash.get( "installer" );
final InstanceFilter filter = InstanceFilter.createFilter( componentPath, installerName );
//... | java | private String safeApply( Collection<InstanceContextBean> instances, Options options, String componentPath )
throws IOException {
// Parse the filter.
String installerName = (String) options.hash.get( "installer" );
final InstanceFilter filter = InstanceFilter.createFilter( componentPath, installerName );
//... | [
"private",
"String",
"safeApply",
"(",
"Collection",
"<",
"InstanceContextBean",
">",
"instances",
",",
"Options",
"options",
",",
"String",
"componentPath",
")",
"throws",
"IOException",
"{",
"// Parse the filter.",
"String",
"installerName",
"=",
"(",
"String",
")... | Same as above, but with type-safe arguments.
@param instances the instances to which this helper is applied.
@param options the options of this helper invocation.
@return a string result.
@throws IOException if a template cannot be loaded. | [
"Same",
"as",
"above",
"but",
"with",
"type",
"-",
"safe",
"arguments",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm-templating/src/main/java/net/roboconf/dm/templating/internal/helpers/AllHelper.java#L100-L130 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/jdbc/telemetry/Telemetry.java | Telemetry.createTelemetry | public static Telemetry createTelemetry(Connection conn, int flushSize)
{
try
{
return createTelemetry(conn.unwrap(SnowflakeConnectionV1.class).getSfSession(), flushSize);
}
catch (SQLException ex)
{
logger.debug("input connection is not a SnowflakeConnection");
return null;
... | java | public static Telemetry createTelemetry(Connection conn, int flushSize)
{
try
{
return createTelemetry(conn.unwrap(SnowflakeConnectionV1.class).getSfSession(), flushSize);
}
catch (SQLException ex)
{
logger.debug("input connection is not a SnowflakeConnection");
return null;
... | [
"public",
"static",
"Telemetry",
"createTelemetry",
"(",
"Connection",
"conn",
",",
"int",
"flushSize",
")",
"{",
"try",
"{",
"return",
"createTelemetry",
"(",
"conn",
".",
"unwrap",
"(",
"SnowflakeConnectionV1",
".",
"class",
")",
".",
"getSfSession",
"(",
")... | Initialize the telemetry connector
@param conn connection with the session to use for the connector
@param flushSize maximum size of telemetry batch before flush
@return a telemetry connector | [
"Initialize",
"the",
"telemetry",
"connector"
] | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/jdbc/telemetry/Telemetry.java#L105-L116 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/ObjectExtensions.java | ObjectExtensions.operator_plus | @Pure /* not guaranteed pure , since toString() is invoked on the argument a*/
@Inline("($1 + $2)")
public static String operator_plus(Object a, String b) {
return a + b;
} | java | @Pure /* not guaranteed pure , since toString() is invoked on the argument a*/
@Inline("($1 + $2)")
public static String operator_plus(Object a, String b) {
return a + b;
} | [
"@",
"Pure",
"/* not guaranteed pure , since toString() is invoked on the argument a*/",
"@",
"Inline",
"(",
"\"($1 + $2)\"",
")",
"public",
"static",
"String",
"operator_plus",
"(",
"Object",
"a",
",",
"String",
"b",
")",
"{",
"return",
"a",
"+",
"b",
";",
"}"
] | The binary <code>+</code> operator that concatenates two strings.
@param a
an {@link Object}.
@param b
a {@link String}.
@return <code>a + b</code>
@since 2.3 | [
"The",
"binary",
"<code",
">",
"+",
"<",
"/",
"code",
">",
"operator",
"that",
"concatenates",
"two",
"strings",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/ObjectExtensions.java#L153-L157 |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.parseArrayInitialiserOrGeneratorExpression | private Expr parseArrayInitialiserOrGeneratorExpression(EnclosingScope scope, boolean terminated) {
int start = index;
match(LeftSquare);
if (tryAndMatch(true, RightSquare) != null) {
// this is an empty array initialiser
index = start;
return parseArrayInitialiserExpression(scope, terminated);
} else ... | java | private Expr parseArrayInitialiserOrGeneratorExpression(EnclosingScope scope, boolean terminated) {
int start = index;
match(LeftSquare);
if (tryAndMatch(true, RightSquare) != null) {
// this is an empty array initialiser
index = start;
return parseArrayInitialiserExpression(scope, terminated);
} else ... | [
"private",
"Expr",
"parseArrayInitialiserOrGeneratorExpression",
"(",
"EnclosingScope",
"scope",
",",
"boolean",
"terminated",
")",
"{",
"int",
"start",
"=",
"index",
";",
"match",
"(",
"LeftSquare",
")",
";",
"if",
"(",
"tryAndMatch",
"(",
"true",
",",
"RightSq... | Parse an array initialiser or generator expression, which is of the form:
<pre>
ArrayExpr ::= '[' [ Expr (',' Expr)+ ] ']'
| '[' Expr ';' Expr ']'
</pre>
@param scope
The enclosing scope for this statement, which determines the
set of visible (i.e. declared) variables and also the current
indentation level.
@param te... | [
"Parse",
"an",
"array",
"initialiser",
"or",
"generator",
"expression",
"which",
"is",
"of",
"the",
"form",
":"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L2639-L2659 |
openbaton/openbaton-client | sdk/src/main/java/org/openbaton/sdk/api/rest/NetworkServiceDescriptorAgent.java | NetworkServiceDescriptorAgent.getVNFDependency | @Help(
help =
"get the VirtualNetworkFunctionDescriptor dependency with specific id of a NetworkServiceDescriptor with specific id"
)
public VNFDependency getVNFDependency(final String idNSD, final String idVnfd)
throws SDKException {
String url = idNSD + "/vnfdependencies" + "/" + idVnfd;
... | java | @Help(
help =
"get the VirtualNetworkFunctionDescriptor dependency with specific id of a NetworkServiceDescriptor with specific id"
)
public VNFDependency getVNFDependency(final String idNSD, final String idVnfd)
throws SDKException {
String url = idNSD + "/vnfdependencies" + "/" + idVnfd;
... | [
"@",
"Help",
"(",
"help",
"=",
"\"get the VirtualNetworkFunctionDescriptor dependency with specific id of a NetworkServiceDescriptor with specific id\"",
")",
"public",
"VNFDependency",
"getVNFDependency",
"(",
"final",
"String",
"idNSD",
",",
"final",
"String",
"idVnfd",
")",
... | Return a specific VNFDependency that is contained in a particular NetworkServiceDescriptor.
@param idNSD the ID of the NetworkServiceDescriptor
@param idVnfd the VNFDependencies' ID
@return the VNFDependency
@throws SDKException if the request fails | [
"Return",
"a",
"specific",
"VNFDependency",
"that",
"is",
"contained",
"in",
"a",
"particular",
"NetworkServiceDescriptor",
"."
] | train | https://github.com/openbaton/openbaton-client/blob/6ca6dd6b62a23940d312213d6fa489d5b636061a/sdk/src/main/java/org/openbaton/sdk/api/rest/NetworkServiceDescriptorAgent.java#L227-L235 |
zaproxy/zaproxy | src/org/zaproxy/zap/utils/ApiUtils.java | ApiUtils.getIntParam | public static int getIntParam(JSONObject params, String paramName) throws ApiException {
if (!params.containsKey(paramName)) {
throw new ApiException(ApiException.Type.MISSING_PARAMETER, paramName);
}
try {
return params.getInt(paramName);
} catch (JSONException e) {
throw new ApiException(ApiExceptio... | java | public static int getIntParam(JSONObject params, String paramName) throws ApiException {
if (!params.containsKey(paramName)) {
throw new ApiException(ApiException.Type.MISSING_PARAMETER, paramName);
}
try {
return params.getInt(paramName);
} catch (JSONException e) {
throw new ApiException(ApiExceptio... | [
"public",
"static",
"int",
"getIntParam",
"(",
"JSONObject",
"params",
",",
"String",
"paramName",
")",
"throws",
"ApiException",
"{",
"if",
"(",
"!",
"params",
".",
"containsKey",
"(",
"paramName",
")",
")",
"{",
"throw",
"new",
"ApiException",
"(",
"ApiExc... | Gets the int param with a given name and throws an exception accordingly if not found or
valid.
@param params the params
@param paramName the param name
@return the int param
@throws ApiException the api exception | [
"Gets",
"the",
"int",
"param",
"with",
"a",
"given",
"name",
"and",
"throws",
"an",
"exception",
"accordingly",
"if",
"not",
"found",
"or",
"valid",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/utils/ApiUtils.java#L46-L56 |
alkacon/opencms-core | src/org/opencms/loader/CmsResourceManager.java | CmsResourceManager.getTemplateName | private String getTemplateName(CmsObject cms, CmsResource resource) throws CmsException {
String templateName = (String)(m_templateNameCache.getCachedObject(cms, resource.getRootPath()));
if (templateName == null) {
CmsProperty nameProperty = cms.readPropertyObject(
resource... | java | private String getTemplateName(CmsObject cms, CmsResource resource) throws CmsException {
String templateName = (String)(m_templateNameCache.getCachedObject(cms, resource.getRootPath()));
if (templateName == null) {
CmsProperty nameProperty = cms.readPropertyObject(
resource... | [
"private",
"String",
"getTemplateName",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
")",
"throws",
"CmsException",
"{",
"String",
"templateName",
"=",
"(",
"String",
")",
"(",
"m_templateNameCache",
".",
"getCachedObject",
"(",
"cms",
",",
"resource",... | Gets the template name for a template resource, using a cache for efficiency.<p>
@param cms the current CMS context
@param resource the template resource
@return the template name
@throws CmsException if something goes wrong | [
"Gets",
"the",
"template",
"name",
"for",
"a",
"template",
"resource",
"using",
"a",
"cache",
"for",
"efficiency",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/loader/CmsResourceManager.java#L1292-L1309 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_http_route_routeId_PUT | public void serviceName_http_route_routeId_PUT(String serviceName, Long routeId, OvhRouteHttp body) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/http/route/{routeId}";
StringBuilder sb = path(qPath, serviceName, routeId);
exec(qPath, "PUT", sb.toString(), body);
} | java | public void serviceName_http_route_routeId_PUT(String serviceName, Long routeId, OvhRouteHttp body) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/http/route/{routeId}";
StringBuilder sb = path(qPath, serviceName, routeId);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"serviceName_http_route_routeId_PUT",
"(",
"String",
"serviceName",
",",
"Long",
"routeId",
",",
"OvhRouteHttp",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadbalancing/{serviceName}/http/route/{routeId}\"",
";",
"StringBuild... | Alter this object properties
REST: PUT /ipLoadbalancing/{serviceName}/http/route/{routeId}
@param body [required] New object properties
@param serviceName [required] The internal name of your IP load balancing
@param routeId [required] Id of your route | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L240-L244 |
dadoonet/fscrawler | core/src/main/java/fr/pilato/elasticsearch/crawler/fs/FsParserAbstract.java | FsParserAbstract.updateFsJob | private void updateFsJob(String jobName, LocalDateTime scanDate) throws Exception {
// We need to round that latest date to the lower second and
// remove 2 seconds.
// See #82: https://github.com/dadoonet/fscrawler/issues/82
scanDate = scanDate.minus(2, ChronoUnit.SECONDS);
FsJo... | java | private void updateFsJob(String jobName, LocalDateTime scanDate) throws Exception {
// We need to round that latest date to the lower second and
// remove 2 seconds.
// See #82: https://github.com/dadoonet/fscrawler/issues/82
scanDate = scanDate.minus(2, ChronoUnit.SECONDS);
FsJo... | [
"private",
"void",
"updateFsJob",
"(",
"String",
"jobName",
",",
"LocalDateTime",
"scanDate",
")",
"throws",
"Exception",
"{",
"// We need to round that latest date to the lower second and",
"// remove 2 seconds.",
"// See #82: https://github.com/dadoonet/fscrawler/issues/82",
"scanD... | Update the job metadata
@param jobName job name
@param scanDate last date we scan the dirs
@throws Exception In case of error | [
"Update",
"the",
"job",
"metadata"
] | train | https://github.com/dadoonet/fscrawler/blob/cca00a14e21ef9986aa30e19b160463aed6bf921/core/src/main/java/fr/pilato/elasticsearch/crawler/fs/FsParserAbstract.java#L208-L220 |
kite-sdk/kite | kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/filesystem/FileSystemDatasets.java | FileSystemDatasets.viewForUri | public static <E> View<E> viewForUri(Dataset<E> dataset, String uri) {
return viewForUri(dataset, URI.create(uri));
} | java | public static <E> View<E> viewForUri(Dataset<E> dataset, String uri) {
return viewForUri(dataset, URI.create(uri));
} | [
"public",
"static",
"<",
"E",
">",
"View",
"<",
"E",
">",
"viewForUri",
"(",
"Dataset",
"<",
"E",
">",
"dataset",
",",
"String",
"uri",
")",
"{",
"return",
"viewForUri",
"(",
"dataset",
",",
"URI",
".",
"create",
"(",
"uri",
")",
")",
";",
"}"
] | Convert a URI for a partition directory in a filesystem dataset to a {@link View}
object representing that partition.
@param dataset the (partitioned) filesystem dataset
@param uri the path to the partition directory
@return a view of the partition | [
"Convert",
"a",
"URI",
"for",
"a",
"partition",
"directory",
"in",
"a",
"filesystem",
"dataset",
"to",
"a",
"{"
] | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/filesystem/FileSystemDatasets.java#L52-L54 |
alkacon/opencms-core | src-modules/org/opencms/workplace/commons/CmsPropertyCustom.java | CmsPropertyCustom.actionEdit | @Override
public void actionEdit(HttpServletRequest request) throws JspException {
// save initialized instance of this class in request attribute for included sub-elements
getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, this);
try {
// save the changes only if resou... | java | @Override
public void actionEdit(HttpServletRequest request) throws JspException {
// save initialized instance of this class in request attribute for included sub-elements
getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, this);
try {
// save the changes only if resou... | [
"@",
"Override",
"public",
"void",
"actionEdit",
"(",
"HttpServletRequest",
"request",
")",
"throws",
"JspException",
"{",
"// save initialized instance of this class in request attribute for included sub-elements",
"getJsp",
"(",
")",
".",
"getRequest",
"(",
")",
".",
"set... | Performs the edit properties action, will be called by the JSP page.<p>
@param request the HttpServletRequest
@throws JspException if problems including sub-elements occur | [
"Performs",
"the",
"edit",
"properties",
"action",
"will",
"be",
"called",
"by",
"the",
"JSP",
"page",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsPropertyCustom.java#L113-L127 |
kohsuke/com4j | runtime/src/main/java/com4j/COM4J.java | COM4J.getObject | public static <T extends Com4jObject> T getObject(Class<T> primaryInterface, String fileName, String progId ) {
return new GetObjectTask<T>(fileName,progId,primaryInterface).execute();
} | java | public static <T extends Com4jObject> T getObject(Class<T> primaryInterface, String fileName, String progId ) {
return new GetObjectTask<T>(fileName,progId,primaryInterface).execute();
} | [
"public",
"static",
"<",
"T",
"extends",
"Com4jObject",
">",
"T",
"getObject",
"(",
"Class",
"<",
"T",
">",
"primaryInterface",
",",
"String",
"fileName",
",",
"String",
"progId",
")",
"{",
"return",
"new",
"GetObjectTask",
"<",
"T",
">",
"(",
"fileName",
... | Returns a reference to a COM object primarily by loading a file.
<p>
This method implements the semantics of the {@code GetObject} Visual Basic
function. See <a href="http://msdn2.microsoft.com/en-us/library/e9waz863(VS.71).aspx">MSDN reference</a>
for its semantics.
<p>
This function really has three different mode ... | [
"Returns",
"a",
"reference",
"to",
"a",
"COM",
"object",
"primarily",
"by",
"loading",
"a",
"file",
"."
] | train | https://github.com/kohsuke/com4j/blob/1e690b805fb0e4e9ef61560e20a56335aecb0b24/runtime/src/main/java/com4j/COM4J.java#L257-L259 |
undertow-io/undertow | core/src/main/java/io/undertow/websockets/core/WebSockets.java | WebSockets.sendClose | public static void sendClose(final CloseMessage closeMessage, final WebSocketChannel wsChannel, final WebSocketCallback<Void> callback) {
sendClose(closeMessage, wsChannel, callback, null);
} | java | public static void sendClose(final CloseMessage closeMessage, final WebSocketChannel wsChannel, final WebSocketCallback<Void> callback) {
sendClose(closeMessage, wsChannel, callback, null);
} | [
"public",
"static",
"void",
"sendClose",
"(",
"final",
"CloseMessage",
"closeMessage",
",",
"final",
"WebSocketChannel",
"wsChannel",
",",
"final",
"WebSocketCallback",
"<",
"Void",
">",
"callback",
")",
"{",
"sendClose",
"(",
"closeMessage",
",",
"wsChannel",
","... | Sends a complete close message, invoking the callback when complete
@param closeMessage The close message
@param wsChannel The web socket channel
@param callback The callback to invoke on completion | [
"Sends",
"a",
"complete",
"close",
"message",
"invoking",
"the",
"callback",
"when",
"complete"
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/websockets/core/WebSockets.java#L841-L843 |
nguyenq/tess4j | src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java | ImageIOHelper.createTiffFiles | public static List<File> createTiffFiles(File imageFile, int index) throws IOException {
return createTiffFiles(imageFile, index, false);
} | java | public static List<File> createTiffFiles(File imageFile, int index) throws IOException {
return createTiffFiles(imageFile, index, false);
} | [
"public",
"static",
"List",
"<",
"File",
">",
"createTiffFiles",
"(",
"File",
"imageFile",
",",
"int",
"index",
")",
"throws",
"IOException",
"{",
"return",
"createTiffFiles",
"(",
"imageFile",
",",
"index",
",",
"false",
")",
";",
"}"
] | Creates a list of TIFF image files from an image file. It basically
converts images of other formats to TIFF format, or a multi-page TIFF
image to multiple TIFF image files.
@param imageFile input image file
@param index an index of the page; -1 means all pages, as in a multi-page
TIFF image
@return a list of TIFF ima... | [
"Creates",
"a",
"list",
"of",
"TIFF",
"image",
"files",
"from",
"an",
"image",
"file",
".",
"It",
"basically",
"converts",
"images",
"of",
"other",
"formats",
"to",
"TIFF",
"format",
"or",
"a",
"multi",
"-",
"page",
"TIFF",
"image",
"to",
"multiple",
"TI... | train | https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java#L79-L81 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatednasha/src/main/java/net/minidev/ovh/api/ApiOvhDedicatednasha.java | ApiOvhDedicatednasha.serviceName_partition_partitionName_snapshot_snapshotType_GET | public OvhSnapshot serviceName_partition_partitionName_snapshot_snapshotType_GET(String serviceName, String partitionName, net.minidev.ovh.api.dedicated.storage.OvhSnapshotEnum snapshotType) throws IOException {
String qPath = "/dedicated/nasha/{serviceName}/partition/{partitionName}/snapshot/{snapshotType}";
Strin... | java | public OvhSnapshot serviceName_partition_partitionName_snapshot_snapshotType_GET(String serviceName, String partitionName, net.minidev.ovh.api.dedicated.storage.OvhSnapshotEnum snapshotType) throws IOException {
String qPath = "/dedicated/nasha/{serviceName}/partition/{partitionName}/snapshot/{snapshotType}";
Strin... | [
"public",
"OvhSnapshot",
"serviceName_partition_partitionName_snapshot_snapshotType_GET",
"(",
"String",
"serviceName",
",",
"String",
"partitionName",
",",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"dedicated",
".",
"storage",
".",
"OvhSnapshotEnum",
"snapsho... | Get this object properties
REST: GET /dedicated/nasha/{serviceName}/partition/{partitionName}/snapshot/{snapshotType}
@param serviceName [required] The internal name of your storage
@param partitionName [required] the given name of partition
@param snapshotType [required] the interval of snapshot | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatednasha/src/main/java/net/minidev/ovh/api/ApiOvhDedicatednasha.java#L296-L301 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/BackupLongTermRetentionVaultsInner.java | BackupLongTermRetentionVaultsInner.beginCreateOrUpdate | public BackupLongTermRetentionVaultInner beginCreateOrUpdate(String resourceGroupName, String serverName, String recoveryServicesVaultResourceId) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, recoveryServicesVaultResourceId).toBlocking().single().body();
} | java | public BackupLongTermRetentionVaultInner beginCreateOrUpdate(String resourceGroupName, String serverName, String recoveryServicesVaultResourceId) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, recoveryServicesVaultResourceId).toBlocking().single().body();
} | [
"public",
"BackupLongTermRetentionVaultInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"recoveryServicesVaultResourceId",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",... | Updates a server backup long term retention vault.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param recoveryServicesVaultResourceId The azure recovery service... | [
"Updates",
"a",
"server",
"backup",
"long",
"term",
"retention",
"vault",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/BackupLongTermRetentionVaultsInner.java#L252-L254 |
casbin/jcasbin | src/main/java/org/casbin/jcasbin/model/Policy.java | Policy.removePolicy | public boolean removePolicy(String sec, String ptype, List<String> rule) {
for (int i = 0; i < model.get(sec).get(ptype).policy.size(); i ++) {
List<String> r = model.get(sec).get(ptype).policy.get(i);
if (Util.arrayEquals(rule, r)) {
model.get(sec).get(ptype).policy.remo... | java | public boolean removePolicy(String sec, String ptype, List<String> rule) {
for (int i = 0; i < model.get(sec).get(ptype).policy.size(); i ++) {
List<String> r = model.get(sec).get(ptype).policy.get(i);
if (Util.arrayEquals(rule, r)) {
model.get(sec).get(ptype).policy.remo... | [
"public",
"boolean",
"removePolicy",
"(",
"String",
"sec",
",",
"String",
"ptype",
",",
"List",
"<",
"String",
">",
"rule",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"model",
".",
"get",
"(",
"sec",
")",
".",
"get",
"(",
"ptype",... | removePolicy removes a policy rule from the model.
@param sec the section, "p" or "g".
@param ptype the policy type, "p", "p2", .. or "g", "g2", ..
@param rule the policy rule.
@return succeeds or not. | [
"removePolicy",
"removes",
"a",
"policy",
"rule",
"from",
"the",
"model",
"."
] | train | https://github.com/casbin/jcasbin/blob/b46d7a756b6c39cdb17e0600607e5fcdc66edd11/src/main/java/org/casbin/jcasbin/model/Policy.java#L163-L173 |
mgm-tp/jfunk | jfunk-web/src/main/java/com/mgmtp/jfunk/web/util/WebDriverTool.java | WebDriverTool.processField | public void processField(final By by, final String dataSetKey, final String dataKey) {
checkTopmostElement(by);
fih.by(by).dataSet(dataSets.get(dataSetKey)).dataKey(dataKey).perform();
} | java | public void processField(final By by, final String dataSetKey, final String dataKey) {
checkTopmostElement(by);
fih.by(by).dataSet(dataSets.get(dataSetKey)).dataKey(dataKey).perform();
} | [
"public",
"void",
"processField",
"(",
"final",
"By",
"by",
",",
"final",
"String",
"dataSetKey",
",",
"final",
"String",
"dataKey",
")",
"{",
"checkTopmostElement",
"(",
"by",
")",
";",
"fih",
".",
"by",
"(",
"by",
")",
".",
"dataSet",
"(",
"dataSets",
... | Uses the internal {@link FormInputHandler} to set a form field.
@param by
the {@link By} used to locate the element representing an HTML input or
textarea
@param dataSetKey
the data set key
@param dataKey
the key used to retrieve the value for the field from the data set with the
specifies data set key | [
"Uses",
"the",
"internal",
"{",
"@link",
"FormInputHandler",
"}",
"to",
"set",
"a",
"form",
"field",
"."
] | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-web/src/main/java/com/mgmtp/jfunk/web/util/WebDriverTool.java#L633-L636 |
icode/ameba | src/main/java/ameba/message/jackson/internal/JacksonUtils.java | JacksonUtils.configureMapper | public static void configureMapper(ObjectMapper mapper, Application.Mode mode) {
mapper.registerModule(new GuavaModule());
mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY)
.enable(SerializationFeature.WRITE_ENUMS_USING_INDEX)
.enable(MapperFeature.PROPAGATE... | java | public static void configureMapper(ObjectMapper mapper, Application.Mode mode) {
mapper.registerModule(new GuavaModule());
mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY)
.enable(SerializationFeature.WRITE_ENUMS_USING_INDEX)
.enable(MapperFeature.PROPAGATE... | [
"public",
"static",
"void",
"configureMapper",
"(",
"ObjectMapper",
"mapper",
",",
"Application",
".",
"Mode",
"mode",
")",
"{",
"mapper",
".",
"registerModule",
"(",
"new",
"GuavaModule",
"(",
")",
")",
";",
"mapper",
".",
"setSerializationInclusion",
"(",
"J... | <p>configureMapper.</p>
@param mapper a {@link com.fasterxml.jackson.databind.ObjectMapper} object.
@param mode App mode | [
"<p",
">",
"configureMapper",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/message/jackson/internal/JacksonUtils.java#L93-L107 |
usman-h/Habanero | src/main/java/com/usmanhussain/habanero/configuration/LoadProperties.java | LoadProperties.loadProps | public static void loadProps(Properties props, File file) throws IOException {
FileInputStream fis = null;
try {
fis = new FileInputStream(file);
props.load(fis);
} finally {
if (null != fis) {
fis.close();
}
}
} | java | public static void loadProps(Properties props, File file) throws IOException {
FileInputStream fis = null;
try {
fis = new FileInputStream(file);
props.load(fis);
} finally {
if (null != fis) {
fis.close();
}
}
} | [
"public",
"static",
"void",
"loadProps",
"(",
"Properties",
"props",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"FileInputStream",
"fis",
"=",
"null",
";",
"try",
"{",
"fis",
"=",
"new",
"FileInputStream",
"(",
"file",
")",
";",
"props",
".",
... | Loads in the properties file
@param props Properties being loaded from the file
@param file File declartion that is being used
@throws java.io.IOException IOException is thrown | [
"Loads",
"in",
"the",
"properties",
"file"
] | train | https://github.com/usman-h/Habanero/blob/da962025ee8c2a9da7b28905359a6821b579b6d8/src/main/java/com/usmanhussain/habanero/configuration/LoadProperties.java#L52-L62 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.