repo stringlengths 7 59 | path stringlengths 17 234 | func_name stringlengths 3 117 | original_string stringlengths 63 281k | language stringclasses 1
value | code stringlengths 63 281k | code_tokens listlengths 20 16.3k | docstring stringlengths 1 34k | docstring_tokens listlengths 1 3.44k | sha stringlengths 40 40 | url stringlengths 106 339 | partition stringclasses 3
values | summary stringlengths 3 248 | output stringlengths 142 281k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
hawkular/hawkular-apm | api/src/main/java/org/hawkular/apm/api/model/trace/InteractionNode.java | InteractionNode.multipleConsumers | public boolean multipleConsumers() {
// TODO: When HWKAPM-698 implemented, it may no longer be necessary to capture this info
Set<Property> props=getProperties(Producer.PROPERTY_PUBLISH);
return !props.isEmpty()
&& props.iterator().next().getValue().equalsIgnoreCase(Boolean.TRUE.... | java | public boolean multipleConsumers() {
// TODO: When HWKAPM-698 implemented, it may no longer be necessary to capture this info
Set<Property> props=getProperties(Producer.PROPERTY_PUBLISH);
return !props.isEmpty()
&& props.iterator().next().getValue().equalsIgnoreCase(Boolean.TRUE.... | [
"public",
"boolean",
"multipleConsumers",
"(",
")",
"{",
"// TODO: When HWKAPM-698 implemented, it may no longer be necessary to capture this info",
"Set",
"<",
"Property",
">",
"props",
"=",
"getProperties",
"(",
"Producer",
".",
"PROPERTY_PUBLISH",
")",
";",
"return",
"!"... | This method determines whether the interaction node is associated with
a multi-consumer communication.
@return Whether interaction relates to multiple consumers | [
"This",
"method",
"determines",
"whether",
"the",
"interaction",
"node",
"is",
"associated",
"with",
"a",
"multi",
"-",
"consumer",
"communication",
"."
] | 57a4df0611b359597626563ea5f9ac64d4bb2533 | https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/api/src/main/java/org/hawkular/apm/api/model/trace/InteractionNode.java#L100-L105 | train | Returns true if there are multiple consumers. | Of course, here is the Java code you requested:
```java
public boolean multipleConsumers() {
// TODO: When HWKAPM-698 implemented, it may no longer be necessary to capture this info
Set<Property> props=getProperties(Producer.PROPERTY_PUBLISH);
return !props.isEmpty()
&& props.it... |
thymeleaf/thymeleaf | src/main/java/org/thymeleaf/expression/Strings.java | Strings.listUnCapitalize | public List<String> listUnCapitalize(final List<?> target) {
if (target == null) {
return null;
}
final List<String> result = new ArrayList<String>(target.size() + 2);
for (final Object element : target) {
result.add(unCapitalize(element));
}
retur... | java | public List<String> listUnCapitalize(final List<?> target) {
if (target == null) {
return null;
}
final List<String> result = new ArrayList<String>(target.size() + 2);
for (final Object element : target) {
result.add(unCapitalize(element));
}
retur... | [
"public",
"List",
"<",
"String",
">",
"listUnCapitalize",
"(",
"final",
"List",
"<",
"?",
">",
"target",
")",
"{",
"if",
"(",
"target",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"... | <p>
Convert the first letter into lowercase for
all the elements in the target list.
</p>
@param target the list of Strings to be uncapitalized.
If non-String objects, toString() will be called.
@return a List with the result of uncapitalizing
each element of the target.
@since 1.1.2 | [
"<p",
">",
"Convert",
"the",
"first",
"letter",
"into",
"lowercase",
"for",
"all",
"the",
"elements",
"in",
"the",
"target",
"list",
".",
"<",
"/",
"p",
">"
] | 2b0e6d6d7571fbe638904b5fd222fc9e77188879 | https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/expression/Strings.java#L1323-L1332 | train | List unCapitalize. | Of course, here is the Java code you requested:
```java
public List<String> listUnCapitalize(final List<?> target) {
if (target == null) {
return null;
}
final List<String> result = new ArrayList<String>(target.size() + 2);
for (final Object element : target) {
r... |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/handler/impl/CudaZeroHandler.java | CudaZeroHandler.initCudaContextForThread | protected void initCudaContextForThread(Long threadId) {
// we set device to be used prior to stream creation
nativeOps.setDevice(getDeviceId());
CudaContext context = new CudaContext();
context.initHandle();
context.initOldStream();
context.initStream();
conte... | java | protected void initCudaContextForThread(Long threadId) {
// we set device to be used prior to stream creation
nativeOps.setDevice(getDeviceId());
CudaContext context = new CudaContext();
context.initHandle();
context.initOldStream();
context.initStream();
conte... | [
"protected",
"void",
"initCudaContextForThread",
"(",
"Long",
"threadId",
")",
"{",
"// we set device to be used prior to stream creation",
"nativeOps",
".",
"setDevice",
"(",
"getDeviceId",
"(",
")",
")",
";",
"CudaContext",
"context",
"=",
"new",
"CudaContext",
"(",
... | This method does initialization for thread.
@param threadId | [
"This",
"method",
"does",
"initialization",
"for",
"thread",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/handler/impl/CudaZeroHandler.java#L1256-L1268 | train | Initializes the CudaContext for the given thread. | Of course, here is the Java code you requested:
```java
protected void initCudaContextForThread(Long threadId) {
// we set device to be used prior to stream creation
nativeOps.setDevice(getDeviceId());
CudaContext context = new CudaContext();
context.initHandle();
context.ini... |
hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/StringUtil.java | StringUtil.convertUpperToCamelCase | public static String convertUpperToCamelCase(String _str) {
if (_str == null || isBlank(_str)) {
return _str;
} else if (!_str.contains("_")) {
return (_str.charAt(0) + "").toUpperCase() + _str.substring(1);
}
StringBuffer sb = new StringBuffer(String.valueOf(_st... | java | public static String convertUpperToCamelCase(String _str) {
if (_str == null || isBlank(_str)) {
return _str;
} else if (!_str.contains("_")) {
return (_str.charAt(0) + "").toUpperCase() + _str.substring(1);
}
StringBuffer sb = new StringBuffer(String.valueOf(_st... | [
"public",
"static",
"String",
"convertUpperToCamelCase",
"(",
"String",
"_str",
")",
"{",
"if",
"(",
"_str",
"==",
"null",
"||",
"isBlank",
"(",
"_str",
")",
")",
"{",
"return",
"_str",
";",
"}",
"else",
"if",
"(",
"!",
"_str",
".",
"contains",
"(",
... | Tries to convert upper-case string to camel-case.
The given string will be analyzed and all string parts preceded by an underline character will be
converted to upper-case, all other following characters to lower-case.
@param _str string to convert
@return converted string or original string if there was nothing to do | [
"Tries",
"to",
"convert",
"upper",
"-",
"case",
"string",
"to",
"camel",
"-",
"case",
".",
"The",
"given",
"string",
"will",
"be",
"analyzed",
"and",
"all",
"string",
"parts",
"preceded",
"by",
"an",
"underline",
"character",
"will",
"be",
"converted",
"to... | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/StringUtil.java#L437-L456 | train | Convert the string to upper case. | Of course, here is the Java code you requested:
```java
public static String convertUpperToCamelCase(String _str) {
if (_str == null || isBlank(_str)) {
return _str;
} else if (!_str.contains("_")) {
return (_str.charAt(0) + "").toUpperCase() + _str.substring(1);
}
... |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Entry.java | Entry.setMinimumDuration | public final void setMinimumDuration(Duration duration) {
Objects.requireNonNull(duration);
if (minimumDuration != null) {
minimumDuration.set(duration);
} else {
_minimumDuration = duration;
}
} | java | public final void setMinimumDuration(Duration duration) {
Objects.requireNonNull(duration);
if (minimumDuration != null) {
minimumDuration.set(duration);
} else {
_minimumDuration = duration;
}
} | [
"public",
"final",
"void",
"setMinimumDuration",
"(",
"Duration",
"duration",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"duration",
")",
";",
"if",
"(",
"minimumDuration",
"!=",
"null",
")",
"{",
"minimumDuration",
".",
"set",
"(",
"duration",
")",
";... | Sets the value of {@link #minimumDurationProperty()}.
@param duration the minimum duration | [
"Sets",
"the",
"value",
"of",
"{",
"@link",
"#minimumDurationProperty",
"()",
"}",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Entry.java#L1300-L1307 | train | Sets the minimum duration. | Of course, here is the Java code you requested:
```java
public final void setMinimumDuration(Duration duration) {
Objects.requireNonNull(duration);
if (minimumDuration != null) {
minimumDuration.set(duration);
} else {
_minimumDuration = duration;
}
}
```
Ho... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/ft/point/standard/plug/CFpointObs.java | CFpointObs.identifyEncodingStation | protected boolean identifyEncodingStation(NetcdfDataset ds, EncodingInfo info, CF.FeatureType ftype, Formatter errlog) {
// find the obs dimension
Dimension obsDim = null;
if (info.time.getRank() > 0)
obsDim = info.time.getDimension(info.time.getRank() - 1); // may be time(time) or time(stn, obs)
... | java | protected boolean identifyEncodingStation(NetcdfDataset ds, EncodingInfo info, CF.FeatureType ftype, Formatter errlog) {
// find the obs dimension
Dimension obsDim = null;
if (info.time.getRank() > 0)
obsDim = info.time.getDimension(info.time.getRank() - 1); // may be time(time) or time(stn, obs)
... | [
"protected",
"boolean",
"identifyEncodingStation",
"(",
"NetcdfDataset",
"ds",
",",
"EncodingInfo",
"info",
",",
"CF",
".",
"FeatureType",
"ftype",
",",
"Formatter",
"errlog",
")",
"{",
"// find the obs dimension\r",
"Dimension",
"obsDim",
"=",
"null",
";",
"if",
... | for stations, figure out the encoding | [
"for",
"stations",
"figure",
"out",
"the",
"encoding"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft/point/standard/plug/CFpointObs.java#L691-L730 | test | identifyEncodingStation This is a helper method for identifyStation to identify the station. | Of course, here is the Java code you requested:
```java
protected boolean identifyEncodingStation(NetcdfDataset ds, EncodingInfo info, CF.FeatureType ftype, Formatter errlog) {
// find the obs dimension
Dimension obsDim = null;
if (info.time.getRank() > 0)
obsDim = info.time.getDimension(info.tim... |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/storage/buffer/BufferMgr.java | BufferMgr.unpin | public void unpin(Buffer buff) {
BlockId blk = buff.block();
PinnedBuffer pinnedBuff = pinnedBuffers.get(blk);
if (pinnedBuff != null) {
pinnedBuff.pinnedCount--;
if (pinnedBuff.pinnedCount == 0) {
bufferPool.unpin(buff);
pinnedBuffers.remove(blk);
synchronized (bufferPool... | java | public void unpin(Buffer buff) {
BlockId blk = buff.block();
PinnedBuffer pinnedBuff = pinnedBuffers.get(blk);
if (pinnedBuff != null) {
pinnedBuff.pinnedCount--;
if (pinnedBuff.pinnedCount == 0) {
bufferPool.unpin(buff);
pinnedBuffers.remove(blk);
synchronized (bufferPool... | [
"public",
"void",
"unpin",
"(",
"Buffer",
"buff",
")",
"{",
"BlockId",
"blk",
"=",
"buff",
".",
"block",
"(",
")",
";",
"PinnedBuffer",
"pinnedBuff",
"=",
"pinnedBuffers",
".",
"get",
"(",
"blk",
")",
";",
"if",
"(",
"pinnedBuff",
"!=",
"null",
")",
... | Unpins the specified buffer. If the buffer's pin count becomes 0, then
the threads on the wait list are notified.
@param buff
the buffer to be unpinned | [
"Unpins",
"the",
"specified",
"buffer",
".",
"If",
"the",
"buffer",
"s",
"pin",
"count",
"becomes",
"0",
"then",
"the",
"threads",
"on",
"the",
"wait",
"list",
"are",
"notified",
"."
] | d9a34e876b1b83226036d1fa982a614bbef59bd1 | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/buffer/BufferMgr.java#L237-L253 | train | Unpins the specified buffer from the pool. | Of course, here is the Java code you requested:
```java
public void unpin(Buffer buff) {
BlockId blk = buff.block();
PinnedBuffer pinnedBuff = pinnedBuffers.get(blk);
if (pinnedBuff != null) {
pinnedBuff.pinnedCount--;
if (pinnedBuff.pinnedCount == 0) {
bufferPool.unpin(buff);
pinne... |
apache/incubator-druid | sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java | DruidQuery.toGroupByQuery | @Nullable
public GroupByQuery toGroupByQuery()
{
if (grouping == null) {
return null;
}
final Filtration filtration = Filtration.create(filter).optimize(sourceQuerySignature);
final DimFilterHavingSpec havingSpec;
if (grouping.getHavingFilter() != null) {
havingSpec = new DimFilter... | java | @Nullable
public GroupByQuery toGroupByQuery()
{
if (grouping == null) {
return null;
}
final Filtration filtration = Filtration.create(filter).optimize(sourceQuerySignature);
final DimFilterHavingSpec havingSpec;
if (grouping.getHavingFilter() != null) {
havingSpec = new DimFilter... | [
"@",
"Nullable",
"public",
"GroupByQuery",
"toGroupByQuery",
"(",
")",
"{",
"if",
"(",
"grouping",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"Filtration",
"filtration",
"=",
"Filtration",
".",
"create",
"(",
"filter",
")",
".",
"optimize... | Return this query as a GroupBy query, or null if this query is not compatible with GroupBy.
@return query or null | [
"Return",
"this",
"query",
"as",
"a",
"GroupBy",
"query",
"or",
"null",
"if",
"this",
"query",
"is",
"not",
"compatible",
"with",
"GroupBy",
"."
] | f776b9408962b9006cfcfe4d6c1794751972cc8e | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java#L930-L967 | train | Converts the query to a GroupBy query. | Of course, here is the Java code you requested:
```java
@Nullable
public GroupByQuery toGroupByQuery()
{
if (grouping == null) {
return null;
}
final Filtration filtration = Filtration.create(filter).optimize(sourceQuerySignature);
final DimFilterHavingSpec havingSpec;
if (grouping.getH... |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/utils/UnicastAutoReleaseSubject.java | UnicastAutoReleaseSubject.createWithoutNoSubscriptionTimeout | public static <T> UnicastAutoReleaseSubject<T> createWithoutNoSubscriptionTimeout(Action0 onUnsubscribe) {
State<T> state = new State<T>(onUnsubscribe);
return new UnicastAutoReleaseSubject<T>(state);
} | java | public static <T> UnicastAutoReleaseSubject<T> createWithoutNoSubscriptionTimeout(Action0 onUnsubscribe) {
State<T> state = new State<T>(onUnsubscribe);
return new UnicastAutoReleaseSubject<T>(state);
} | [
"public",
"static",
"<",
"T",
">",
"UnicastAutoReleaseSubject",
"<",
"T",
">",
"createWithoutNoSubscriptionTimeout",
"(",
"Action0",
"onUnsubscribe",
")",
"{",
"State",
"<",
"T",
">",
"state",
"=",
"new",
"State",
"<",
"T",
">",
"(",
"onUnsubscribe",
")",
";... | Creates a new {@link UnicastAutoReleaseSubject} without a no subscription timeout.
<b>This can cause a memory leak in case no one ever subscribes to this subject.</b> See
{@link UnicastAutoReleaseSubject} for details.
@param onUnsubscribe An action to be invoked when the sole subscriber to this {@link Subject} unsubsc... | [
"Creates",
"a",
"new",
"{",
"@link",
"UnicastAutoReleaseSubject",
"}",
"without",
"a",
"no",
"subscription",
"timeout",
".",
"<b",
">",
"This",
"can",
"cause",
"a",
"memory",
"leak",
"in",
"case",
"no",
"one",
"ever",
"subscribes",
"to",
"this",
"subject",
... | 97f0427112c2168fee1d6499904f5fa0e24c6797 | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/utils/UnicastAutoReleaseSubject.java#L91-L94 | train | Create an Auto - Release Subject without a subscription timeout. | Of course, here is the Java code you requested:
```java
public static <T> UnicastAutoReleaseSubject<T> createWithoutNoSubscriptionTimeout(Action0 onUnsubscribe) {
State<T> state = new State<T>(onUnsubscribe);
return new UnicastAutoReleaseSubject<T>(state);
}
```
Hope this helps! |
cdapio/tigon | tigon-yarn/src/main/java/co/cask/tigon/internal/guava/ClassPath.java | ClassPath.getAllClassesRecursive | public ImmutableSet<ClassInfo> getAllClassesRecursive(String packageName) {
checkNotNull(packageName);
String packagePrefix = packageName + '.';
ImmutableSet.Builder<ClassInfo> builder = ImmutableSet.builder();
ImmutableSet<ClassInfo> allClasses = getAllClasses();
List<String> debugData = Lists.newL... | java | public ImmutableSet<ClassInfo> getAllClassesRecursive(String packageName) {
checkNotNull(packageName);
String packagePrefix = packageName + '.';
ImmutableSet.Builder<ClassInfo> builder = ImmutableSet.builder();
ImmutableSet<ClassInfo> allClasses = getAllClasses();
List<String> debugData = Lists.newL... | [
"public",
"ImmutableSet",
"<",
"ClassInfo",
">",
"getAllClassesRecursive",
"(",
"String",
"packageName",
")",
"{",
"checkNotNull",
"(",
"packageName",
")",
";",
"String",
"packagePrefix",
"=",
"packageName",
"+",
"'",
"'",
";",
"ImmutableSet",
".",
"Builder",
"<... | Returns all top level classes whose package name is {@code packageName} or starts with
{@code packageName} followed by a '.'. | [
"Returns",
"all",
"top",
"level",
"classes",
"whose",
"package",
"name",
"is",
"{"
] | 5be6dffd7c79519d1211bb08f75be7dcfbbad392 | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-yarn/src/main/java/co/cask/tigon/internal/guava/ClassPath.java#L145-L158 | train | Get all classes in a package recursively. | Of course, here is the Java code you requested:
```java
public ImmutableSet<ClassInfo> getAllClassesRecursive(String packageName) {
checkNotNull(packageName);
String packagePrefix = packageName + '.';
ImmutableSet.Builder<ClassInfo> builder = ImmutableSet.builder();
ImmutableSet<ClassInfo> allClasses =... |
aws/aws-sdk-java | aws-java-sdk-clouddirectory/src/main/java/com/amazonaws/services/clouddirectory/model/BatchUpdateLinkAttributes.java | BatchUpdateLinkAttributes.setAttributeUpdates | public void setAttributeUpdates(java.util.Collection<LinkAttributeUpdate> attributeUpdates) {
if (attributeUpdates == null) {
this.attributeUpdates = null;
return;
}
this.attributeUpdates = new java.util.ArrayList<LinkAttributeUpdate>(attributeUpdates);
} | java | public void setAttributeUpdates(java.util.Collection<LinkAttributeUpdate> attributeUpdates) {
if (attributeUpdates == null) {
this.attributeUpdates = null;
return;
}
this.attributeUpdates = new java.util.ArrayList<LinkAttributeUpdate>(attributeUpdates);
} | [
"public",
"void",
"setAttributeUpdates",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"LinkAttributeUpdate",
">",
"attributeUpdates",
")",
"{",
"if",
"(",
"attributeUpdates",
"==",
"null",
")",
"{",
"this",
".",
"attributeUpdates",
"=",
"null",
";",
"retu... | <p>
The attributes update structure.
</p>
@param attributeUpdates
The attributes update structure. | [
"<p",
">",
"The",
"attributes",
"update",
"structure",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-clouddirectory/src/main/java/com/amazonaws/services/clouddirectory/model/BatchUpdateLinkAttributes.java#L107-L114 | train | Sets the value of the attributeUpdates property. | Of course, here is the Java code you requested:
```java
public void setAttributeUpdates(java.util.Collection<LinkAttributeUpdate> attributeUpdates) {
if (attributeUpdates == null) {
this.attributeUpdates = null;
return;
}
this.attributeUpdates = new java.util.ArrayList<... |
overturetool/overture | core/codegen/platform/src/main/java/org/overture/codegen/traces/TraceStmBuilder.java | TraceStmBuilder.replaceArgsWithVars | protected List<AVarDeclIR> replaceArgsWithVars(SStmIR callStm)
{
List<AVarDeclIR> decls = new LinkedList<AVarDeclIR>();
if (Settings.dialect != Dialect.VDM_SL)
{
return decls;
}
List<SExpIR> args = null;
if (callStm instanceof SCallStmIR)
{
args = ((SCallStmIR) callStm).getArgs();
} else if (c... | java | protected List<AVarDeclIR> replaceArgsWithVars(SStmIR callStm)
{
List<AVarDeclIR> decls = new LinkedList<AVarDeclIR>();
if (Settings.dialect != Dialect.VDM_SL)
{
return decls;
}
List<SExpIR> args = null;
if (callStm instanceof SCallStmIR)
{
args = ((SCallStmIR) callStm).getArgs();
} else if (c... | [
"protected",
"List",
"<",
"AVarDeclIR",
">",
"replaceArgsWithVars",
"(",
"SStmIR",
"callStm",
")",
"{",
"List",
"<",
"AVarDeclIR",
">",
"decls",
"=",
"new",
"LinkedList",
"<",
"AVarDeclIR",
">",
"(",
")",
";",
"if",
"(",
"Settings",
".",
"dialect",
"!=",
... | Assumes dialect is VDM-SL. This method does not work with store lookups for local variables and since code
generated VDM-SL traces do not rely on this then it is safe to use this method for this dialect.
@param callStm
the call statement for which we want to replace the arguments with variables
@return the variable de... | [
"Assumes",
"dialect",
"is",
"VDM",
"-",
"SL",
".",
"This",
"method",
"does",
"not",
"work",
"with",
"store",
"lookups",
"for",
"local",
"variables",
"and",
"since",
"code",
"generated",
"VDM",
"-",
"SL",
"traces",
"do",
"not",
"rely",
"on",
"this",
"then... | 83175dc6c24fa171cde4fcf61ecb648eba3bdbc1 | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/codegen/platform/src/main/java/org/overture/codegen/traces/TraceStmBuilder.java#L358-L395 | train | Replace args with vars | Of course, here is the Java code you requested:
```java
protected List<AVarDeclIR> replaceArgsWithVars(SStmIR callStm)
{
List<AVarDeclIR> decls = new LinkedList<AVarDeclIR>();
if (Settings.dialect != Dialect.VDM_SL)
{
return decls;
}
List<SExpIR> args = null;
if (callStm instanceof SCallStmIR)
{
... |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationTemplatePersistenceImpl.java | CommerceNotificationTemplatePersistenceImpl.findByGroupId_First | @Override
public CommerceNotificationTemplate findByGroupId_First(long groupId,
OrderByComparator<CommerceNotificationTemplate> orderByComparator)
throws NoSuchNotificationTemplateException {
CommerceNotificationTemplate commerceNotificationTemplate = fetchByGroupId_First(groupId,
orderByComparator);
if (... | java | @Override
public CommerceNotificationTemplate findByGroupId_First(long groupId,
OrderByComparator<CommerceNotificationTemplate> orderByComparator)
throws NoSuchNotificationTemplateException {
CommerceNotificationTemplate commerceNotificationTemplate = fetchByGroupId_First(groupId,
orderByComparator);
if (... | [
"@",
"Override",
"public",
"CommerceNotificationTemplate",
"findByGroupId_First",
"(",
"long",
"groupId",
",",
"OrderByComparator",
"<",
"CommerceNotificationTemplate",
">",
"orderByComparator",
")",
"throws",
"NoSuchNotificationTemplateException",
"{",
"CommerceNotificationTempl... | Returns the first commerce notification template in the ordered set where groupId = ?.
@param groupId the group ID
@param orderByComparator the comparator to order the set by (optionally <code>null</code>)
@return the first matching commerce notification template
@throws NoSuchNotificationTemplateException if a ma... | [
"Returns",
"the",
"first",
"commerce",
"notification",
"template",
"in",
"the",
"ordered",
"set",
"where",
"groupId",
"=",
"?",
";",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationTemplatePersistenceImpl.java#L1713-L1734 | train | Returns the commerce notification template in the ordered set where groupId = ? ; and orderByComparator = null. | Of course, here is the Java code you requested:
```java
@Override
public CommerceNotificationTemplate findByGroupId_First(long groupId,
OrderByComparator<CommerceNotificationTemplate> orderByComparator)
throws NoSuchNotificationTemplateException {
CommerceNotificationTemplate commerceNotificationTemplate = fetc... |
rupertlssmith/lojix | lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/compiler/PositionAndOccurrenceVisitor.java | PositionAndOccurrenceVisitor.enterVariable | protected void enterVariable(Variable variable)
{
// Initialize the count to one or add one to an existing count.
Integer count = (Integer) symbolTable.get(variable.getSymbolKey(), SymbolTableKeys.SYMKEY_VAR_OCCURRENCE_COUNT);
count = (count == null) ? 1 : (count + 1);
symbolTable.pu... | java | protected void enterVariable(Variable variable)
{
// Initialize the count to one or add one to an existing count.
Integer count = (Integer) symbolTable.get(variable.getSymbolKey(), SymbolTableKeys.SYMKEY_VAR_OCCURRENCE_COUNT);
count = (count == null) ? 1 : (count + 1);
symbolTable.pu... | [
"protected",
"void",
"enterVariable",
"(",
"Variable",
"variable",
")",
"{",
"// Initialize the count to one or add one to an existing count.",
"Integer",
"count",
"=",
"(",
"Integer",
")",
"symbolTable",
".",
"get",
"(",
"variable",
".",
"getSymbolKey",
"(",
")",
","... | {@inheritDoc}
<p/>Counts variable occurrences and detects if the variable ever appears in an argument position. | [
"{",
"@inheritDoc",
"}"
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/compiler/PositionAndOccurrenceVisitor.java#L97-L129 | test | Enter a variable in the C ++ language. | Of course, here is the Java code you requested:
```java
protected void enterVariable(Variable variable)
{
// Initialize the count to one or add one to an existing count.
Integer count = (Integer) symbolTable.get(variable.getSymbolKey(), SymbolTableKeys.SYMKEY_VAR_OCCURRENCE_COUNT);
count = ... |
attribyte/wpdb | src/main/java/org/attribyte/wp/db/DB.java | DB.selectPost | public Post.Builder selectPost(final long postId) throws SQLException {
Connection conn = null;
PreparedStatement stmt = null;
ResultSet rs = null;
Timer.Context ctx = metrics.selectPostTimer.time();
try {
conn = connectionSupplier.getConnection();
stmt = conn.prepareStat... | java | public Post.Builder selectPost(final long postId) throws SQLException {
Connection conn = null;
PreparedStatement stmt = null;
ResultSet rs = null;
Timer.Context ctx = metrics.selectPostTimer.time();
try {
conn = connectionSupplier.getConnection();
stmt = conn.prepareStat... | [
"public",
"Post",
".",
"Builder",
"selectPost",
"(",
"final",
"long",
"postId",
")",
"throws",
"SQLException",
"{",
"Connection",
"conn",
"=",
"null",
";",
"PreparedStatement",
"stmt",
"=",
"null",
";",
"ResultSet",
"rs",
"=",
"null",
";",
"Timer",
".",
"C... | Selects a post by id.
@param postId The post id.
@return The post.
@throws SQLException on database error. | [
"Selects",
"a",
"post",
"by",
"id",
"."
] | b9adf6131dfb67899ebff770c9bfeb001cc42f30 | https://github.com/attribyte/wpdb/blob/b9adf6131dfb67899ebff770c9bfeb001cc42f30/src/main/java/org/attribyte/wp/db/DB.java#L1412-L1427 | train | Select a post from the database. | Of course, here is the Java code you requested:
```java
public Post.Builder selectPost(final long postId) throws SQLException {
Connection conn = null;
PreparedStatement stmt = null;
ResultSet rs = null;
Timer.Context ctx = metrics.selectPostTimer.time();
try {
conn = connectionS... |
opencypher/openCypher | tools/grammar/src/main/java/org/opencypher/grammar/Description.java | Description.findStart | private static int findStart( char[] buffer, int start, int end )
{
int pos, cp;
for ( pos = start; pos < end && isWhitespace( cp = codePointAt( buffer, pos ) ); pos += charCount( cp ) )
{
if ( cp == '\n' )
{
start = pos + 1;
}
}
... | java | private static int findStart( char[] buffer, int start, int end )
{
int pos, cp;
for ( pos = start; pos < end && isWhitespace( cp = codePointAt( buffer, pos ) ); pos += charCount( cp ) )
{
if ( cp == '\n' )
{
start = pos + 1;
}
}
... | [
"private",
"static",
"int",
"findStart",
"(",
"char",
"[",
"]",
"buffer",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"int",
"pos",
",",
"cp",
";",
"for",
"(",
"pos",
"=",
"start",
";",
"pos",
"<",
"end",
"&&",
"isWhitespace",
"(",
"cp",
"=... | Find the beginning of the first line that isn't all whitespace. | [
"Find",
"the",
"beginning",
"of",
"the",
"first",
"line",
"that",
"isn",
"t",
"all",
"whitespace",
"."
] | eb780caea625900ddbedd28a1eac9a5dbe09c5f0 | https://github.com/opencypher/openCypher/blob/eb780caea625900ddbedd28a1eac9a5dbe09c5f0/tools/grammar/src/main/java/org/opencypher/grammar/Description.java#L210-L221 | train | Find start of a sequence of whitespaces. | Of course, here is the Java code you requested:
```java
private static int findStart( char[] buffer, int start, int end )
{
int pos, cp;
for ( pos = start; pos < end && isWhitespace( cp = codePointAt( buffer, pos ) ); pos += charCount( cp ) )
{
if ( cp == '\n' )
{
... |
cmis4j/cmis4j-core | src/main/java/org/oasis_open/docs/ns/cmis/messaging/_200908/ObjectFactory.java | ObjectFactory.createGetChildrenIncludeAllowableActions | @XmlElementDecl(namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/", name = "includeAllowableActions", scope = GetChildren.class)
public JAXBElement<Boolean> createGetChildrenIncludeAllowableActions(
Boolean value) {
return new JAXBElement<Boolean>(
_GetObjectOfLatestVersionIncludeAllowable... | java | @XmlElementDecl(namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/", name = "includeAllowableActions", scope = GetChildren.class)
public JAXBElement<Boolean> createGetChildrenIncludeAllowableActions(
Boolean value) {
return new JAXBElement<Boolean>(
_GetObjectOfLatestVersionIncludeAllowable... | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"http://docs.oasis-open.org/ns/cmis/messaging/200908/\"",
",",
"name",
"=",
"\"includeAllowableActions\"",
",",
"scope",
"=",
"GetChildren",
".",
"class",
")",
"public",
"JAXBElement",
"<",
"Boolean",
">",
"createGetChildren... | Create an instance of {@link JAXBElement }{@code <}{@link Boolean }{@code >} | [
"Create",
"an",
"instance",
"of",
"{",
"@link",
"JAXBElement",
"}",
"{",
"@code",
"<",
"}",
"{",
"@link",
"Boolean",
"}",
"{",
"@code",
">",
"}"
] | ab9570b2b04a7d6614ed381a6af28031dbd6e763 | https://github.com/cmis4j/cmis4j-core/blob/ab9570b2b04a7d6614ed381a6af28031dbd6e763/src/main/java/org/oasis_open/docs/ns/cmis/messaging/_200908/ObjectFactory.java#L3059-L3065 | train | Create an instance of the JAXBElement required to include allowable actions on the GetChildren element. | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/", name = "includeAllowableActions", scope = GetChildren.class)
public JAXBElement<Boolean> createGetChildrenIncludeAllowableActions(
Boolean value) {
return new JAXBElement... |
googleads/googleads-java-lib | modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201809/cm/ThirdPartyRedirectAd.java | ThirdPartyRedirectAd.getVideoTypes | public com.google.api.ads.adwords.axis.v201809.cm.VideoType[] getVideoTypes() {
return videoTypes;
} | java | public com.google.api.ads.adwords.axis.v201809.cm.VideoType[] getVideoTypes() {
return videoTypes;
} | [
"public",
"com",
".",
"google",
".",
"api",
".",
"ads",
".",
"adwords",
".",
"axis",
".",
"v201809",
".",
"cm",
".",
"VideoType",
"[",
"]",
"getVideoTypes",
"(",
")",
"{",
"return",
"videoTypes",
";",
"}"
] | Gets the videoTypes value for this ThirdPartyRedirectAd.
@return videoTypes * Video Types of the ad. (RealMedia, Quick Time etc.)
<span class="constraint Selectable">This field
can be selected using the value "VideoTypes".</span> | [
"Gets",
"the",
"videoTypes",
"value",
"for",
"this",
"ThirdPartyRedirectAd",
"."
] | 967957cc4f6076514e3a7926fe653e4f1f7cc9c9 | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201809/cm/ThirdPartyRedirectAd.java#L265-L267 | train | Gets the videoTypes value for this CdnVideo. | Of course, here is the Java code you requested:
```java
public com.google.api.ads.adwords.axis.v201809.cm.VideoType[] getVideoTypes() {
return videoTypes;
}
```
Hope this helps! |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java | FaceletViewDeclarationLanguage.createFaceletFactory | protected FaceletFactory createFaceletFactory(FacesContext context, Compiler compiler)
{
ExternalContext eContext = context.getExternalContext();
// refresh period
long refreshPeriod;
if (context.isProjectStage(ProjectStage.Production))
{
refreshPeriod = WebConfi... | java | protected FaceletFactory createFaceletFactory(FacesContext context, Compiler compiler)
{
ExternalContext eContext = context.getExternalContext();
// refresh period
long refreshPeriod;
if (context.isProjectStage(ProjectStage.Production))
{
refreshPeriod = WebConfi... | [
"protected",
"FaceletFactory",
"createFaceletFactory",
"(",
"FacesContext",
"context",
",",
"Compiler",
"compiler",
")",
"{",
"ExternalContext",
"eContext",
"=",
"context",
".",
"getExternalContext",
"(",
")",
";",
"// refresh period",
"long",
"refreshPeriod",
";",
"i... | Creates a FaceletFactory instance using the specified compiler.
@param context
the current FacesContext
@param compiler
the compiler to be used by the factory
@return the factory used by this VDL to load pages | [
"Creates",
"a",
"FaceletFactory",
"instance",
"using",
"the",
"specified",
"compiler",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java#L2196-L2236 | train | Create a FaceletFactory for the current application. | Of course, here is the Java code you requested:
```java
protected FaceletFactory createFaceletFactory(FacesContext context, Compiler compiler)
{
ExternalContext eContext = context.getExternalContext();
// refresh period
long refreshPeriod;
if (context.isProjectStage(ProjectStage.Pr... |
vdmeer/asciitable | src/main/java/de/vandermeer/asciitable/AT_Row.java | AT_Row.setPaddingLeftRight | public AT_Row setPaddingLeftRight(int padding){
if(this.hasCells()){
for(AT_Cell cell : this.getCells()){
cell.getContext().setPaddingLeftRight(padding);
}
}
return this;
} | java | public AT_Row setPaddingLeftRight(int padding){
if(this.hasCells()){
for(AT_Cell cell : this.getCells()){
cell.getContext().setPaddingLeftRight(padding);
}
}
return this;
} | [
"public",
"AT_Row",
"setPaddingLeftRight",
"(",
"int",
"padding",
")",
"{",
"if",
"(",
"this",
".",
"hasCells",
"(",
")",
")",
"{",
"for",
"(",
"AT_Cell",
"cell",
":",
"this",
".",
"getCells",
"(",
")",
")",
"{",
"cell",
".",
"getContext",
"(",
")",
... | Sets left and right padding for all cells in the row.
@param padding new padding for left and right, ignored if smaller than 0
@return this to allow chaining | [
"Sets",
"left",
"and",
"right",
"padding",
"for",
"all",
"cells",
"in",
"the",
"row",
"."
] | b6a73710271c89f9c749603be856ba84a969ed5f | https://github.com/vdmeer/asciitable/blob/b6a73710271c89f9c749603be856ba84a969ed5f/src/main/java/de/vandermeer/asciitable/AT_Row.java#L199-L206 | train | Sets the left and right padding for all cells in the row. | Of course, here is the Java code you requested:
```java
public AT_Row setPaddingLeftRight(int padding){
if(this.hasCells()){
for(AT_Cell cell : this.getCells()){
cell.getContext().setPaddingLeftRight(padding);
}
}
return this;
}
```
Hope this helps! |
google/closure-compiler | src/com/google/debugging/sourcemap/SourceMapConsumerV3.java | SourceMapConsumerV3.search | private static int search(ArrayList<Entry> entries, int target, int start, int end) {
while (true) {
int mid = ((end - start) / 2) + start;
int compare = compareEntry(entries, mid, target);
if (compare == 0) {
return mid;
} else if (compare < 0) {
// it is in the upper half
... | java | private static int search(ArrayList<Entry> entries, int target, int start, int end) {
while (true) {
int mid = ((end - start) / 2) + start;
int compare = compareEntry(entries, mid, target);
if (compare == 0) {
return mid;
} else if (compare < 0) {
// it is in the upper half
... | [
"private",
"static",
"int",
"search",
"(",
"ArrayList",
"<",
"Entry",
">",
"entries",
",",
"int",
"target",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"while",
"(",
"true",
")",
"{",
"int",
"mid",
"=",
"(",
"(",
"end",
"-",
"start",
")",
"... | Perform a binary search on the array to find a section that covers
the target column. | [
"Perform",
"a",
"binary",
"search",
"on",
"the",
"array",
"to",
"find",
"a",
"section",
"that",
"covers",
"the",
"target",
"column",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/debugging/sourcemap/SourceMapConsumerV3.java#L396-L416 | train | Search for the target entry in the list of entries. | Of course, here is the Java code you requested:
```java
private static int search(ArrayList<Entry> entries, int target, int start, int end) {
while (true) {
int mid = ((end - start) / 2) + start;
int compare = compareEntry(entries, mid, target);
if (compare == 0) {
return mid;
} els... |
graphql-java/java-dataloader | src/main/java/org/dataloader/DataLoader.java | DataLoader.loadMany | public CompletableFuture<List<V>> loadMany(List<K> keys) {
return loadMany(keys, Collections.emptyList());
} | java | public CompletableFuture<List<V>> loadMany(List<K> keys) {
return loadMany(keys, Collections.emptyList());
} | [
"public",
"CompletableFuture",
"<",
"List",
"<",
"V",
">",
">",
"loadMany",
"(",
"List",
"<",
"K",
">",
"keys",
")",
"{",
"return",
"loadMany",
"(",
"keys",
",",
"Collections",
".",
"emptyList",
"(",
")",
")",
";",
"}"
] | Requests to load the list of data provided by the specified keys asynchronously, and returns a composite future
of the resulting values.
<p>
If batching is enabled (the default), you'll have to call {@link DataLoader#dispatch()} at a later stage to
start batch execution. If you forget this call the future will never be... | [
"Requests",
"to",
"load",
"the",
"list",
"of",
"data",
"provided",
"by",
"the",
"specified",
"keys",
"asynchronously",
"and",
"returns",
"a",
"composite",
"future",
"of",
"the",
"resulting",
"values",
".",
"<p",
">",
"If",
"batching",
"is",
"enabled",
"(",
... | dfdc8133ead10aa723f896b4a1fa4a1cec9a6fbc | https://github.com/graphql-java/java-dataloader/blob/dfdc8133ead10aa723f896b4a1fa4a1cec9a6fbc/src/main/java/org/dataloader/DataLoader.java#L415-L417 | train | Load a list of objects from the cache. | Of course, here is the Java code you requested:
```java
public CompletableFuture<List<V>> loadMany(List<K> keys) {
return loadMany(keys, Collections.emptyList());
}
```
Hope this helps! |
lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/AsyncWork.java | AsyncWork.reset | public final void reset() {
unblocked = false;
result = null;
error = null;
cancel = null;
listenersInline = null;
} | java | public final void reset() {
unblocked = false;
result = null;
error = null;
cancel = null;
listenersInline = null;
} | [
"public",
"final",
"void",
"reset",
"(",
")",
"{",
"unblocked",
"=",
"false",
";",
"result",
"=",
"null",
";",
"error",
"=",
"null",
";",
"cancel",
"=",
"null",
";",
"listenersInline",
"=",
"null",
";",
"}"
] | Reset this AsyncWork point to reuse it.
This method remove any previous result, error or cancellation, and mark this AsyncWork as blocked.
Any previous listener is also removed. | [
"Reset",
"this",
"AsyncWork",
"point",
"to",
"reuse",
"it",
".",
"This",
"method",
"remove",
"any",
"previous",
"result",
"error",
"or",
"cancellation",
"and",
"mark",
"this",
"AsyncWork",
"as",
"blocked",
".",
"Any",
"previous",
"listener",
"is",
"also",
"r... | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/AsyncWork.java#L564-L570 | train | Resets the object to its initial state. | Of course, here is the Java code you requested:
```java
public final void reset() {
unblocked = false;
result = null;
error = null;
cancel = null;
listenersInline = null;
}
```
Hope this helps! |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/runtime/cudaGraphicsCubeFace.java | cudaGraphicsCubeFace.stringFor | public static String stringFor(int n)
{
switch (n)
{
case cudaGraphicsCubeFacePositiveX: return "cudaGraphicsCubeFacePositiveX";
case cudaGraphicsCubeFaceNegativeX: return "cudaGraphicsCubeFaceNegativeX";
case cudaGraphicsCubeFacePositiveY: return "cudaGraph... | java | public static String stringFor(int n)
{
switch (n)
{
case cudaGraphicsCubeFacePositiveX: return "cudaGraphicsCubeFacePositiveX";
case cudaGraphicsCubeFaceNegativeX: return "cudaGraphicsCubeFaceNegativeX";
case cudaGraphicsCubeFacePositiveY: return "cudaGraph... | [
"public",
"static",
"String",
"stringFor",
"(",
"int",
"n",
")",
"{",
"switch",
"(",
"n",
")",
"{",
"case",
"cudaGraphicsCubeFacePositiveX",
":",
"return",
"\"cudaGraphicsCubeFacePositiveX\"",
";",
"case",
"cudaGraphicsCubeFaceNegativeX",
":",
"return",
"\"cudaGraphic... | Returns the String identifying the given cudaGraphicsCubeFace
@param n The cudaGraphicsCubeFace
@return The String identifying the given cudaGraphicsCubeFace | [
"Returns",
"the",
"String",
"identifying",
"the",
"given",
"cudaGraphicsCubeFace"
] | 468528b5b9b37dfceb6ed83fcfd889e9b359f984 | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/runtime/cudaGraphicsCubeFace.java#L77-L89 | train | Returns the String identifying the given cudaGraphicsCubeFace | Of course, here is the Java code you requested:
```java
public static String stringFor(int n)
{
switch (n)
{
case cudaGraphicsCubeFacePositiveX: return "cudaGraphicsCubeFacePositiveX";
case cudaGraphicsCubeFaceNegativeX: return "cudaGraphicsCubeFaceNegativeX";
... |
raydac/java-comment-preprocessor | jcp/src/main/java/com/igormaznitsa/meta/common/utils/ThreadUtils.java | ThreadUtils.stackElement | @Weight(Weight.Unit.VARIABLE)
@Nonnull
public static StackTraceElement stackElement() {
final StackTraceElement[] allElements = Thread.currentThread().getStackTrace();
return allElements[2];
} | java | @Weight(Weight.Unit.VARIABLE)
@Nonnull
public static StackTraceElement stackElement() {
final StackTraceElement[] allElements = Thread.currentThread().getStackTrace();
return allElements[2];
} | [
"@",
"Weight",
"(",
"Weight",
".",
"Unit",
".",
"VARIABLE",
")",
"@",
"Nonnull",
"public",
"static",
"StackTraceElement",
"stackElement",
"(",
")",
"{",
"final",
"StackTraceElement",
"[",
"]",
"allElements",
"=",
"Thread",
".",
"currentThread",
"(",
")",
"."... | Get the stack element of the method caller.
@return the stack trace element for the calling method.
@since 1.0 | [
"Get",
"the",
"stack",
"element",
"of",
"the",
"method",
"caller",
"."
] | 83ac87b575ac084914d77695a8c8673de3b8300c | https://github.com/raydac/java-comment-preprocessor/blob/83ac87b575ac084914d77695a8c8673de3b8300c/jcp/src/main/java/com/igormaznitsa/meta/common/utils/ThreadUtils.java#L66-L71 | train | Get the stack element. | Of course, here is the Java code you requested:
```java
@Weight(Weight.Unit.VARIABLE)
@Nonnull
public static StackTraceElement stackElement() {
final StackTraceElement[] allElements = Thread.currentThread().getStackTrace();
return allElements[2];
}
```
Hope this helps! |
bazaarvoice/rison | src/main/java/com/bazaarvoice/jackson/rison/RisonParser.java | RisonParser.nextBooleanValue | @Override
public Boolean nextBooleanValue()
throws IOException, JsonParseException
{
if (_currToken == JsonToken.FIELD_NAME) { // mostly copied from '_nextAfterName'
_nameCopied = false;
JsonToken t = _nextToken;
_nextToken = null;
_currToken =... | java | @Override
public Boolean nextBooleanValue()
throws IOException, JsonParseException
{
if (_currToken == JsonToken.FIELD_NAME) { // mostly copied from '_nextAfterName'
_nameCopied = false;
JsonToken t = _nextToken;
_nextToken = null;
_currToken =... | [
"@",
"Override",
"public",
"Boolean",
"nextBooleanValue",
"(",
")",
"throws",
"IOException",
",",
"JsonParseException",
"{",
"if",
"(",
"_currToken",
"==",
"JsonToken",
".",
"FIELD_NAME",
")",
"{",
"// mostly copied from '_nextAfterName'",
"_nameCopied",
"=",
"false",... | note: identical to one in Utf8StreamParser | [
"note",
":",
"identical",
"to",
"one",
"in",
"Utf8StreamParser"
] | 623bcbcea65081e75e54d27d4e264a1f6840e9ba | https://github.com/bazaarvoice/rison/blob/623bcbcea65081e75e54d27d4e264a1f6840e9ba/src/main/java/com/bazaarvoice/jackson/rison/RisonParser.java#L720-L749 | valid | Returns the next boolean value. | Of course, here is the Java code you requested:
```java
@Override
public Boolean nextBooleanValue()
throws IOException, JsonParseException
{
if (_currToken == JsonToken.FIELD_NAME) { // mostly copied from '_nextAfterName'
_nameCopied = false;
JsonToken t = _nextToken... |
jparsec/jparsec | jparsec/src/main/java/org/jparsec/Parsers.java | Parsers.tokenType | public static <T> Parser<T> tokenType(final Class<? extends T> type, final String name) {
return token(new TokenMap<T>() {
@Override public T map(Token token) {
if (type.isInstance(token.value())) {
return type.cast(token.value());
}
return null;
}
@Override publi... | java | public static <T> Parser<T> tokenType(final Class<? extends T> type, final String name) {
return token(new TokenMap<T>() {
@Override public T map(Token token) {
if (type.isInstance(token.value())) {
return type.cast(token.value());
}
return null;
}
@Override publi... | [
"public",
"static",
"<",
"T",
">",
"Parser",
"<",
"T",
">",
"tokenType",
"(",
"final",
"Class",
"<",
"?",
"extends",
"T",
">",
"type",
",",
"final",
"String",
"name",
")",
"{",
"return",
"token",
"(",
"new",
"TokenMap",
"<",
"T",
">",
"(",
")",
"... | Checks whether the current token value is of {@code type}, in which case, the token value is
returned and parse succeeds.
@param type the expected token value type.
@param name the name of what's logically expected.
@return the new Parser object. | [
"Checks",
"whether",
"the",
"current",
"token",
"value",
"is",
"of",
"{",
"@code",
"type",
"}",
"in",
"which",
"case",
"the",
"token",
"value",
"is",
"returned",
"and",
"parse",
"succeeds",
"."
] | df1280259f5da9eb5ffc537437569dddba66cb94 | https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/Parsers.java#L855-L867 | train | Token type. | Of course, here is the Java code you requested:
```java
public static <T> Parser<T> tokenType(final Class<? extends T> type, final String name) {
return token(new TokenMap<T>() {
@Override public T map(Token token) {
if (type.isInstance(token.value())) {
return type.cast(token.value());
... |
Sonoport/freesound-java | src/main/java/com/sonoport/freesound/response/mapping/Mapper.java | Mapper.parseDate | protected Date parseDate(final String dateString) {
Date date = null;
if (dateString != null) {
try {
final SimpleDateFormat dateFormat = new SimpleDateFormat(FREESOUND_DATE_FORMAT);
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
date = dateFormat.parse(dateString);
} catch (final ParseExce... | java | protected Date parseDate(final String dateString) {
Date date = null;
if (dateString != null) {
try {
final SimpleDateFormat dateFormat = new SimpleDateFormat(FREESOUND_DATE_FORMAT);
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
date = dateFormat.parse(dateString);
} catch (final ParseExce... | [
"protected",
"Date",
"parseDate",
"(",
"final",
"String",
"dateString",
")",
"{",
"Date",
"date",
"=",
"null",
";",
"if",
"(",
"dateString",
"!=",
"null",
")",
"{",
"try",
"{",
"final",
"SimpleDateFormat",
"dateFormat",
"=",
"new",
"SimpleDateFormat",
"(",
... | Parse a date from a {@link String} to a {@link Date} object, assuming the freesound standard format.
@param dateString The string to convert
@return {@link Date} representation | [
"Parse",
"a",
"date",
"from",
"a",
"{",
"@link",
"String",
"}",
"to",
"a",
"{",
"@link",
"Date",
"}",
"object",
"assuming",
"the",
"freesound",
"standard",
"format",
"."
] | ab029e25de068c6f8cc028bc7f916938fd97c036 | https://github.com/Sonoport/freesound-java/blob/ab029e25de068c6f8cc028bc7f916938fd97c036/src/main/java/com/sonoport/freesound/response/mapping/Mapper.java#L161-L175 | train | Parse a date from a string. | Of course, here is the Java code you requested:
```java
protected Date parseDate(final String dateString) {
Date date = null;
if (dateString != null) {
try {
final SimpleDateFormat dateFormat = new SimpleDateFormat(FREESOUND_DATE_FORMAT);
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
date = ... |
youngmonkeys/ezyfox-sfs2x | src/main/java/com/tvd12/ezyfox/sfs2x/command/impl/RoomInfoImpl.java | RoomInfoImpl.getSpectatorsList | @Override
public <T extends ApiGameUser> List<T> getSpectatorsList(Class<?> clazz) {
return CommandUtil.getApiGameUserList(room.getSpectatorsList(), clazz);
} | java | @Override
public <T extends ApiGameUser> List<T> getSpectatorsList(Class<?> clazz) {
return CommandUtil.getApiGameUserList(room.getSpectatorsList(), clazz);
} | [
"@",
"Override",
"public",
"<",
"T",
"extends",
"ApiGameUser",
">",
"List",
"<",
"T",
">",
"getSpectatorsList",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"return",
"CommandUtil",
".",
"getApiGameUserList",
"(",
"room",
".",
"getSpectatorsList",
"(",
... | /* (non-Javadoc)
@see com.tvd12.ezyfox.core.command.FetchRoomInfo#getSpectatorsList(java.lang.Class) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 7e004033a3b551c3ae970a0c8f45db7b1ec144de | https://github.com/youngmonkeys/ezyfox-sfs2x/blob/7e004033a3b551c3ae970a0c8f45db7b1ec144de/src/main/java/com/tvd12/ezyfox/sfs2x/command/impl/RoomInfoImpl.java#L84-L87 | train | Get the list of spectators for a given class. | Of course, here is the Java code you requested:
```java
@Override
public <T extends ApiGameUser> List<T> getSpectatorsList(Class<?> clazz) {
return CommandUtil.getApiGameUserList(room.getSpectatorsList(), clazz);
}
```
Hope this helps! |
apache/incubator-atlas | common/src/main/java/org/apache/atlas/ha/HAConfiguration.java | HAConfiguration.getBoundAddressForId | public static String getBoundAddressForId(Configuration configuration, String serverId) {
String hostPort = configuration.getString(ATLAS_SERVER_ADDRESS_PREFIX +serverId);
boolean isSecure = configuration.getBoolean(SecurityProperties.TLS_ENABLED);
String protocol = (isSecure) ? "https://" : "ht... | java | public static String getBoundAddressForId(Configuration configuration, String serverId) {
String hostPort = configuration.getString(ATLAS_SERVER_ADDRESS_PREFIX +serverId);
boolean isSecure = configuration.getBoolean(SecurityProperties.TLS_ENABLED);
String protocol = (isSecure) ? "https://" : "ht... | [
"public",
"static",
"String",
"getBoundAddressForId",
"(",
"Configuration",
"configuration",
",",
"String",
"serverId",
")",
"{",
"String",
"hostPort",
"=",
"configuration",
".",
"getString",
"(",
"ATLAS_SERVER_ADDRESS_PREFIX",
"+",
"serverId",
")",
";",
"boolean",
... | Get the web server address that a server instance with the passed ID is bound to.
This method uses the property {@link SecurityProperties#TLS_ENABLED} to determine whether
the URL is http or https.
@param configuration underlying configuration
@param serverId serverId whose host:port property is picked to build the w... | [
"Get",
"the",
"web",
"server",
"address",
"that",
"a",
"server",
"instance",
"with",
"the",
"passed",
"ID",
"is",
"bound",
"to",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/common/src/main/java/org/apache/atlas/ha/HAConfiguration.java#L86-L91 | train | Get the bound address for the given server id. | Of course, here is the Java code you requested:
```java
public static String getBoundAddressForId(Configuration configuration, String serverId) {
String hostPort = configuration.getString(ATLAS_SERVER_ADDRESS_PREFIX +serverId);
boolean isSecure = configuration.getBoolean(SecurityProperties.TLS_ENABLED)... |
forge/javaee-descriptors | impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/ejbjar32/RelationshipsTypeImpl.java | RelationshipsTypeImpl.getOrCreateEjbRelation | public EjbRelationType<RelationshipsType<T>> getOrCreateEjbRelation()
{
List<Node> nodeList = childNode.get("ejb-relation");
if (nodeList != null && nodeList.size() > 0)
{
return new EjbRelationTypeImpl<RelationshipsType<T>>(this, "ejb-relation", childNode, nodeList.get(0));
}
... | java | public EjbRelationType<RelationshipsType<T>> getOrCreateEjbRelation()
{
List<Node> nodeList = childNode.get("ejb-relation");
if (nodeList != null && nodeList.size() > 0)
{
return new EjbRelationTypeImpl<RelationshipsType<T>>(this, "ejb-relation", childNode, nodeList.get(0));
}
... | [
"public",
"EjbRelationType",
"<",
"RelationshipsType",
"<",
"T",
">",
">",
"getOrCreateEjbRelation",
"(",
")",
"{",
"List",
"<",
"Node",
">",
"nodeList",
"=",
"childNode",
".",
"get",
"(",
"\"ejb-relation\"",
")",
";",
"if",
"(",
"nodeList",
"!=",
"null",
... | If not already created, a new <code>ejb-relation</code> element will be created and returned.
Otherwise, the first existing <code>ejb-relation</code> element will be returned.
@return the instance defined for the element <code>ejb-relation</code> | [
"If",
"not",
"already",
"created",
"a",
"new",
"<code",
">",
"ejb",
"-",
"relation<",
"/",
"code",
">",
"element",
"will",
"be",
"created",
"and",
"returned",
".",
"Otherwise",
"the",
"first",
"existing",
"<code",
">",
"ejb",
"-",
"relation<",
"/",
"code... | cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed | https://github.com/forge/javaee-descriptors/blob/cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed/impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/ejbjar32/RelationshipsTypeImpl.java#L105-L113 | train | Gets the ejb - relation. | Of course, here is the Java code you requested:
```java
public EjbRelationType<RelationshipsType<T>> getOrCreateEjbRelation()
{
List<Node> nodeList = childNode.get("ejb-relation");
if (nodeList != null && nodeList.size() > 0)
{
return new EjbRelationTypeImpl<RelationshipsType<T>>(this, "... |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatReactiveWebServerFactory.java | TomcatReactiveWebServerFactory.setTomcatConnectorCustomizers | public void setTomcatConnectorCustomizers(
Collection<? extends TomcatConnectorCustomizer> tomcatConnectorCustomizers) {
Assert.notNull(tomcatConnectorCustomizers,
"TomcatConnectorCustomizers must not be null");
this.tomcatConnectorCustomizers = new ArrayList<>(tomcatConnectorCustomizers);
} | java | public void setTomcatConnectorCustomizers(
Collection<? extends TomcatConnectorCustomizer> tomcatConnectorCustomizers) {
Assert.notNull(tomcatConnectorCustomizers,
"TomcatConnectorCustomizers must not be null");
this.tomcatConnectorCustomizers = new ArrayList<>(tomcatConnectorCustomizers);
} | [
"public",
"void",
"setTomcatConnectorCustomizers",
"(",
"Collection",
"<",
"?",
"extends",
"TomcatConnectorCustomizer",
">",
"tomcatConnectorCustomizers",
")",
"{",
"Assert",
".",
"notNull",
"(",
"tomcatConnectorCustomizers",
",",
"\"TomcatConnectorCustomizers must not be null\... | Set {@link TomcatConnectorCustomizer}s that should be applied to the Tomcat
{@link Connector}. Calling this method will replace any existing customizers.
@param tomcatConnectorCustomizers the customizers to set | [
"Set",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatReactiveWebServerFactory.java#L262-L267 | train | Sets the collection of TomcatConnectorCustomizers to use. | Of course, here is the Java code you requested:
```java
public void setTomcatConnectorCustomizers(
Collection<? extends TomcatConnectorCustomizer> tomcatConnectorCustomizers) {
Assert.notNull(tomcatConnectorCustomizers,
"TomcatConnectorCustomizers must not be null");
this.tomcatConnectorCustomizers = new Ar... |
magik6k/JWWF | src/main/java/net/magik6k/jwwf/core/User.java | User.sendGlobal | public final void sendGlobal(String handler, String data) {
try {
connection.sendMessage("{\"id\":-1,\"type\":\"global\",\"handler\":"
+ Json.escapeString(handler) + ",\"data\":" + data + "}");
} catch (IOException e) {
e.printStackTrace();
}
} | java | public final void sendGlobal(String handler, String data) {
try {
connection.sendMessage("{\"id\":-1,\"type\":\"global\",\"handler\":"
+ Json.escapeString(handler) + ",\"data\":" + data + "}");
} catch (IOException e) {
e.printStackTrace();
}
} | [
"public",
"final",
"void",
"sendGlobal",
"(",
"String",
"handler",
",",
"String",
"data",
")",
"{",
"try",
"{",
"connection",
".",
"sendMessage",
"(",
"\"{\\\"id\\\":-1,\\\"type\\\":\\\"global\\\",\\\"handler\\\":\"",
"+",
"Json",
".",
"escapeString",
"(",
"handler",
... | This function is mainly made for plug-in use, it sends
data to global user handler for example to perform some tasks
that aren't related directly to widgets. Global handler is a javascript
function in array named 'global', under key that is passed to this function as
handler parameter. As first argument the javascript ... | [
"This",
"function",
"is",
"mainly",
"made",
"for",
"plug",
"-",
"in",
"use",
"it",
"sends",
"data",
"to",
"global",
"user",
"handler",
"for",
"example",
"to",
"perform",
"some",
"tasks",
"that",
"aren",
"t",
"related",
"directly",
"to",
"widgets",
".",
"... | 8ba334501396c3301495da8708733f6014f20665 | https://github.com/magik6k/JWWF/blob/8ba334501396c3301495da8708733f6014f20665/src/main/java/net/magik6k/jwwf/core/User.java#L58-L65 | train | Send a global message to the server. | Of course, here is the Java code you requested:
```java
public final void sendGlobal(String handler, String data) {
try {
connection.sendMessage("{\"id\":-1,\"type\":\"global\",\"handler\":"
+ Json.escapeString(handler) + ",\"data\":" + data + "}");
} catch (IOException e) {
e.printStackTrace();
}
}
... |
roboconf/roboconf-platform | miscellaneous/roboconf-tooling-core/src/main/java/net/roboconf/tooling/core/TextUtils.java | TextUtils.findRegionFromSelection | public static SelectionRange findRegionFromSelection( String fullText, int selectionOffset, int selectionLength ) {
// Find the whole lines that match the selection (start)
int newSselectionOffset = TextUtils.fixSelectionOffset( fullText, selectionOffset );
// Modifying the offset can make the length slide => u... | java | public static SelectionRange findRegionFromSelection( String fullText, int selectionOffset, int selectionLength ) {
// Find the whole lines that match the selection (start)
int newSselectionOffset = TextUtils.fixSelectionOffset( fullText, selectionOffset );
// Modifying the offset can make the length slide => u... | [
"public",
"static",
"SelectionRange",
"findRegionFromSelection",
"(",
"String",
"fullText",
",",
"int",
"selectionOffset",
",",
"int",
"selectionLength",
")",
"{",
"// Find the whole lines that match the selection (start)",
"int",
"newSselectionOffset",
"=",
"TextUtils",
".",... | Finds the region that includes both the given selection and entire lines.
<p>
Invalid values for the selection settings are fixed by this method.
</p>
@param fullText the full text
@param selectionOffset the selection's offset
@param selectionLength the selection's length
@return a non-null selection range | [
"Finds",
"the",
"region",
"that",
"includes",
"both",
"the",
"given",
"selection",
"and",
"entire",
"lines",
".",
"<p",
">",
"Invalid",
"values",
"for",
"the",
"selection",
"settings",
"are",
"fixed",
"by",
"this",
"method",
".",
"<",
"/",
"p",
">"
] | add54eead479effb138d0ff53a2d637902b82702 | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-tooling-core/src/main/java/net/roboconf/tooling/core/TextUtils.java#L71-L84 | train | Find the region of the text that matches the selection. | Of course, here is the Java code you requested:
```java
public static SelectionRange findRegionFromSelection( String fullText, int selectionOffset, int selectionLength ) {
// Find the whole lines that match the selection (start)
int newSselectionOffset = TextUtils.fixSelectionOffset( fullText, selectionOffset );
... |
bwkimmel/java-util | src/main/java/ca/eandb/util/args/ArgumentProcessor.java | ArgumentProcessor.addCommand | public void addCommand(String key, Command<? super T> handler) {
commands.put(key, handler);
} | java | public void addCommand(String key, Command<? super T> handler) {
commands.put(key, handler);
} | [
"public",
"void",
"addCommand",
"(",
"String",
"key",
",",
"Command",
"<",
"?",
"super",
"T",
">",
"handler",
")",
"{",
"commands",
".",
"put",
"(",
"key",
",",
"handler",
")",
";",
"}"
] | Adds a new command handler.
@param key The <code>String</code> that identifies this command. The
command may be triggered by a command line argument with this
value.
@param handler The <code>Command</code> that is used to process the
command. | [
"Adds",
"a",
"new",
"command",
"handler",
"."
] | 0c03664d42f0e6b111f64447f222aa73c2819e5c | https://github.com/bwkimmel/java-util/blob/0c03664d42f0e6b111f64447f222aa73c2819e5c/src/main/java/ca/eandb/util/args/ArgumentProcessor.java#L539-L541 | train | Add a command to the command list. | Of course, here is the Java code you requested:
```java
public void addCommand(String key, Command<? super T> handler) {
commands.put(key, handler);
}
```
Hope this helps! |
reactor/reactor-core | reactor-core/src/main/java/reactor/core/publisher/Flux.java | Flux.zip | public static <T1, T2> Flux<Tuple2<T1, T2>> zip(Publisher<? extends T1> source1, Publisher<? extends T2> source2) {
return zip(source1, source2, tuple2Function());
} | java | public static <T1, T2> Flux<Tuple2<T1, T2>> zip(Publisher<? extends T1> source1, Publisher<? extends T2> source2) {
return zip(source1, source2, tuple2Function());
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
">",
"Flux",
"<",
"Tuple2",
"<",
"T1",
",",
"T2",
">",
">",
"zip",
"(",
"Publisher",
"<",
"?",
"extends",
"T1",
">",
"source1",
",",
"Publisher",
"<",
"?",
"extends",
"T2",
">",
"source2",
")",
"{",
"retu... | Zip two sources together, that is to say wait for all the sources to emit one
element and combine these elements once into a {@link Tuple2}.
The operator will continue doing so until any of the sources completes.
Errors will immediately be forwarded.
This "Step-Merge" processing is especially useful in Scatter-Gather s... | [
"Zip",
"two",
"sources",
"together",
"that",
"is",
"to",
"say",
"wait",
"for",
"all",
"the",
"sources",
"to",
"emit",
"one",
"element",
"and",
"combine",
"these",
"elements",
"once",
"into",
"a",
"{",
"@link",
"Tuple2",
"}",
".",
"The",
"operator",
"will... | df2eba4ab7d2393e1a942ce972c3307fbbd47ff9 | https://github.com/reactor/reactor-core/blob/df2eba4ab7d2393e1a942ce972c3307fbbd47ff9/reactor-core/src/main/java/reactor/core/publisher/Flux.java#L1916-L1918 | valid | Zip two publishers into a single Flux. | Of course, here is the Java code you requested:
```java
public static <T1, T2> Flux<Tuple2<T1, T2>> zip(Publisher<? extends T1> source1, Publisher<? extends T2> source2) {
return zip(source1, source2, tuple2Function());
}
```
Hope this helps! |
integration-technology/amazon-mws-orders | src/main/java/com/amazonservices/mws/orders/_2013_09_01/model/ListOrderItemsByNextTokenResponse.java | ListOrderItemsByNextTokenResponse.readFragmentFrom | @Override
public void readFragmentFrom(MwsReader r) {
listOrderItemsByNextTokenResult = r.read("ListOrderItemsByNextTokenResult", ListOrderItemsByNextTokenResult.class);
responseMetadata = r.read("ResponseMetadata", ResponseMetadata.class);
} | java | @Override
public void readFragmentFrom(MwsReader r) {
listOrderItemsByNextTokenResult = r.read("ListOrderItemsByNextTokenResult", ListOrderItemsByNextTokenResult.class);
responseMetadata = r.read("ResponseMetadata", ResponseMetadata.class);
} | [
"@",
"Override",
"public",
"void",
"readFragmentFrom",
"(",
"MwsReader",
"r",
")",
"{",
"listOrderItemsByNextTokenResult",
"=",
"r",
".",
"read",
"(",
"\"ListOrderItemsByNextTokenResult\"",
",",
"ListOrderItemsByNextTokenResult",
".",
"class",
")",
";",
"responseMetadat... | Read members from a MwsReader.
@param r
The reader to read from. | [
"Read",
"members",
"from",
"a",
"MwsReader",
"."
] | 042e8cd5b10588a30150222bf9c91faf4f130b3c | https://github.com/integration-technology/amazon-mws-orders/blob/042e8cd5b10588a30150222bf9c91faf4f130b3c/src/main/java/com/amazonservices/mws/orders/_2013_09_01/model/ListOrderItemsByNextTokenResponse.java#L175-L179 | train | read fragment from MWS | Of course, here is the Java code you requested:
```java
@Override
public void readFragmentFrom(MwsReader r) {
listOrderItemsByNextTokenResult = r.read("ListOrderItemsByNextTokenResult", ListOrderItemsByNextTokenResult.class);
responseMetadata = r.read("ResponseMetadata", ResponseMetadata.class);
... |
jbundle/jbundle | thin/base/db/base/src/main/java/org/jbundle/thin/base/db/FieldTable.java | FieldTable.free | public void free()
{
if (m_record != null) // First, release the record for this table
{ // Do not free this.getFieldList() (may be current record)
m_record.setTable(null); // Don't try to free me
m_record.free();
m_record = null;
}
} | java | public void free()
{
if (m_record != null) // First, release the record for this table
{ // Do not free this.getFieldList() (may be current record)
m_record.setTable(null); // Don't try to free me
m_record.free();
m_record = null;
}
} | [
"public",
"void",
"free",
"(",
")",
"{",
"if",
"(",
"m_record",
"!=",
"null",
")",
"// First, release the record for this table",
"{",
"// Do not free this.getFieldList() (may be current record)",
"m_record",
".",
"setTable",
"(",
"null",
")",
";",
"// Don't try to free m... | I'm done with the model, free the resources.
Note: This does not free the associated record. it just nulls the reference.
(although freeing the record will free this table). | [
"I",
"m",
"done",
"with",
"the",
"model",
"free",
"the",
"resources",
".",
"Note",
":",
"This",
"does",
"not",
"free",
"the",
"associated",
"record",
".",
"it",
"just",
"nulls",
"the",
"reference",
".",
"(",
"although",
"freeing",
"the",
"record",
"will"... | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/FieldTable.java#L83-L91 | train | Free the SECTYPE record for this table. | Of course, here is the Java code you requested:
```java
public void free()
{
if (m_record != null) // First, release the record for this table
{ // Do not free this.getFieldList() (may be current record)
m_record.setTable(null); // Don't try to free me
m_record.free();
... |
SonarSource/sonarqube | sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/QualitygatesService.java | QualitygatesService.copy | public void copy(CopyRequest request) {
call(
new PostRequest(path("copy"))
.setParam("id", request.getId())
.setParam("name", request.getName())
.setParam("organization", request.getOrganization())
.setMediaType(MediaTypes.JSON)
).content();
} | java | public void copy(CopyRequest request) {
call(
new PostRequest(path("copy"))
.setParam("id", request.getId())
.setParam("name", request.getName())
.setParam("organization", request.getOrganization())
.setMediaType(MediaTypes.JSON)
).content();
} | [
"public",
"void",
"copy",
"(",
"CopyRequest",
"request",
")",
"{",
"call",
"(",
"new",
"PostRequest",
"(",
"path",
"(",
"\"copy\"",
")",
")",
".",
"setParam",
"(",
"\"id\"",
",",
"request",
".",
"getId",
"(",
")",
")",
".",
"setParam",
"(",
"\"name\"",... | This is part of the internal API.
This is a POST request.
@see <a href="https://next.sonarqube.com/sonarqube/web_api/api/qualitygates/copy">Further information about this action online (including a response example)</a>
@since 4.3 | [
"This",
"is",
"part",
"of",
"the",
"internal",
"API",
".",
"This",
"is",
"a",
"POST",
"request",
"."
] | 2fffa4c2f79ae3714844d7742796e82822b6a98a | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/QualitygatesService.java#L54-L62 | train | Copy a single record set from another record set to another record set. | Of course, here is the Java code you requested:
```java
public void copy(CopyRequest request) {
call(
new PostRequest(path("copy"))
.setParam("id", request.getId())
.setParam("name", request.getName())
.setParam("organization", request.getOrganization())
.setMediaType(MediaTyp... |
languagetool-org/languagetool | languagetool-office-extension/src/main/java/org/languagetool/openoffice/ResultCache.java | ResultCache.add | public void add(int numberOfParagraph, int startOfSentencePosition, int nextSentencePosition, SingleProofreadingError[] errorArray) {
entries.add(new CacheEntry(numberOfParagraph, startOfSentencePosition, nextSentencePosition, errorArray));
} | java | public void add(int numberOfParagraph, int startOfSentencePosition, int nextSentencePosition, SingleProofreadingError[] errorArray) {
entries.add(new CacheEntry(numberOfParagraph, startOfSentencePosition, nextSentencePosition, errorArray));
} | [
"public",
"void",
"add",
"(",
"int",
"numberOfParagraph",
",",
"int",
"startOfSentencePosition",
",",
"int",
"nextSentencePosition",
",",
"SingleProofreadingError",
"[",
"]",
"errorArray",
")",
"{",
"entries",
".",
"add",
"(",
"new",
"CacheEntry",
"(",
"numberOfPa... | Add an cache entry | [
"Add",
"an",
"cache",
"entry"
] | b7a3d63883d242fb2525877c6382681c57a0a142 | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-office-extension/src/main/java/org/languagetool/openoffice/ResultCache.java#L97-L99 | train | Add a new entry to the cache. | Of course, here is the Java code you requested:
```java
public void add(int numberOfParagraph, int startOfSentencePosition, int nextSentencePosition, SingleProofreadingError[] errorArray) {
entries.add(new CacheEntry(numberOfParagraph, startOfSentencePosition, nextSentencePosition, errorArray));
}
```
Hope this... |
netarchivesuite/heritrix3-wrapper | src/main/java/org/netarchivesuite/heritrix3wrapper/ByteRange.java | ByteRange.parse | public static ByteRange parse(String headerValue) {
if (headerValue == null || headerValue.length() == 0) {
return null;
}
try {
int idx = 0;
byte[] arr = headerValue.getBytes();
int len = headerValue.length();
while (idx < len && Chara... | java | public static ByteRange parse(String headerValue) {
if (headerValue == null || headerValue.length() == 0) {
return null;
}
try {
int idx = 0;
byte[] arr = headerValue.getBytes();
int len = headerValue.length();
while (idx < len && Chara... | [
"public",
"static",
"ByteRange",
"parse",
"(",
"String",
"headerValue",
")",
"{",
"if",
"(",
"headerValue",
"==",
"null",
"||",
"headerValue",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"int",
"idx",
"=",
"0... | bytes 1024-2047/128144 | [
"bytes",
"1024",
"-",
"2047",
"/",
"128144"
] | e53ec5736cbac0bdd3925b5331737dc905871629 | https://github.com/netarchivesuite/heritrix3-wrapper/blob/e53ec5736cbac0bdd3925b5331737dc905871629/src/main/java/org/netarchivesuite/heritrix3wrapper/ByteRange.java#L15-L68 | train | Parses the header value to get a ByteRange object. | Of course, here is the Java code you requested:
```java
public static ByteRange parse(String headerValue) {
if (headerValue == null || headerValue.length() == 0) {
return null;
}
try {
int idx = 0;
byte[] arr = headerValue.getBytes();
int len = he... |
T-baby/MongoDB-Plugin | src/main/java/com/cybermkd/mongo/kit/MongoQuery.java | MongoQuery.in | public MongoQuery in(String key, List values) {
if ("_id".equals(key)) {
List<ObjectId> idList = new ArrayList<ObjectId>();
Iterator iter = values.iterator();
while (iter.hasNext()) {
Object value = (Object) iter.next();
idList.add(new ObjectI... | java | public MongoQuery in(String key, List values) {
if ("_id".equals(key)) {
List<ObjectId> idList = new ArrayList<ObjectId>();
Iterator iter = values.iterator();
while (iter.hasNext()) {
Object value = (Object) iter.next();
idList.add(new ObjectI... | [
"public",
"MongoQuery",
"in",
"(",
"String",
"key",
",",
"List",
"values",
")",
"{",
"if",
"(",
"\"_id\"",
".",
"equals",
"(",
"key",
")",
")",
"{",
"List",
"<",
"ObjectId",
">",
"idList",
"=",
"new",
"ArrayList",
"<",
"ObjectId",
">",
"(",
")",
";... | 支持查询id | [
"支持查询id"
] | 288133bd68777c50311e2c5ee8c93163665ffef2 | https://github.com/T-baby/MongoDB-Plugin/blob/288133bd68777c50311e2c5ee8c93163665ffef2/src/main/java/com/cybermkd/mongo/kit/MongoQuery.java#L225-L240 | train | Add a Criterion to the query that requires a value in the specified list of values. | Of course, here is the Java code you requested:
```java
public MongoQuery in(String key, List values) {
if ("_id".equals(key)) {
List<ObjectId> idList = new ArrayList<ObjectId>();
Iterator iter = values.iterator();
while (iter.hasNext()) {
Object value = (Ob... |
aws/aws-sdk-java | aws-java-sdk-directconnect/src/main/java/com/amazonaws/services/directconnect/AmazonDirectConnectClient.java | AmazonDirectConnectClient.describeInterconnectLoa | @Override
@Deprecated
public DescribeInterconnectLoaResult describeInterconnectLoa(DescribeInterconnectLoaRequest request) {
request = beforeClientExecution(request);
return executeDescribeInterconnectLoa(request);
} | java | @Override
@Deprecated
public DescribeInterconnectLoaResult describeInterconnectLoa(DescribeInterconnectLoaRequest request) {
request = beforeClientExecution(request);
return executeDescribeInterconnectLoa(request);
} | [
"@",
"Override",
"@",
"Deprecated",
"public",
"DescribeInterconnectLoaResult",
"describeInterconnectLoa",
"(",
"DescribeInterconnectLoaRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeDescribeInterconnectLoa",... | <p>
Deprecated. Use <a>DescribeLoa</a> instead.
</p>
<p>
Gets the LOA-CFA for the specified interconnect.
</p>
<p>
The Letter of Authorization - Connecting Facility Assignment (LOA-CFA) is a document that is used when
establishing your cross connect to AWS at the colocation facility. For more information, see <a
href="... | [
"<p",
">",
"Deprecated",
".",
"Use",
"<a",
">",
"DescribeLoa<",
"/",
"a",
">",
"instead",
".",
"<",
"/",
"p",
">",
"<p",
">",
"Gets",
"the",
"LOA",
"-",
"CFA",
"for",
"the",
"specified",
"interconnect",
".",
"<",
"/",
"p",
">",
"<p",
">",
"The",
... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-directconnect/src/main/java/com/amazonaws/services/directconnect/AmazonDirectConnectClient.java#L2648-L2653 | train | Retrieves information about an interconnect loa. | Of course, here is the Java code you requested:
```java
@Override
@Deprecated
public DescribeInterconnectLoaResult describeInterconnectLoa(DescribeInterconnectLoaRequest request) {
request = beforeClientExecution(request);
return executeDescribeInterconnectLoa(request);
}
```
Hope this hel... |
sagiegurari/fax4j | src/main/java/org/fax4j/util/DefaultProcessExecutor.java | DefaultProcessExecutor.addPart | protected StringBuilder addPart(List<String> commandList,StringBuilder buffer,int endIndex,boolean typeSpace)
{
int delta=1;
if(typeSpace)
{
delta=0;
}
String part=buffer.substring(delta,endIndex);
commandList.add(part);
buffer.delete(0,en... | java | protected StringBuilder addPart(List<String> commandList,StringBuilder buffer,int endIndex,boolean typeSpace)
{
int delta=1;
if(typeSpace)
{
delta=0;
}
String part=buffer.substring(delta,endIndex);
commandList.add(part);
buffer.delete(0,en... | [
"protected",
"StringBuilder",
"addPart",
"(",
"List",
"<",
"String",
">",
"commandList",
",",
"StringBuilder",
"buffer",
",",
"int",
"endIndex",
",",
"boolean",
"typeSpace",
")",
"{",
"int",
"delta",
"=",
"1",
";",
"if",
"(",
"typeSpace",
")",
"{",
"delta"... | Updates the command list and the buffer.
@param commandList
The command list to update
@param buffer
The input buffer
@param endIndex
The end index in the buffer
@param typeSpace
True space, false for quote
@return The updated buffer | [
"Updates",
"the",
"command",
"list",
"and",
"the",
"buffer",
"."
] | 42fa51acabe7bf279e27ab3dd1cf76146b27955f | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/util/DefaultProcessExecutor.java#L195-L208 | train | Add a single entry to the command list. | Of course, here is the Java code you requested:
```java
protected StringBuilder addPart(List<String> commandList,StringBuilder buffer,int endIndex,boolean typeSpace)
{
int delta=1;
if(typeSpace)
{
delta=0;
}
String part=buffer.substring(delta,endIndex);
... |
mguymon/naether | src/main/java/com/tobedevoured/naether/util/Notation.java | Notation.toUrlPath | public static String toUrlPath(Parent parent) throws IOException {
String relativePath = "pom.xml";
if (relativePath != parent.getRelativePath()) {
if ("".equals(parent.getRelativePath())) {
relativePath = new StringBuilder()
.append(parent.getArtifactId... | java | public static String toUrlPath(Parent parent) throws IOException {
String relativePath = "pom.xml";
if (relativePath != parent.getRelativePath()) {
if ("".equals(parent.getRelativePath())) {
relativePath = new StringBuilder()
.append(parent.getArtifactId... | [
"public",
"static",
"String",
"toUrlPath",
"(",
"Parent",
"parent",
")",
"throws",
"IOException",
"{",
"String",
"relativePath",
"=",
"\"pom.xml\"",
";",
"if",
"(",
"relativePath",
"!=",
"parent",
".",
"getRelativePath",
"(",
")",
")",
"{",
"if",
"(",
"\"\""... | Convert to {@link Parent} into url pom path, e.g. /com/tobedevoured/naether/core/0.15.0/core-0.15.pom.xml
@param parent {@link Parent}
@return String url path
@throws IOException | [
"Convert",
"to",
"{",
"@link",
"Parent",
"}",
"into",
"url",
"pom",
"path",
"e",
".",
"g",
".",
"/",
"com",
"/",
"tobedevoured",
"/",
"naether",
"/",
"core",
"/",
"0",
".",
"15",
".",
"0",
"/",
"core",
"-",
"0",
".",
"15",
".",
"pom",
".",
"x... | 218d8fd36c0b8b6e16d66e5715975570b4560ec4 | https://github.com/mguymon/naether/blob/218d8fd36c0b8b6e16d66e5715975570b4560ec4/src/main/java/com/tobedevoured/naether/util/Notation.java#L242-L270 | train | To url path. | Of course, here is the Java code you requested:
```java
public static String toUrlPath(Parent parent) throws IOException {
String relativePath = "pom.xml";
if (relativePath != parent.getRelativePath()) {
if ("".equals(parent.getRelativePath())) {
relativePath = new StringB... |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/MatchingImpl.java | MatchingImpl.primeMatchParser | public MatchParser primeMatchParser(MatchParser parser,
String selector,
int selectorDomain)
throws MatchingException
{
MatchParser parserimpl = null;
// Drive appropriate parsing dependent on the SelectorDomain
switch(selecto... | java | public MatchParser primeMatchParser(MatchParser parser,
String selector,
int selectorDomain)
throws MatchingException
{
MatchParser parserimpl = null;
// Drive appropriate parsing dependent on the SelectorDomain
switch(selecto... | [
"public",
"MatchParser",
"primeMatchParser",
"(",
"MatchParser",
"parser",
",",
"String",
"selector",
",",
"int",
"selectorDomain",
")",
"throws",
"MatchingException",
"{",
"MatchParser",
"parserimpl",
"=",
"null",
";",
"// Drive appropriate parsing dependent on the Selecto... | Prime a MatchParser object with a String form selector so that its QueryExpr method
will return the corresponding Selector tree.
@param parser an existing MatchParser object to be reused, or null if a new one is to
be created.
@param selector the String-form selector to be parsed
@param strict true if only the JMS s... | [
"Prime",
"a",
"MatchParser",
"object",
"with",
"a",
"String",
"form",
"selector",
"so",
"that",
"its",
"QueryExpr",
"method",
"will",
"return",
"the",
"corresponding",
"Selector",
"tree",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/MatchingImpl.java#L131-L209 | train | This method is called to prime the MatchParser instance. | Of course, here is the Java code you requested:
```java
public MatchParser primeMatchParser(MatchParser parser,
String selector,
int selectorDomain)
throws MatchingException
{
MatchParser parserimpl = null;
// Drive appropriate p... |
alibaba/jstorm | jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/JstormYarnUtils.java | JstormYarnUtils.isPortAvailable | public static boolean isPortAvailable(int port) {
try {
ServerSocket socket = new ServerSocket(port);
socket.close();
return true;
} catch (IOException e) {
return false;
}
} | java | public static boolean isPortAvailable(int port) {
try {
ServerSocket socket = new ServerSocket(port);
socket.close();
return true;
} catch (IOException e) {
return false;
}
} | [
"public",
"static",
"boolean",
"isPortAvailable",
"(",
"int",
"port",
")",
"{",
"try",
"{",
"ServerSocket",
"socket",
"=",
"new",
"ServerSocket",
"(",
"port",
")",
";",
"socket",
".",
"close",
"(",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"I... | See if a port is available for listening on by trying to listen
on it and seeing if that works or fails.
@param port port to listen to
@return true if the port was available for listening on | [
"See",
"if",
"a",
"port",
"is",
"available",
"for",
"listening",
"on",
"by",
"trying",
"to",
"listen",
"on",
"it",
"and",
"seeing",
"if",
"that",
"works",
"or",
"fails",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/JstormYarnUtils.java#L103-L111 | train | Check if the port is available. | Of course, here is the Java code you requested:
```java
public static boolean isPortAvailable(int port) {
try {
ServerSocket socket = new ServerSocket(port);
socket.close();
return true;
} catch (IOException e) {
return false;
}
}
```
Hope th... |
softindex/datakernel | core-promise/src/main/java/io/datakernel/file/AsyncFile.java | AsyncFile.read | public Promise<Void> read(ByteBuf buf, long position) {
return sanitize(ofBlockingRunnable(executor, () -> {
synchronized (mutexLock) {
int readBytes = 0;
long pos = position;
do {
ByteBuffer byteBuffer = buf.toWriteByteBuffer();
try {
readBytes = channel.read(byteBuffer, pos += readByt... | java | public Promise<Void> read(ByteBuf buf, long position) {
return sanitize(ofBlockingRunnable(executor, () -> {
synchronized (mutexLock) {
int readBytes = 0;
long pos = position;
do {
ByteBuffer byteBuffer = buf.toWriteByteBuffer();
try {
readBytes = channel.read(byteBuffer, pos += readByt... | [
"public",
"Promise",
"<",
"Void",
">",
"read",
"(",
"ByteBuf",
"buf",
",",
"long",
"position",
")",
"{",
"return",
"sanitize",
"(",
"ofBlockingRunnable",
"(",
"executor",
",",
"(",
")",
"->",
"{",
"synchronized",
"(",
"mutexLock",
")",
"{",
"int",
"readB... | Reads a sequence of bytes from this channel into the given buffer asynchronously,
starting at the given position.
Reads are happening in other thread(s).
@param buf the buffer into which bytes are to be transferred
@param position the file position at which the transfer is to begin;
must be non-negative | [
"Reads",
"a",
"sequence",
"of",
"bytes",
"from",
"this",
"channel",
"into",
"the",
"given",
"buffer",
"asynchronously",
"starting",
"at",
"the",
"given",
"position",
".",
"Reads",
"are",
"happening",
"in",
"other",
"thread",
"(",
"s",
")",
"."
] | 090ca1116416c14d463d49d275cb1daaafa69c56 | https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-promise/src/main/java/io/datakernel/file/AsyncFile.java#L343-L359 | train | Read data from the file. | Of course, here is the Java code you requested:
```java
public Promise<Void> read(ByteBuf buf, long position) {
return sanitize(ofBlockingRunnable(executor, () -> {
synchronized (mutexLock) {
int readBytes = 0;
long pos = position;
do {
ByteBuffer byteBuffer = buf.toWriteByteBuffer();
try {
... |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/HttpResponse.java | HttpResponse.getContent | public InputStream getContent() throws IOException {
if (!contentRead) {
InputStream lowLevelResponseContent = this.response.getContent();
if (lowLevelResponseContent != null) {
// Flag used to indicate if an exception is thrown before the content is successfully
// processed.
bo... | java | public InputStream getContent() throws IOException {
if (!contentRead) {
InputStream lowLevelResponseContent = this.response.getContent();
if (lowLevelResponseContent != null) {
// Flag used to indicate if an exception is thrown before the content is successfully
// processed.
bo... | [
"public",
"InputStream",
"getContent",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"contentRead",
")",
"{",
"InputStream",
"lowLevelResponseContent",
"=",
"this",
".",
"response",
".",
"getContent",
"(",
")",
";",
"if",
"(",
"lowLevelResponseContent"... | Returns the content of the HTTP response.
<p>The result is cached, so subsequent calls will be fast.
<p>Callers should call {@link InputStream#close} after the returned {@link InputStream} is no
longer needed. Example usage:
<pre>
InputStream is = response.getContent();
try {
// Process the input stream..
} finally ... | [
"Returns",
"the",
"content",
"of",
"the",
"HTTP",
"response",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/HttpResponse.java#L321-L357 | train | Get the content of the response. | Of course, here is the Java code you requested:
```java
public InputStream getContent() throws IOException {
if (!contentRead) {
InputStream lowLevelResponseContent = this.response.getContent();
if (lowLevelResponseContent != null) {
// Flag used to indicate if an exception is thrown before the... |
jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/model/report/parser/BaseMenuParser.java | BaseMenuParser.parseHtmlTag | public boolean parseHtmlTag(PrintWriter out, String strTag, String strParams, String strData)
{
strTag = strTag.toUpperCase();
if (strTag.equalsIgnoreCase("MENUTITLE"))
this.printHtmlTitle(out, strTag, strParams, strData);
else if (strTag.equalsIgnoreCase("MENUDESC"))
... | java | public boolean parseHtmlTag(PrintWriter out, String strTag, String strParams, String strData)
{
strTag = strTag.toUpperCase();
if (strTag.equalsIgnoreCase("MENUTITLE"))
this.printHtmlTitle(out, strTag, strParams, strData);
else if (strTag.equalsIgnoreCase("MENUDESC"))
... | [
"public",
"boolean",
"parseHtmlTag",
"(",
"PrintWriter",
"out",
",",
"String",
"strTag",
",",
"String",
"strParams",
",",
"String",
"strData",
")",
"{",
"strTag",
"=",
"strTag",
".",
"toUpperCase",
"(",
")",
";",
"if",
"(",
"strTag",
".",
"equalsIgnoreCase",... | Process this XML Tag. | [
"Process",
"this",
"XML",
"Tag",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/report/parser/BaseMenuParser.java#L65-L87 | train | Parse the HTML tag. | Of course, here is the Java code you requested:
```java
public boolean parseHtmlTag(PrintWriter out, String strTag, String strParams, String strData)
{
strTag = strTag.toUpperCase();
if (strTag.equalsIgnoreCase("MENUTITLE"))
this.printHtmlTitle(out, strTag, strParams, strData);
... |
moparisthebest/beehive | beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java | ControlBean.postInvoke | protected void postInvoke(Method m, Object [] args, Object retval, Throwable t, String [] interceptorNames, String pivotedInterceptor)
{
try
{
Vector<InvokeListener> invokeListeners = getInvokeListeners();
if (invokeListeners.size() > 0)
{
for (Inv... | java | protected void postInvoke(Method m, Object [] args, Object retval, Throwable t, String [] interceptorNames, String pivotedInterceptor)
{
try
{
Vector<InvokeListener> invokeListeners = getInvokeListeners();
if (invokeListeners.size() > 0)
{
for (Inv... | [
"protected",
"void",
"postInvoke",
"(",
"Method",
"m",
",",
"Object",
"[",
"]",
"args",
",",
"Object",
"retval",
",",
"Throwable",
"t",
",",
"String",
"[",
"]",
"interceptorNames",
",",
"String",
"pivotedInterceptor",
")",
"{",
"try",
"{",
"Vector",
"<",
... | The postInvoke method is called after all operations on the control. In addition to
providing the basic hook for logging, context initialization, resource management, and other common
services, it also provides a hook for interceptors. During preInvoke, interceptors will be
called in the order that they are in the li... | [
"The",
"postInvoke",
"method",
"is",
"called",
"after",
"all",
"operations",
"on",
"the",
"control",
".",
"In",
"addition",
"to",
"providing",
"the",
"basic",
"hook",
"for",
"logging",
"context",
"initialization",
"resource",
"management",
"and",
"other",
"commo... | 4246a0cc40ce3c05f1a02c2da2653ac622703d77 | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java#L448-L484 | train | PostInvoke method. | Of course, here is the Java code you requested:
```java
protected void postInvoke(Method m, Object [] args, Object retval, Throwable t, String [] interceptorNames, String pivotedInterceptor)
{
try
{
Vector<InvokeListener> invokeListeners = getInvokeListeners();
if (invokeLis... |
mikepenz/FastAdapter | library-core/src/main/java/com/mikepenz/fastadapter/select/SelectExtension.java | SelectExtension.selectByIdentifier | public void selectByIdentifier(final long identifier, final boolean fireEvent, final boolean considerSelectableFlag) {
mFastAdapter.recursive(new AdapterPredicate<Item>() {
@Override
public boolean apply(@NonNull IAdapter<Item> lastParentAdapter, int lastParentPosition, Item item, int po... | java | public void selectByIdentifier(final long identifier, final boolean fireEvent, final boolean considerSelectableFlag) {
mFastAdapter.recursive(new AdapterPredicate<Item>() {
@Override
public boolean apply(@NonNull IAdapter<Item> lastParentAdapter, int lastParentPosition, Item item, int po... | [
"public",
"void",
"selectByIdentifier",
"(",
"final",
"long",
"identifier",
",",
"final",
"boolean",
"fireEvent",
",",
"final",
"boolean",
"considerSelectableFlag",
")",
"{",
"mFastAdapter",
".",
"recursive",
"(",
"new",
"AdapterPredicate",
"<",
"Item",
">",
"(",
... | selects an item by it's identifier
@param identifier the identifier of the item to select
@param fireEvent true if the onClick listener should be called
@param considerSelectableFlag true if the select method should not select an item if its not selectable | [
"selects",
"an",
"item",
"by",
"it",
"s",
"identifier"
] | 3b2412abe001ba58422e0125846b704d4dba4ae9 | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/select/SelectExtension.java#L430-L441 | train | Select an item from the adapter with the given identifier. | Of course, here is the Java code you requested:
```java
public void selectByIdentifier(final long identifier, final boolean fireEvent, final boolean considerSelectableFlag) {
mFastAdapter.recursive(new AdapterPredicate<Item>() {
@Override
public boolean apply(@NonNull IAdapter<Item> las... |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/FloatField.java | FloatField.doSetData | public int doSetData(Object data, boolean bDisplayOption, int iMoveMode)
{
if ((data != null) && (!(data instanceof Float)))
return DBConstants.ERROR_RETURN;
return super.doSetData(data, bDisplayOption, iMoveMode);
} | java | public int doSetData(Object data, boolean bDisplayOption, int iMoveMode)
{
if ((data != null) && (!(data instanceof Float)))
return DBConstants.ERROR_RETURN;
return super.doSetData(data, bDisplayOption, iMoveMode);
} | [
"public",
"int",
"doSetData",
"(",
"Object",
"data",
",",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"{",
"if",
"(",
"(",
"data",
"!=",
"null",
")",
"&&",
"(",
"!",
"(",
"data",
"instanceof",
"Float",
")",
")",
")",
"return",
"DBConstan... | Move this physical binary data to this field.
@param data The physical data to move to this field (must be Float raw data class).
@param bDisplayOption If true, display after setting the data.
@param iMoveMode The type of move.
@return an error code (0 if success). | [
"Move",
"this",
"physical",
"binary",
"data",
"to",
"this",
"field",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/FloatField.java#L263-L268 | train | Move the physical binary data to this field. | Of course, here is the Java code you requested:
```java
public int doSetData(Object data, boolean bDisplayOption, int iMoveMode)
{
if ((data != null) && (!(data instanceof Float)))
return DBConstants.ERROR_RETURN;
return super.doSetData(data, bDisplayOption, iMoveMode);
}
```
Hope ... |
alibaba/canal | client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/config/bind/RelaxedDataBinder.java | RelaxedDataBinder.normalizePath | protected String normalizePath(BeanWrapper wrapper, String path) {
return initializePath(wrapper, new RelaxedDataBinder.BeanPath(path), 0);
} | java | protected String normalizePath(BeanWrapper wrapper, String path) {
return initializePath(wrapper, new RelaxedDataBinder.BeanPath(path), 0);
} | [
"protected",
"String",
"normalizePath",
"(",
"BeanWrapper",
"wrapper",
",",
"String",
"path",
")",
"{",
"return",
"initializePath",
"(",
"wrapper",
",",
"new",
"RelaxedDataBinder",
".",
"BeanPath",
"(",
"path",
")",
",",
"0",
")",
";",
"}"
] | Normalize a bean property path to a format understood by a BeanWrapper. This
is used so that
<ul>
<li>Fuzzy matching can be employed for bean property names</li>
<li>Period separators can be used instead of indexing ([...]) for map
keys</li>
</ul>
@param wrapper a bean wrapper for the object to bind
@param path the be... | [
"Normalize",
"a",
"bean",
"property",
"path",
"to",
"a",
"format",
"understood",
"by",
"a",
"BeanWrapper",
".",
"This",
"is",
"used",
"so",
"that",
"<ul",
">",
"<li",
">",
"Fuzzy",
"matching",
"can",
"be",
"employed",
"for",
"bean",
"property",
"names<",
... | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/config/bind/RelaxedDataBinder.java#L239-L241 | train | Normalize the path. | Of course, here is the Java code you requested:
```java
protected String normalizePath(BeanWrapper wrapper, String path) {
return initializePath(wrapper, new RelaxedDataBinder.BeanPath(path), 0);
}
```
Hope this helps! |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.readUtf8Lines | public static List<String> readUtf8Lines(URL url) throws IORuntimeException {
return readLines(url, CharsetUtil.CHARSET_UTF_8);
} | java | public static List<String> readUtf8Lines(URL url) throws IORuntimeException {
return readLines(url, CharsetUtil.CHARSET_UTF_8);
} | [
"public",
"static",
"List",
"<",
"String",
">",
"readUtf8Lines",
"(",
"URL",
"url",
")",
"throws",
"IORuntimeException",
"{",
"return",
"readLines",
"(",
"url",
",",
"CharsetUtil",
".",
"CHARSET_UTF_8",
")",
";",
"}"
] | 从文件中读取每一行数据
@param url 文件的URL
@return 文件中的每行内容的集合List
@throws IORuntimeException IO异常 | [
"从文件中读取每一行数据"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2295-L2297 | train | Reads the contents of the given URL as UTF - 8 lines. | Of course, here is the Java code you requested:
```java
public static List<String> readUtf8Lines(URL url) throws IORuntimeException {
return readLines(url, CharsetUtil.CHARSET_UTF_8);
}
```
Hope this helps! |
gocd/gocd | server/src/main/java/com/thoughtworks/go/server/dao/JobInstanceSqlMapDao.java | JobInstanceSqlMapDao.deleteJobPlanAssociatedEntities | public void deleteJobPlanAssociatedEntities(JobInstance job) {
JobPlan jobPlan = loadPlan(job.getId());
environmentVariableDao.deleteAll(jobPlan.getVariables());
artifactPlanRepository.deleteAll(jobPlan.getArtifactPlansOfType(ArtifactPlanType.file));
artifactPropertiesGeneratorRepository... | java | public void deleteJobPlanAssociatedEntities(JobInstance job) {
JobPlan jobPlan = loadPlan(job.getId());
environmentVariableDao.deleteAll(jobPlan.getVariables());
artifactPlanRepository.deleteAll(jobPlan.getArtifactPlansOfType(ArtifactPlanType.file));
artifactPropertiesGeneratorRepository... | [
"public",
"void",
"deleteJobPlanAssociatedEntities",
"(",
"JobInstance",
"job",
")",
"{",
"JobPlan",
"jobPlan",
"=",
"loadPlan",
"(",
"job",
".",
"getId",
"(",
")",
")",
";",
"environmentVariableDao",
".",
"deleteAll",
"(",
"jobPlan",
".",
"getVariables",
"(",
... | this will be called from Job Status Listener when Job is completed. | [
"this",
"will",
"be",
"called",
"from",
"Job",
"Status",
"Listener",
"when",
"Job",
"is",
"completed",
"."
] | 59a8480e23d6c06de39127635108dff57603cb71 | https://github.com/gocd/gocd/blob/59a8480e23d6c06de39127635108dff57603cb71/server/src/main/java/com/thoughtworks/go/server/dao/JobInstanceSqlMapDao.java#L274-L283 | train | Delete all the job plan associated entities. | Of course, here is the Java code you requested:
```java
public void deleteJobPlanAssociatedEntities(JobInstance job) {
JobPlan jobPlan = loadPlan(job.getId());
environmentVariableDao.deleteAll(jobPlan.getVariables());
artifactPlanRepository.deleteAll(jobPlan.getArtifactPlansOfType(ArtifactPlanT... |
kikinteractive/ice | ice/src/main/java/com/kik/config/ice/internal/ConfigDescriptorFactory.java | ConfigDescriptorFactory.buildDescriptor | public ConfigDescriptor buildDescriptor(Method method, Optional<String> scopeOpt)
{
return buildDescriptor(method, scopeOpt, Optional.empty());
} | java | public ConfigDescriptor buildDescriptor(Method method, Optional<String> scopeOpt)
{
return buildDescriptor(method, scopeOpt, Optional.empty());
} | [
"public",
"ConfigDescriptor",
"buildDescriptor",
"(",
"Method",
"method",
",",
"Optional",
"<",
"String",
">",
"scopeOpt",
")",
"{",
"return",
"buildDescriptor",
"(",
"method",
",",
"scopeOpt",
",",
"Optional",
".",
"empty",
"(",
")",
")",
";",
"}"
] | Build a {@link ConfigDescriptor} for a specific Method, and given optional scope.
@param method method to include in config descriptor
@param scopeOpt optional scope for the config descriptor
@return a {@link ConfigDescriptor} for the given method, to be used internally in the config system. | [
"Build",
"a",
"{",
"@link",
"ConfigDescriptor",
"}",
"for",
"a",
"specific",
"Method",
"and",
"given",
"optional",
"scope",
"."
] | 0c58d7bf2d9f6504892d0768d6022fcfa6df7514 | https://github.com/kikinteractive/ice/blob/0c58d7bf2d9f6504892d0768d6022fcfa6df7514/ice/src/main/java/com/kik/config/ice/internal/ConfigDescriptorFactory.java#L110-L113 | train | Build a config descriptor from a method and scope. | Of course, here is the Java code you requested:
```java
public ConfigDescriptor buildDescriptor(Method method, Optional<String> scopeOpt)
{
return buildDescriptor(method, scopeOpt, Optional.empty());
}
```
Hope this helps! |
jbossws/jbossws-common | src/main/java/org/jboss/ws/common/DOMUtils.java | DOMUtils.parse | public static Element parse(String xmlString) throws IOException
{
try
{
return parse(new ByteArrayInputStream(xmlString.getBytes("UTF-8")));
}
catch (IOException e)
{
ROOT_LOGGER.cannotParse(xmlString);
throw e;
}
} | java | public static Element parse(String xmlString) throws IOException
{
try
{
return parse(new ByteArrayInputStream(xmlString.getBytes("UTF-8")));
}
catch (IOException e)
{
ROOT_LOGGER.cannotParse(xmlString);
throw e;
}
} | [
"public",
"static",
"Element",
"parse",
"(",
"String",
"xmlString",
")",
"throws",
"IOException",
"{",
"try",
"{",
"return",
"parse",
"(",
"new",
"ByteArrayInputStream",
"(",
"xmlString",
".",
"getBytes",
"(",
"\"UTF-8\"",
")",
")",
")",
";",
"}",
"catch",
... | Parse the given XML string and return the root Element
This uses the document builder associated with the current thread. | [
"Parse",
"the",
"given",
"XML",
"string",
"and",
"return",
"the",
"root",
"Element",
"This",
"uses",
"the",
"document",
"builder",
"associated",
"with",
"the",
"current",
"thread",
"."
] | fcff8a3ef9bfe046d6fa8c855a3fe4f62841add7 | https://github.com/jbossws/jbossws-common/blob/fcff8a3ef9bfe046d6fa8c855a3fe4f62841add7/src/main/java/org/jboss/ws/common/DOMUtils.java#L197-L208 | train | Parses an XML string. | Of course, here is the Java code you requested:
```java
public static Element parse(String xmlString) throws IOException
{
try
{
return parse(new ByteArrayInputStream(xmlString.getBytes("UTF-8")));
}
catch (IOException e)
{
ROOT_LOGGER.cannotParse(xmlString);
... |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobInProgress.java | JobInProgress.getTaskTrackerErrors | synchronized Map<String, List<String>> getTaskTrackerErrors() {
// Clone the 'trackerToFailuresMap' and return the copy
Map<String, List<String>> trackerErrors =
new TreeMap<String, List<String>>(trackerToFailuresMap);
return trackerErrors;
} | java | synchronized Map<String, List<String>> getTaskTrackerErrors() {
// Clone the 'trackerToFailuresMap' and return the copy
Map<String, List<String>> trackerErrors =
new TreeMap<String, List<String>>(trackerToFailuresMap);
return trackerErrors;
} | [
"synchronized",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"getTaskTrackerErrors",
"(",
")",
"{",
"// Clone the 'trackerToFailuresMap' and return the copy",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"trackerErrors",
"=",
"new",
... | Get the information on tasktrackers and no. of errors which occurred
on them for a given job.
@return the map of tasktrackers and no. of errors which occurred
on them for a given job. | [
"Get",
"the",
"information",
"on",
"tasktrackers",
"and",
"no",
".",
"of",
"errors",
"which",
"occurred",
"on",
"them",
"for",
"a",
"given",
"job",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobInProgress.java#L2032-L2037 | train | Get the task tracker errors map. | Of course, here is the Java code you requested:
```java
synchronized Map<String, List<String>> getTaskTrackerErrors() {
// Clone the 'trackerToFailuresMap' and return the copy
Map<String, List<String>> trackerErrors =
new TreeMap<String, List<String>>(trackerToFailuresMap);
return trackerErrors;
}
... |
liquibase/liquibase | liquibase-core/src/main/java/liquibase/integration/commandline/Main.java | Main.parsePropertiesFile | protected void parsePropertiesFile(InputStream propertiesInputStream) throws IOException,
CommandLineParsingException {
Properties props = new Properties();
props.load(propertiesInputStream);
if (props.containsKey("strict")) {
strict = Boolean.valueOf(props.getProperty("s... | java | protected void parsePropertiesFile(InputStream propertiesInputStream) throws IOException,
CommandLineParsingException {
Properties props = new Properties();
props.load(propertiesInputStream);
if (props.containsKey("strict")) {
strict = Boolean.valueOf(props.getProperty("s... | [
"protected",
"void",
"parsePropertiesFile",
"(",
"InputStream",
"propertiesInputStream",
")",
"throws",
"IOException",
",",
"CommandLineParsingException",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"props",
".",
"load",
"(",
"propertiesInputS... | Reads various execution parameters from an InputStream and sets our internal state according to the values
found.
@param propertiesInputStream an InputStream from a Java properties file
@throws IOException if there is a problem reading the InputStream
@throws CommandLineParsingException if an invalid p... | [
"Reads",
"various",
"execution",
"parameters",
"from",
"an",
"InputStream",
"and",
"sets",
"our",
"internal",
"state",
"according",
"to",
"the",
"values",
"found",
"."
] | 86a3b30fa6821ac981056f252f918557f5ebcc60 | https://github.com/liquibase/liquibase/blob/86a3b30fa6821ac981056f252f918557f5ebcc60/liquibase-core/src/main/java/liquibase/integration/commandline/Main.java#L645-L690 | valid | Parses the properties file. | Of course, here is the Java code you requested:
```java
protected void parsePropertiesFile(InputStream propertiesInputStream) throws IOException,
CommandLineParsingException {
Properties props = new Properties();
props.load(propertiesInputStream);
if (props.containsKey("strict")) {
... |
Unidata/thredds | udunits/src/main/java/ucar/units/UnitDBImpl.java | UnitDBImpl.get | public Unit get(final String id) {
Unit unit = getBySymbol(id);
if (unit == null) {
unit = getByName(id);
}
return unit;
} | java | public Unit get(final String id) {
Unit unit = getBySymbol(id);
if (unit == null) {
unit = getByName(id);
}
return unit;
} | [
"public",
"Unit",
"get",
"(",
"final",
"String",
"id",
")",
"{",
"Unit",
"unit",
"=",
"getBySymbol",
"(",
"id",
")",
";",
"if",
"(",
"unit",
"==",
"null",
")",
"{",
"unit",
"=",
"getByName",
"(",
"id",
")",
";",
"}",
"return",
"unit",
";",
"}"
] | Gets a unit by either name, plural, or symbol. Retrieving the unit by
symbol is attempted before retrieving the unit by name because symbol
comparisons are case sensitive and, hence, should be more robust.
@param id
The id to be matched.
@return The unit whose name, plural, or symbol matches or
<code>null</code> if no... | [
"Gets",
"a",
"unit",
"by",
"either",
"name",
"plural",
"or",
"symbol",
".",
"Retrieving",
"the",
"unit",
"by",
"symbol",
"is",
"attempted",
"before",
"retrieving",
"the",
"unit",
"by",
"name",
"because",
"symbol",
"comparisons",
"are",
"case",
"sensitive",
"... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/udunits/src/main/java/ucar/units/UnitDBImpl.java#L231-L237 | test | Get a Unit object by its ID. | Of course, here is the Java code you requested:
```java
public Unit get(final String id) {
Unit unit = getBySymbol(id);
if (unit == null) {
unit = getByName(id);
}
return unit;
}
```
Hope this helps! |
aws/aws-sdk-java | aws-java-sdk-sns/src/main/java/com/amazonaws/services/sns/model/SetEndpointAttributesRequest.java | SetEndpointAttributesRequest.withAttributes | public SetEndpointAttributesRequest withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
} | java | public SetEndpointAttributesRequest withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
} | [
"public",
"SetEndpointAttributesRequest",
"withAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"setAttributes",
"(",
"attributes",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A map of the endpoint attributes. Attributes in this map include the following:
</p>
<ul>
<li>
<p>
<code>CustomUserData</code> – arbitrary user data to associate with the endpoint. Amazon SNS does not use this
data. The data must be in UTF-8 format and less than 2KB.
</p>
</li>
<li>
<p>
<code>Enabled</code> – flag ... | [
"<p",
">",
"A",
"map",
"of",
"the",
"endpoint",
"attributes",
".",
"Attributes",
"in",
"this",
"map",
"include",
"the",
"following",
":",
"<",
"/",
"p",
">",
"<ul",
">",
"<li",
">",
"<p",
">",
"<code",
">",
"CustomUserData<",
"/",
"code",
">",
"–",
... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sns/src/main/java/com/amazonaws/services/sns/model/SetEndpointAttributesRequest.java#L273-L276 | train | Sets the attributes for the CDN. | Of course, here is the Java code you requested:
```java
public SetEndpointAttributesRequest withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
}
```
Hope this helps! |
js-lib-com/tiny-container | src/main/java/js/servlet/TinyContainer.java | TinyContainer.contextInitialized | @Override
public void contextInitialized(ServletContextEvent contextEvent) {
final ServletContext servletContext = contextEvent.getServletContext();
/** Logger diagnostic context stores contextual information regarding current request. */
LogContext logContext = LogFactory.getLogContext();
logContext.pu... | java | @Override
public void contextInitialized(ServletContextEvent contextEvent) {
final ServletContext servletContext = contextEvent.getServletContext();
/** Logger diagnostic context stores contextual information regarding current request. */
LogContext logContext = LogFactory.getLogContext();
logContext.pu... | [
"@",
"Override",
"public",
"void",
"contextInitialized",
"(",
"ServletContextEvent",
"contextEvent",
")",
"{",
"final",
"ServletContext",
"servletContext",
"=",
"contextEvent",
".",
"getServletContext",
"(",
")",
";",
"/** Logger diagnostic context stores contextual informati... | Implements tiny container boostrap logic. See class description for overall performed steps. Also loads context
parameters from external descriptors using {@link ServletContext#getInitParameter(String)}.
<p>
Context initialized listener is not allowed to throw exceptions and it seems there is no standard way to ask ser... | [
"Implements",
"tiny",
"container",
"boostrap",
"logic",
".",
"See",
"class",
"description",
"for",
"overall",
"performed",
"steps",
".",
"Also",
"loads",
"context",
"parameters",
"from",
"external",
"descriptors",
"using",
"{",
"@link",
"ServletContext#getInitParamete... | ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e | https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/servlet/TinyContainer.java#L239-L274 | test | Handle servlet context initialization. | Of course, here is the Java code you requested:
```java
@Override
public void contextInitialized(ServletContextEvent contextEvent) {
final ServletContext servletContext = contextEvent.getServletContext();
/** Logger diagnostic context stores contextual information regarding current request. */
LogContext ... |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/AnomalyDetectionRPCATransform.java | AnomalyDetectionRPCATransform.standardize | private void standardize(double[] values) {
double mean = calculateMean(values);
double stdDev = calculateStandardDeviation(values, mean);
/*
* If standard deviation is 0, all values of the metric are
* identical. Return vector of 0s.
*/
if (stdDev == 0.0) {
... | java | private void standardize(double[] values) {
double mean = calculateMean(values);
double stdDev = calculateStandardDeviation(values, mean);
/*
* If standard deviation is 0, all values of the metric are
* identical. Return vector of 0s.
*/
if (stdDev == 0.0) {
... | [
"private",
"void",
"standardize",
"(",
"double",
"[",
"]",
"values",
")",
"{",
"double",
"mean",
"=",
"calculateMean",
"(",
"values",
")",
";",
"double",
"stdDev",
"=",
"calculateStandardDeviation",
"(",
"values",
",",
"mean",
")",
";",
"/*\n * If stan... | /*
Standardizes the values to have zero mean and unit variance.
Formula: standardizedValue = (rawValue - mean) / standardDeviation | [
"/",
"*",
"Standardizes",
"the",
"values",
"to",
"have",
"zero",
"mean",
"and",
"unit",
"variance",
".",
"Formula",
":",
"standardizedValue",
"=",
"(",
"rawValue",
"-",
"mean",
")",
"/",
"standardDeviation"
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/AnomalyDetectionRPCATransform.java#L175-L194 | train | Standardize the values in the array. | Of course, here is the Java code you requested:
```java
private void standardize(double[] values) {
double mean = calculateMean(values);
double stdDev = calculateStandardDeviation(values, mean);
/*
* If standard deviation is 0, all values of the metric are
* identical. Return... |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/FileDirObjectStore.java | FileDirObjectStore.clear | protected synchronized void clear()
throws ObjectManagerException
{
if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
trace.entry(this, cclass
, "clear"
);
super.clear();
managedObjectsOnDisk = n... | java | protected synchronized void clear()
throws ObjectManagerException
{
if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
trace.entry(this, cclass
, "clear"
);
super.clear();
managedObjectsOnDisk = n... | [
"protected",
"synchronized",
"void",
"clear",
"(",
")",
"throws",
"ObjectManagerException",
"{",
"if",
"(",
"Tracing",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"trace",
".",
"isEntryEnabled",
"(",
")",
")",
"trace",
".",
"entry",
"(",
"this",
",",
"cclass... | /*
(non-Javadoc)
@see com.ibm.ws.objectManager.ObjectStore#clear() | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/FileDirObjectStore.java#L466-L496 | train | Clear the cache. | Of course, here is the Java code you requested:
```java
protected synchronized void clear()
throws ObjectManagerException
{
if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
trace.entry(this, cclass
, "clear"
);
... |
SonarSource/sonarqube | sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/charhandler/IntArrayList.java | IntArrayList.trimAndGet | public int[] trimAndGet() {
if (size < elementData.length) {
elementData = Arrays.copyOf(elementData, size);
}
return elementData;
} | java | public int[] trimAndGet() {
if (size < elementData.length) {
elementData = Arrays.copyOf(elementData, size);
}
return elementData;
} | [
"public",
"int",
"[",
"]",
"trimAndGet",
"(",
")",
"{",
"if",
"(",
"size",
"<",
"elementData",
".",
"length",
")",
"{",
"elementData",
"=",
"Arrays",
".",
"copyOf",
"(",
"elementData",
",",
"size",
")",
";",
"}",
"return",
"elementData",
";",
"}"
] | Trims the capacity of this <tt>IntArrayList</tt> instance to be the
list's current size and return the internal array. An application can use this operation to minimize
the storage of an <tt>IntArrayList</tt> instance. | [
"Trims",
"the",
"capacity",
"of",
"this",
"<tt",
">",
"IntArrayList<",
"/",
"tt",
">",
"instance",
"to",
"be",
"the",
"list",
"s",
"current",
"size",
"and",
"return",
"the",
"internal",
"array",
".",
"An",
"application",
"can",
"use",
"this",
"operation",
... | 2fffa4c2f79ae3714844d7742796e82822b6a98a | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/charhandler/IntArrayList.java#L67-L72 | train | Trims the array and returns it. | Of course, here is the Java code you requested:
```java
public int[] trimAndGet() {
if (size < elementData.length) {
elementData = Arrays.copyOf(elementData, size);
}
return elementData;
}
```
Hope this helps! |
tvesalainen/util | util/src/main/java/org/vesalainen/nio/channels/ChannelHelper.java | ChannelHelper.write | public static final long write(WritableByteChannel channel, ByteBuffer[] srcs, int offset, int length) throws IOException
{
long res = 0;
for (int ii=0;ii<length;ii++)
{
ByteBuffer bb = srcs[ii+offset];
if (bb.hasRemaining())
{
res... | java | public static final long write(WritableByteChannel channel, ByteBuffer[] srcs, int offset, int length) throws IOException
{
long res = 0;
for (int ii=0;ii<length;ii++)
{
ByteBuffer bb = srcs[ii+offset];
if (bb.hasRemaining())
{
res... | [
"public",
"static",
"final",
"long",
"write",
"(",
"WritableByteChannel",
"channel",
",",
"ByteBuffer",
"[",
"]",
"srcs",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"long",
"res",
"=",
"0",
";",
"for",
"(",
"int",
"ii"... | GatheringChannel support.
@param channel
@param srcs
@param offset
@param length
@return
@throws IOException | [
"GatheringChannel",
"support",
"."
] | bba7a44689f638ffabc8be40a75bdc9a33676433 | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/nio/channels/ChannelHelper.java#L236-L252 | train | Write a sequence of bytes to a WritableByteChannel. | Of course, here is the Java code you requested:
```java
public static final long write(WritableByteChannel channel, ByteBuffer[] srcs, int offset, int length) throws IOException
{
long res = 0;
for (int ii=0;ii<length;ii++)
{
ByteBuffer bb = srcs[ii+offset];
i... |
palatable/lambda | src/main/java/com/jnape/palatable/lambda/adt/choice/Choice2.java | Choice2.discardL | @Override
public <C> Choice2<A, C> discardL(Applicative<C, Choice2<A, ?>> appB) {
return Monad.super.discardL(appB).coerce();
} | java | @Override
public <C> Choice2<A, C> discardL(Applicative<C, Choice2<A, ?>> appB) {
return Monad.super.discardL(appB).coerce();
} | [
"@",
"Override",
"public",
"<",
"C",
">",
"Choice2",
"<",
"A",
",",
"C",
">",
"discardL",
"(",
"Applicative",
"<",
"C",
",",
"Choice2",
"<",
"A",
",",
"?",
">",
">",
"appB",
")",
"{",
"return",
"Monad",
".",
"super",
".",
"discardL",
"(",
"appB",... | {@inheritDoc} | [
"{"
] | b643ba836c5916d1d8193822e5efb4e7b40c489a | https://github.com/palatable/lambda/blob/b643ba836c5916d1d8193822e5efb4e7b40c489a/src/main/java/com/jnape/palatable/lambda/adt/choice/Choice2.java#L131-L134 | train | Overridden to allow the application to take a Choice2 of type Choice2. | Of course, here is the Java code you requested:
```java
@Override
public <C> Choice2<A, C> discardL(Applicative<C, Choice2<A, ?>> appB) {
return Monad.super.discardL(appB).coerce();
}
```
Hope this helps! |
looly/hutool | hutool-http/src/main/java/cn/hutool/http/HtmlUtil.java | HtmlUtil.removeHtmlTag | public static String removeHtmlTag(String content, String... tagNames) {
return removeHtmlTag(content, true, tagNames);
} | java | public static String removeHtmlTag(String content, String... tagNames) {
return removeHtmlTag(content, true, tagNames);
} | [
"public",
"static",
"String",
"removeHtmlTag",
"(",
"String",
"content",
",",
"String",
"...",
"tagNames",
")",
"{",
"return",
"removeHtmlTag",
"(",
"content",
",",
"true",
",",
"tagNames",
")",
";",
"}"
] | 清除指定HTML标签和被标签包围的内容<br>
不区分大小写
@param content 文本
@param tagNames 要清除的标签
@return 去除标签后的文本 | [
"清除指定HTML标签和被标签包围的内容<br",
">",
"不区分大小写"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/HtmlUtil.java#L97-L99 | train | Remove HTML tags from a string. | Of course, here is the Java code you requested:
```java
public static String removeHtmlTag(String content, String... tagNames) {
return removeHtmlTag(content, true, tagNames);
}
```
Hope this helps! |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/graph/isomorphism/TypedIsomorphicGraphCounter.java | TypedIsomorphicGraphCounter.size | public int size() {
int sz = 0;
for (LinkedList<Map.Entry<G,Integer>> m : typesToGraphs.values())
sz += m.size();
return sz;
} | java | public int size() {
int sz = 0;
for (LinkedList<Map.Entry<G,Integer>> m : typesToGraphs.values())
sz += m.size();
return sz;
} | [
"public",
"int",
"size",
"(",
")",
"{",
"int",
"sz",
"=",
"0",
";",
"for",
"(",
"LinkedList",
"<",
"Map",
".",
"Entry",
"<",
"G",
",",
"Integer",
">",
">",
"m",
":",
"typesToGraphs",
".",
"values",
"(",
")",
")",
"sz",
"+=",
"m",
".",
"size",
... | {@inheritDoc} | [
"{"
] | a608102737dfd3d59038a9ead33fe60356bc6029 | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/graph/isomorphism/TypedIsomorphicGraphCounter.java#L327-L332 | train | Returns the number of elements in this set. | Of course, here is the Java code you requested:
```java
public int size() {
int sz = 0;
for (LinkedList<Map.Entry<G,Integer>> m : typesToGraphs.values())
sz += m.size();
return sz;
}
```
Hope this helps! |
liquibase/liquibase | liquibase-core/src/main/java/liquibase/change/AbstractSQLChange.java | AbstractSQLChange.generateStatements | @Override
public SqlStatement[] generateStatements(Database database) {
List<SqlStatement> returnStatements = new ArrayList<>();
String sql = StringUtil.trimToNull(getSql());
if (sql == null) {
return new SqlStatement[0];
}
String processedSQL = normalizeLineEn... | java | @Override
public SqlStatement[] generateStatements(Database database) {
List<SqlStatement> returnStatements = new ArrayList<>();
String sql = StringUtil.trimToNull(getSql());
if (sql == null) {
return new SqlStatement[0];
}
String processedSQL = normalizeLineEn... | [
"@",
"Override",
"public",
"SqlStatement",
"[",
"]",
"generateStatements",
"(",
"Database",
"database",
")",
"{",
"List",
"<",
"SqlStatement",
">",
"returnStatements",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"String",
"sql",
"=",
"StringUtil",
".",
"tr... | Generates one or more SqlStatements depending on how the SQL should be parsed.
If split statements is set to true then the SQL is split and each command is made into a separate SqlStatement.
<p></p>
If stripping comments is true then any comments are removed before the splitting is executed.
The set SQL is passed throu... | [
"Generates",
"one",
"or",
"more",
"SqlStatements",
"depending",
"on",
"how",
"the",
"SQL",
"should",
"be",
"parsed",
".",
"If",
"split",
"statements",
"is",
"set",
"to",
"true",
"then",
"the",
"SQL",
"is",
"split",
"and",
"each",
"command",
"is",
"made",
... | 86a3b30fa6821ac981056f252f918557f5ebcc60 | https://github.com/liquibase/liquibase/blob/86a3b30fa6821ac981056f252f918557f5ebcc60/liquibase-core/src/main/java/liquibase/change/AbstractSQLChange.java#L209-L238 | valid | Generate SQL statements. | Of course, here is the Java code you requested:
```java
@Override
public SqlStatement[] generateStatements(Database database) {
List<SqlStatement> returnStatements = new ArrayList<>();
String sql = StringUtil.trimToNull(getSql());
if (sql == null) {
return new SqlStatement[0];... |
tango-controls/JTango | dao/src/main/java/fr/esrf/TangoApi/DeviceProxyDAODefaultImpl.java | DeviceProxyDAODefaultImpl.write_attribute_asynch | public void write_attribute_asynch(final DeviceProxy deviceProxy, final DeviceAttribute attr,
final CallBack cb) throws DevFailed {
final DeviceAttribute[] attribs = new DeviceAttribute[1];
attribs[0] = attr;
write_attribute_asynch(deviceProxy, attribs, cb);
} | java | public void write_attribute_asynch(final DeviceProxy deviceProxy, final DeviceAttribute attr,
final CallBack cb) throws DevFailed {
final DeviceAttribute[] attribs = new DeviceAttribute[1];
attribs[0] = attr;
write_attribute_asynch(deviceProxy, attribs, cb);
} | [
"public",
"void",
"write_attribute_asynch",
"(",
"final",
"DeviceProxy",
"deviceProxy",
",",
"final",
"DeviceAttribute",
"attr",
",",
"final",
"CallBack",
"cb",
")",
"throws",
"DevFailed",
"{",
"final",
"DeviceAttribute",
"[",
"]",
"attribs",
"=",
"new",
"DeviceAt... | ========================================================================== | [
"=========================================================================="
] | 1ccc9dcb83e6de2359a9f1906d170571cacf1345 | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoApi/DeviceProxyDAODefaultImpl.java#L2898-L2903 | train | Write an attribute to a DeviceProxy in asynchronous mode | Of course, here is the Java code you requested:
```java
public void write_attribute_asynch(final DeviceProxy deviceProxy, final DeviceAttribute attr,
final CallBack cb) throws DevFailed {
final DeviceAttribute[] attribs = new DeviceAttribute[1];
attribs[0] = attr;
write_attribute_asynch(de... |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/br/br_configurebandwidth6x.java | br_configurebandwidth6x.configurebandwidth6x | public static br_configurebandwidth6x[] configurebandwidth6x(nitro_service client, br_configurebandwidth6x[] resources) throws Exception
{
if(resources == null)
throw new Exception("Null resource array");
if(resources.length == 1)
return ((br_configurebandwidth6x[]) resources[0].perform_operatio... | java | public static br_configurebandwidth6x[] configurebandwidth6x(nitro_service client, br_configurebandwidth6x[] resources) throws Exception
{
if(resources == null)
throw new Exception("Null resource array");
if(resources.length == 1)
return ((br_configurebandwidth6x[]) resources[0].perform_operatio... | [
"public",
"static",
"br_configurebandwidth6x",
"[",
"]",
"configurebandwidth6x",
"(",
"nitro_service",
"client",
",",
"br_configurebandwidth6x",
"[",
"]",
"resources",
")",
"throws",
"Exception",
"{",
"if",
"(",
"resources",
"==",
"null",
")",
"throw",
"new",
"Exc... | <pre>
Use this operation to configure Repeater bandwidth of devices of version 6.x or later in bulk.
</pre> | [
"<pre",
">",
"Use",
"this",
"operation",
"to",
"configure",
"Repeater",
"bandwidth",
"of",
"devices",
"of",
"version",
"6",
".",
"x",
"or",
"later",
"in",
"bulk",
".",
"<",
"/",
"pre",
">"
] | c840919f1a8f7c0a5634c0f23d34fa14d1765ff1 | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/br/br_configurebandwidth6x.java#L136-L146 | train | Use this API to perform a
operation on given resources. | Of course, here is the Java code you requested:
```java
public static br_configurebandwidth6x[] configurebandwidth6x(nitro_service client, br_configurebandwidth6x[] resources) throws Exception
{
if(resources == null)
throw new Exception("Null resource array");
if(resources.length == 1)
return (... |
dickschoeller/gedbrowser | geoservice-persistence/src/main/java/org/schoellerfamily/geoservice/model/GeoServiceBounds.java | GeoServiceBounds.createBounds | public static Feature createBounds(final String id) {
final Feature feature = new Feature();
feature.setId(id);
feature.setGeometry(new Polygon());
return feature;
} | java | public static Feature createBounds(final String id) {
final Feature feature = new Feature();
feature.setId(id);
feature.setGeometry(new Polygon());
return feature;
} | [
"public",
"static",
"Feature",
"createBounds",
"(",
"final",
"String",
"id",
")",
"{",
"final",
"Feature",
"feature",
"=",
"new",
"Feature",
"(",
")",
";",
"feature",
".",
"setId",
"(",
"id",
")",
";",
"feature",
".",
"setGeometry",
"(",
"new",
"Polygon"... | Build a bounding box feature.
In this case, it has a name but is empty.
@param id the ID string
@return the Feature for the new bounds | [
"Build",
"a",
"bounding",
"box",
"feature",
".",
"In",
"this",
"case",
"it",
"has",
"a",
"name",
"but",
"is",
"empty",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/geoservice-persistence/src/main/java/org/schoellerfamily/geoservice/model/GeoServiceBounds.java#L39-L44 | train | Create a bounds feature. | Of course, here is the Java code you requested:
```java
public static Feature createBounds(final String id) {
final Feature feature = new Feature();
feature.setId(id);
feature.setGeometry(new Polygon());
return feature;
}
```
Hope this helps! |
molgenis/molgenis | molgenis-api-data/src/main/java/org/molgenis/api/data/v1/RestController.java | RestController.retrieveEntityType | @GetMapping(value = "/{entityTypeId}/meta", produces = APPLICATION_JSON_VALUE)
public EntityTypeResponse retrieveEntityType(
@PathVariable("entityTypeId") String entityTypeId,
@RequestParam(value = "attributes", required = false) String[] attributes,
@RequestParam(value = "expand", required = false)... | java | @GetMapping(value = "/{entityTypeId}/meta", produces = APPLICATION_JSON_VALUE)
public EntityTypeResponse retrieveEntityType(
@PathVariable("entityTypeId") String entityTypeId,
@RequestParam(value = "attributes", required = false) String[] attributes,
@RequestParam(value = "expand", required = false)... | [
"@",
"GetMapping",
"(",
"value",
"=",
"\"/{entityTypeId}/meta\"",
",",
"produces",
"=",
"APPLICATION_JSON_VALUE",
")",
"public",
"EntityTypeResponse",
"retrieveEntityType",
"(",
"@",
"PathVariable",
"(",
"\"entityTypeId\"",
")",
"String",
"entityTypeId",
",",
"@",
"Re... | Gets the metadata for an entity
<p>Example url: /api/v1/person/meta
@return EntityType | [
"Gets",
"the",
"metadata",
"for",
"an",
"entity"
] | b4d0d6b27e6f6c8d7505a3863dc03b589601f987 | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-api-data/src/main/java/org/molgenis/api/data/v1/RestController.java#L176-L187 | train | Retrieve an entity type. | Of course, here is the Java code you requested:
```java
@GetMapping(value = "/{entityTypeId}/meta", produces = APPLICATION_JSON_VALUE)
public EntityTypeResponse retrieveEntityType(
@PathVariable("entityTypeId") String entityTypeId,
@RequestParam(value = "attributes", required = false) String[] attributes... |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/processor/map/CreateMapProcessor.java | CreateMapProcessor.createSvgGraphics | public static SVGGraphics2D createSvgGraphics(final Dimension size)
throws ParserConfigurationException {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document document = db.getDOMImplementation().createDocument(nul... | java | public static SVGGraphics2D createSvgGraphics(final Dimension size)
throws ParserConfigurationException {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document document = db.getDOMImplementation().createDocument(nul... | [
"public",
"static",
"SVGGraphics2D",
"createSvgGraphics",
"(",
"final",
"Dimension",
"size",
")",
"throws",
"ParserConfigurationException",
"{",
"DocumentBuilderFactory",
"dbf",
"=",
"DocumentBuilderFactory",
".",
"newInstance",
"(",
")",
";",
"DocumentBuilder",
"db",
"... | Create a SVG graphic with the give dimensions.
@param size The size of the SVG graphic. | [
"Create",
"a",
"SVG",
"graphic",
"with",
"the",
"give",
"dimensions",
"."
] | 25a452cb39f592bd8a53b20db1037703898e1e22 | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/processor/map/CreateMapProcessor.java#L189-L203 | train | Create a SVGGraphics2D object with the specified size. | Of course, here is the Java code you requested:
```java
public static SVGGraphics2D createSvgGraphics(final Dimension size)
throws ParserConfigurationException {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Documen... |
cdk/cdk | base/data/src/main/java/org/openscience/cdk/AtomContainer2.java | AtomContainer2.setStereoElements | @Override
public void setStereoElements(List<IStereoElement> elements) {
this.stereo.clear();
this.stereo.addAll(elements);
notifyChanged();
} | java | @Override
public void setStereoElements(List<IStereoElement> elements) {
this.stereo.clear();
this.stereo.addAll(elements);
notifyChanged();
} | [
"@",
"Override",
"public",
"void",
"setStereoElements",
"(",
"List",
"<",
"IStereoElement",
">",
"elements",
")",
"{",
"this",
".",
"stereo",
".",
"clear",
"(",
")",
";",
"this",
".",
"stereo",
".",
"addAll",
"(",
"elements",
")",
";",
"notifyChanged",
"... | {@inheritDoc} | [
"{"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/data/src/main/java/org/openscience/cdk/AtomContainer2.java#L261-L266 | train | Sets the list of stereo elements. | Of course, here is the Java code you requested:
```java
@Override
public void setStereoElements(List<IStereoElement> elements) {
this.stereo.clear();
this.stereo.addAll(elements);
notifyChanged();
}
```
Hope this helps! |
knightliao/disconf | disconf-web/src/main/java/com/baidu/disconf/web/web/auth/UserController.java | UserController.get | @NoAuth
@RequestMapping(value = "/session", method = RequestMethod.GET)
@ResponseBody
public JsonObjectBase get() {
VisitorVo visitorVo = userMgr.getCurVisitor();
if (visitorVo != null) {
return buildSuccess("visitor", visitorVo);
} else {
// 没有登录啊
... | java | @NoAuth
@RequestMapping(value = "/session", method = RequestMethod.GET)
@ResponseBody
public JsonObjectBase get() {
VisitorVo visitorVo = userMgr.getCurVisitor();
if (visitorVo != null) {
return buildSuccess("visitor", visitorVo);
} else {
// 没有登录啊
... | [
"@",
"NoAuth",
"@",
"RequestMapping",
"(",
"value",
"=",
"\"/session\"",
",",
"method",
"=",
"RequestMethod",
".",
"GET",
")",
"@",
"ResponseBody",
"public",
"JsonObjectBase",
"get",
"(",
")",
"{",
"VisitorVo",
"visitorVo",
"=",
"userMgr",
".",
"getCurVisitor"... | GET 获取
@param
@return | [
"GET",
"获取"
] | d413cbce9334fe38a5a24982ce4db3a6ed8e98ea | https://github.com/knightliao/disconf/blob/d413cbce9334fe38a5a24982ce4db3a6ed8e98ea/disconf-web/src/main/java/com/baidu/disconf/web/web/auth/UserController.java#L60-L75 | train | Get a single appid | Of course, here is the Java code you requested:
```java
@NoAuth
@RequestMapping(value = "/session", method = RequestMethod.GET)
@ResponseBody
public JsonObjectBase get() {
VisitorVo visitorVo = userMgr.getCurVisitor();
if (visitorVo != null) {
return buildSuccess("visitor", vi... |
spotify/helios | helios-services/src/main/java/com/spotify/helios/servicescommon/ServiceRegistrars.java | ServiceRegistrars.createFactory | private static ServiceRegistrarFactory createFactory() {
final ServiceRegistrarFactory factory;
final ServiceRegistrarFactory installed;
try {
installed = ServiceRegistrarLoader.load();
} catch (ServiceRegistrarLoadingException e) {
throw new RuntimeException("Unable to load service registra... | java | private static ServiceRegistrarFactory createFactory() {
final ServiceRegistrarFactory factory;
final ServiceRegistrarFactory installed;
try {
installed = ServiceRegistrarLoader.load();
} catch (ServiceRegistrarLoadingException e) {
throw new RuntimeException("Unable to load service registra... | [
"private",
"static",
"ServiceRegistrarFactory",
"createFactory",
"(",
")",
"{",
"final",
"ServiceRegistrarFactory",
"factory",
";",
"final",
"ServiceRegistrarFactory",
"installed",
";",
"try",
"{",
"installed",
"=",
"ServiceRegistrarLoader",
".",
"load",
"(",
")",
";"... | Get a registrar factory from the application class loader.
@return The ServiceRegistrarFactory object. | [
"Get",
"a",
"registrar",
"factory",
"from",
"the",
"application",
"class",
"loader",
"."
] | c9000bc1d6908651570be8b057d4981bba4df5b4 | https://github.com/spotify/helios/blob/c9000bc1d6908651570be8b057d4981bba4df5b4/helios-services/src/main/java/com/spotify/helios/servicescommon/ServiceRegistrars.java#L107-L124 | train | Create a registrar factory. | Of course, here is the Java code you requested:
```java
private static ServiceRegistrarFactory createFactory() {
final ServiceRegistrarFactory factory;
final ServiceRegistrarFactory installed;
try {
installed = ServiceRegistrarLoader.load();
} catch (ServiceRegistrarLoadingException e) {
th... |
RestComm/jain-slee | container/resource/src/main/java/org/mobicents/slee/resource/SleeEndpointImpl.java | SleeEndpointImpl.checkStartActivityParameters | private void checkStartActivityParameters(ActivityHandle handle,
Object activity) throws NullPointerException, IllegalStateException {
// check args
if (handle == null) {
throw new NullPointerException("null handle");
}
if (activity == null) {
throw new NullPointerException("null activity");
}
// ... | java | private void checkStartActivityParameters(ActivityHandle handle,
Object activity) throws NullPointerException, IllegalStateException {
// check args
if (handle == null) {
throw new NullPointerException("null handle");
}
if (activity == null) {
throw new NullPointerException("null activity");
}
// ... | [
"private",
"void",
"checkStartActivityParameters",
"(",
"ActivityHandle",
"handle",
",",
"Object",
"activity",
")",
"throws",
"NullPointerException",
",",
"IllegalStateException",
"{",
"// check args",
"if",
"(",
"handle",
"==",
"null",
")",
"{",
"throw",
"new",
"Nu... | Checks the parameters of startActivity* methods
@param handle
@param activity
@throws NullPointerException
@throws IllegalStateException | [
"Checks",
"the",
"parameters",
"of",
"startActivity",
"*",
"methods"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/resource/src/main/java/org/mobicents/slee/resource/SleeEndpointImpl.java#L265-L280 | test | Check if the start activity parameters are valid. | Of course, here is the Java code you requested:
```java
private void checkStartActivityParameters(ActivityHandle handle,
Object activity) throws NullPointerException, IllegalStateException {
// check args
if (handle == null) {
throw new NullPointerException("null handle");
}
if (activity == null) {
t... |
flow/math | target/generated-sources/template/com/flowpowered/math/imaginary/Quaternionf.java | Quaternionf.invert | @Override
public Quaternionf invert() {
final float lengthSquared = lengthSquared();
if (Math.abs(lengthSquared) < GenericMath.FLT_EPSILON) {
throw new ArithmeticException("Cannot invert a quaternion of length zero");
}
return conjugate().div(lengthSquared);
} | java | @Override
public Quaternionf invert() {
final float lengthSquared = lengthSquared();
if (Math.abs(lengthSquared) < GenericMath.FLT_EPSILON) {
throw new ArithmeticException("Cannot invert a quaternion of length zero");
}
return conjugate().div(lengthSquared);
} | [
"@",
"Override",
"public",
"Quaternionf",
"invert",
"(",
")",
"{",
"final",
"float",
"lengthSquared",
"=",
"lengthSquared",
"(",
")",
";",
"if",
"(",
"Math",
".",
"abs",
"(",
"lengthSquared",
")",
"<",
"GenericMath",
".",
"FLT_EPSILON",
")",
"{",
"throw",
... | Inverts the quaternion. <br> Inversion of a quaternion <code>a</code> returns quaternion <code>a<sup>-1</sup> = a' / |a|<sup>2</sup></code> where <code>a'</code> is {@link #conjugate()
conjugation} of <code>a</code>, and <code>|a|<sup>2</sup></code> is squared length of <code>a</code>. <br> For any quaternions <code>a,... | [
"Inverts",
"the",
"quaternion",
".",
"<br",
">",
"Inversion",
"of",
"a",
"quaternion",
"<code",
">",
"a<",
"/",
"code",
">",
"returns",
"quaternion",
"<code",
">",
"a<sup",
">",
"-",
"1<",
"/",
"sup",
">",
"=",
"a",
"/",
"|a|<sup",
">",
"2<",
"/",
... | 12c1a809720aced976ed22de34fb1457d8eda78f | https://github.com/flow/math/blob/12c1a809720aced976ed22de34fb1457d8eda78f/target/generated-sources/template/com/flowpowered/math/imaginary/Quaternionf.java#L459-L466 | valid | Invert the quaternion. | Of course, here is the Java code you requested:
```java
@Override
public Quaternionf invert() {
final float lengthSquared = lengthSquared();
if (Math.abs(lengthSquared) < GenericMath.FLT_EPSILON) {
throw new ArithmeticException("Cannot invert a quaternion of length zero");
}
... |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/GV/AbstractHBCIJob.java | AbstractHBCIJob.setParam | public void setParam(String paramName, Integer index, String value) {
String[][] destinations = constraints.get(paramName);
if (destinations == null) {
String msg = HBCIUtils.getLocMsg("EXCMSG_PARAM_NOTNEEDED", new String[]{paramName, getName()});
throw new InvalidUserDataExcept... | java | public void setParam(String paramName, Integer index, String value) {
String[][] destinations = constraints.get(paramName);
if (destinations == null) {
String msg = HBCIUtils.getLocMsg("EXCMSG_PARAM_NOTNEEDED", new String[]{paramName, getName()});
throw new InvalidUserDataExcept... | [
"public",
"void",
"setParam",
"(",
"String",
"paramName",
",",
"Integer",
"index",
",",
"String",
"value",
")",
"{",
"String",
"[",
"]",
"[",
"]",
"destinations",
"=",
"constraints",
".",
"get",
"(",
"paramName",
")",
";",
"if",
"(",
"destinations",
"=="... | <p>Setzen eines Job-Parameters. Für alle Highlevel-Jobs ist in der Package-Beschreibung zum
Package {@link org.kapott.hbci.GV} eine Auflistung aller Jobs und deren Parameter zu finden.
Für alle Lowlevel-Jobs kann eine Liste aller Parameter entweder mit dem Tool
{@link org.kapott.hbci.tools.ShowLowlevelGVs} ermittelt we... | [
"<p",
">",
"Setzen",
"eines",
"Job",
"-",
"Parameters",
".",
"Für",
"alle",
"Highlevel",
"-",
"Jobs",
"ist",
"in",
"der",
"Package",
"-",
"Beschreibung",
"zum",
"Package",
"{",
"@link",
"org",
".",
"kapott",
".",
"hbci",
".",
"GV",
"}",
"eine",
"Auflis... | 5e24f7e429d6b555e1d993196b4cf1adda6433cf | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/GV/AbstractHBCIJob.java#L522-L549 | train | Sets the value of a parameter. | Of course, here is the Java code you requested:
```java
public void setParam(String paramName, Integer index, String value) {
String[][] destinations = constraints.get(paramName);
if (destinations == null) {
String msg = HBCIUtils.getLocMsg("EXCMSG_PARAM_NOTNEEDED", new String[]{paramName,... |
contentful/contentful.java | src/main/java/com/contentful/java/cda/AbsQuery.java | AbsQuery.skip | @SuppressWarnings("unchecked")
public Query skip(int skip) {
if (skip < 0) {
throw new IllegalArgumentException(format("Limit of %d is negative.", skip));
}
params.put(PARAMETER_SKIP, Integer.toString(skip));
return (Query) this;
} | java | @SuppressWarnings("unchecked")
public Query skip(int skip) {
if (skip < 0) {
throw new IllegalArgumentException(format("Limit of %d is negative.", skip));
}
params.put(PARAMETER_SKIP, Integer.toString(skip));
return (Query) this;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Query",
"skip",
"(",
"int",
"skip",
")",
"{",
"if",
"(",
"skip",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"format",
"(",
"\"Limit of %d is negative.\"",
",",
"skip",
"... | Skips the first elements of a response.
<p>
If more limit(int) elements are present, you can use skip(int) to simulate pagination.
@param skip a non negative number to exclude the first elements.
@return the calling query for chaining.
@see #limit(int) | [
"Skips",
"the",
"first",
"elements",
"of",
"a",
"response",
".",
"<p",
">",
"If",
"more",
"limit",
"(",
"int",
")",
"elements",
"are",
"present",
"you",
"can",
"use",
"skip",
"(",
"int",
")",
"to",
"simulate",
"pagination",
"."
] | 6ecc2ace454c674b218b99489dc50697b1dbffcb | https://github.com/contentful/contentful.java/blob/6ecc2ace454c674b218b99489dc50697b1dbffcb/src/main/java/com/contentful/java/cda/AbsQuery.java#L392-L401 | train | Add a skip parameter to the result. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public Query skip(int skip) {
if (skip < 0) {
throw new IllegalArgumentException(format("Limit of %d is negative.", skip));
}
params.put(PARAMETER_SKIP, Integer.toString(skip));
return (Query) this;
}
```... |
icegem/icegem | icegem-cache-utils/src/main/java/com/googlecode/icegem/cacheutils/monitor/controller/model/NodesContainer.java | NodesContainer.find | public Set<Node> find(String host) {
Set<Node> resultSet = new HashSet<Node>();
if (host != null) {
for (Node node : socketToNodeMap.values()) {
if (host.equals(node.getHost())) {
resultSet.add(node);
}
}
}
return resultSet;
} | java | public Set<Node> find(String host) {
Set<Node> resultSet = new HashSet<Node>();
if (host != null) {
for (Node node : socketToNodeMap.values()) {
if (host.equals(node.getHost())) {
resultSet.add(node);
}
}
}
return resultSet;
} | [
"public",
"Set",
"<",
"Node",
">",
"find",
"(",
"String",
"host",
")",
"{",
"Set",
"<",
"Node",
">",
"resultSet",
"=",
"new",
"HashSet",
"<",
"Node",
">",
"(",
")",
";",
"if",
"(",
"host",
"!=",
"null",
")",
"{",
"for",
"(",
"Node",
"node",
":"... | Finds the set of nodes by host.
@param host
- the host.
@return - the found nodes. | [
"Finds",
"the",
"set",
"of",
"nodes",
"by",
"host",
"."
] | d5dbb82c4913f191738ad6aad9edd9c0a3bf0dfc | https://github.com/icegem/icegem/blob/d5dbb82c4913f191738ad6aad9edd9c0a3bf0dfc/icegem-cache-utils/src/main/java/com/googlecode/icegem/cacheutils/monitor/controller/model/NodesContainer.java#L74-L86 | valid | Find all nodes on the given host. | Of course, here is the Java code you requested:
```java
public Set<Node> find(String host) {
Set<Node> resultSet = new HashSet<Node>();
if (host != null) {
for (Node node : socketToNodeMap.values()) {
if (host.equals(node.getHost())) {
resultSet.add(node);
}
}
}
return resultSet;
}
```
H... |
twitter/hraven | hraven-core/src/main/java/com/twitter/hraven/datasource/HdfsStatsService.java | HdfsStatsService.getOlderRunId | public static long getOlderRunId(int i, long runId) {
/**
* try to pick a randomized hour around that old date instead of picking
* exactly the same hour
*/
int randomizedHourInSeconds = (int) (Math.random() * 23) * 3600;
/**
* consider the day before old date and add randomizedHour for... | java | public static long getOlderRunId(int i, long runId) {
/**
* try to pick a randomized hour around that old date instead of picking
* exactly the same hour
*/
int randomizedHourInSeconds = (int) (Math.random() * 23) * 3600;
/**
* consider the day before old date and add randomizedHour for... | [
"public",
"static",
"long",
"getOlderRunId",
"(",
"int",
"i",
",",
"long",
"runId",
")",
"{",
"/**\n * try to pick a randomized hour around that old date instead of picking\n * exactly the same hour\n */",
"int",
"randomizedHourInSeconds",
"=",
"(",
"int",
")",
"(",... | this function returns an older timestamp ideally we would be using the
daily aggregation table and be simply looking for last run of the
aggregation, but right now, in the hourly table, we try to look for certain
timestamps in the past instead of scanning the entire table for the last
run.
@param i (i should always be ... | [
"this",
"function",
"returns",
"an",
"older",
"timestamp",
"ideally",
"we",
"would",
"be",
"using",
"the",
"daily",
"aggregation",
"table",
"and",
"be",
"simply",
"looking",
"for",
"last",
"run",
"of",
"the",
"aggregation",
"but",
"right",
"now",
"in",
"the"... | e35996b6e2f016bcd18db0bad320be7c93d95208 | https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/HdfsStatsService.java#L283-L309 | train | Get the older runId for the given index | Of course, here is the Java code you requested:
```java
public static long getOlderRunId(int i, long runId) {
/**
* try to pick a randomized hour around that old date instead of picking
* exactly the same hour
*/
int randomizedHourInSeconds = (int) (Math.random() * 23) * 3600;
/**
* co... |
SpartaTech/sparta-spring-web-utils | src/main/java/org/sparta/springwebutils/util/ExternalEntryPointHelper.java | ExternalEntryPointHelper.isSimpleRequestParameter | public static boolean isSimpleRequestParameter(Class<?> parameterType) {
return ClassUtils.isPrimitiveOrWrapper(parameterType)
|| (parameterType.isArray() && ClassUtils.isPrimitiveOrWrapper(parameterType.getComponentType()))
|| (ClassUtils.isAssignable(parameterType, Collection.class))
|| ClassUtils.is... | java | public static boolean isSimpleRequestParameter(Class<?> parameterType) {
return ClassUtils.isPrimitiveOrWrapper(parameterType)
|| (parameterType.isArray() && ClassUtils.isPrimitiveOrWrapper(parameterType.getComponentType()))
|| (ClassUtils.isAssignable(parameterType, Collection.class))
|| ClassUtils.is... | [
"public",
"static",
"boolean",
"isSimpleRequestParameter",
"(",
"Class",
"<",
"?",
">",
"parameterType",
")",
"{",
"return",
"ClassUtils",
".",
"isPrimitiveOrWrapper",
"(",
"parameterType",
")",
"||",
"(",
"parameterType",
".",
"isArray",
"(",
")",
"&&",
"ClassU... | Finds out if the supplied type is a simple element (primitive/wrapper, an primitive/wrapper array or a Collection instance)
@param parameterType type to check
@return boolean | [
"Finds",
"out",
"if",
"the",
"supplied",
"type",
"is",
"a",
"simple",
"element",
"(",
"primitive",
"/",
"wrapper",
"an",
"primitive",
"/",
"wrapper",
"array",
"or",
"a",
"Collection",
"instance",
")"
] | f5382474d46a6048d58707fc64e7936277e8b2ce | https://github.com/SpartaTech/sparta-spring-web-utils/blob/f5382474d46a6048d58707fc64e7936277e8b2ce/src/main/java/org/sparta/springwebutils/util/ExternalEntryPointHelper.java#L110-L116 | train | Checks if the given parameter type is a simple request parameter. | Of course, here is the Java code you requested:
```java
public static boolean isSimpleRequestParameter(Class<?> parameterType) {
return ClassUtils.isPrimitiveOrWrapper(parameterType)
|| (parameterType.isArray() && ClassUtils.isPrimitiveOrWrapper(parameterType.getComponentType()))
|| (ClassUtils.isAssignab... |
cologneintelligence/FitGoodies | fitgoodies-core/src/main/java/de/cologneintelligence/fitgoodies/date/SetupFixture.java | SetupFixture.format | public void format(final String format) {
FitDateHelper helper = DependencyManager.getOrCreate(FitDateHelper.class);
helper.setFormat(format);
} | java | public void format(final String format) {
FitDateHelper helper = DependencyManager.getOrCreate(FitDateHelper.class);
helper.setFormat(format);
} | [
"public",
"void",
"format",
"(",
"final",
"String",
"format",
")",
"{",
"FitDateHelper",
"helper",
"=",
"DependencyManager",
".",
"getOrCreate",
"(",
"FitDateHelper",
".",
"class",
")",
";",
"helper",
".",
"setFormat",
"(",
"format",
")",
";",
"}"
] | Sets the format value to {@code format}.
@param format format string which is parsable by {@link SimpleDateFormat}
@see FitDateHelper#setFormat(String) SetupHelper.setFormat(String)
@see FitDateHelper#getFormat() SetupHelper.getFormat() | [
"Sets",
"the",
"format",
"value",
"to",
"{",
"@code",
"format",
"}",
"."
] | 834e42d1f41b4b9226060b1e83a80cc69ea88c7b | https://github.com/cologneintelligence/FitGoodies/blob/834e42d1f41b4b9226060b1e83a80cc69ea88c7b/fitgoodies-core/src/main/java/de/cologneintelligence/fitgoodies/date/SetupFixture.java#L79-L82 | test | Set the format of the date. | Of course, here is the Java code you requested:
```java
public void format(final String format) {
FitDateHelper helper = DependencyManager.getOrCreate(FitDateHelper.class);
helper.setFormat(format);
}
```
Hope this helps! |
nutzam/nutz | src/org/nutz/lang/Strings.java | Strings.split | public static String[] split(String str, boolean keepQuote, boolean keepBlank, char... seps) {
List<String> list = new LinkedList<String>();
char[] cs = str.toCharArray();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < cs.length; i++) {
char c = cs[i];
... | java | public static String[] split(String str, boolean keepQuote, boolean keepBlank, char... seps) {
List<String> list = new LinkedList<String>();
char[] cs = str.toCharArray();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < cs.length; i++) {
char c = cs[i];
... | [
"public",
"static",
"String",
"[",
"]",
"split",
"(",
"String",
"str",
",",
"boolean",
"keepQuote",
",",
"boolean",
"keepBlank",
",",
"char",
"...",
"seps",
")",
"{",
"List",
"<",
"String",
">",
"list",
"=",
"new",
"LinkedList",
"<",
"String",
">",
"("... | 将字符串按照某个或几个分隔符拆分。 其中,遇到字符串 "..." 或者 '...' 并不拆分
@param str
要被拆分的字符串
@param keepQuote
是否保持引号
@param seps
分隔符
@return 拆分后的数组 | [
"将字符串按照某个或几个分隔符拆分。",
"其中,遇到字符串",
"...",
"或者",
"...",
"并不拆分"
] | a38694d5cbda2692e7931ab093c168487a6a4bfe | https://github.com/nutzam/nutz/blob/a38694d5cbda2692e7931ab093c168487a6a4bfe/src/org/nutz/lang/Strings.java#L1424-L1497 | valid | Splits a string into a list of strings. | Of course, here is the Java code you requested:
```java
public static String[] split(String str, boolean keepQuote, boolean keepBlank, char... seps) {
List<String> list = new LinkedList<String>();
char[] cs = str.toCharArray();
StringBuilder sb = new StringBuilder();
for (int i = 0;... |
RestComm/jain-slee.sip | resources/sip11/ra/src/main/java/org/mobicents/slee/resource/sip11/wrappers/DialogWrapper.java | DialogWrapper.sendCancel | public ClientTransaction sendCancel() throws SipException {
try {
final ClientTransaction inviteCTX = this.getClientTransaction(lastCancelableTransactionId);
final ClientTransaction cancelTransaction = ra.getProviderWrapper().getNewClientTransaction(inviteCTX.createCancel());
if (tracer.isInfoEnabled()) {
... | java | public ClientTransaction sendCancel() throws SipException {
try {
final ClientTransaction inviteCTX = this.getClientTransaction(lastCancelableTransactionId);
final ClientTransaction cancelTransaction = ra.getProviderWrapper().getNewClientTransaction(inviteCTX.createCancel());
if (tracer.isInfoEnabled()) {
... | [
"public",
"ClientTransaction",
"sendCancel",
"(",
")",
"throws",
"SipException",
"{",
"try",
"{",
"final",
"ClientTransaction",
"inviteCTX",
"=",
"this",
".",
"getClientTransaction",
"(",
"lastCancelableTransactionId",
")",
";",
"final",
"ClientTransaction",
"cancelTran... | /*
(non-Javadoc)
@see net.java.slee.resource.sip.DialogActivity#sendCancel() | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 2c173af0a760cb0ea13fe0ffa58c0f82b14731f9 | https://github.com/RestComm/jain-slee.sip/blob/2c173af0a760cb0ea13fe0ffa58c0f82b14731f9/resources/sip11/ra/src/main/java/org/mobicents/slee/resource/sip11/wrappers/DialogWrapper.java#L440-L455 | train | Send a CANCEL request to the client. | Of course, here is the Java code you requested:
```java
public ClientTransaction sendCancel() throws SipException {
try {
final ClientTransaction inviteCTX = this.getClientTransaction(lastCancelableTransactionId);
final ClientTransaction cancelTransaction = ra.getProviderWrapper().getNewClientTransaction(invit... |
oblac/jodd | jodd-bean/src/main/java/jodd/typeconverter/Converter.java | Converter.toFloatValue | public float toFloatValue(final Object value, final float defaultValue) {
final Float result = toFloat(value);
if (result == null) {
return defaultValue;
}
return result.floatValue();
} | java | public float toFloatValue(final Object value, final float defaultValue) {
final Float result = toFloat(value);
if (result == null) {
return defaultValue;
}
return result.floatValue();
} | [
"public",
"float",
"toFloatValue",
"(",
"final",
"Object",
"value",
",",
"final",
"float",
"defaultValue",
")",
"{",
"final",
"Float",
"result",
"=",
"toFloat",
"(",
"value",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"return",
"defaultValue",
... | Converts value to <code>float</code>. Returns default value
when conversion result is <code>null</code>. | [
"Converts",
"value",
"to",
"<code",
">",
"float<",
"/",
"code",
">",
".",
"Returns",
"default",
"value",
"when",
"conversion",
"result",
"is",
"<code",
">",
"null<",
"/",
"code",
">",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-bean/src/main/java/jodd/typeconverter/Converter.java#L194-L200 | test | Converts value into a float. | Of course, here is the Java code you requested:
```java
public float toFloatValue(final Object value, final float defaultValue) {
final Float result = toFloat(value);
if (result == null) {
return defaultValue;
}
return result.floatValue();
}
```
Hope this helps! |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WAudioExample.java | WAudioExample.buildUI | private void buildUI() {
// build the configuration options UI.
WFieldLayout layout = new WFieldLayout(WFieldLayout.LAYOUT_STACKED);
layout.setMargin(new Margin(null, null, Size.LARGE, null));
add(layout);
layout.addField("Autoplay", cbAutoPlay);
layout.addField("Loop", cbLoop);
layout.addField("Disable",... | java | private void buildUI() {
// build the configuration options UI.
WFieldLayout layout = new WFieldLayout(WFieldLayout.LAYOUT_STACKED);
layout.setMargin(new Margin(null, null, Size.LARGE, null));
add(layout);
layout.addField("Autoplay", cbAutoPlay);
layout.addField("Loop", cbLoop);
layout.addField("Disable",... | [
"private",
"void",
"buildUI",
"(",
")",
"{",
"// build the configuration options UI.",
"WFieldLayout",
"layout",
"=",
"new",
"WFieldLayout",
"(",
"WFieldLayout",
".",
"LAYOUT_STACKED",
")",
";",
"layout",
".",
"setMargin",
"(",
"new",
"Margin",
"(",
"null",
",",
... | Build the UI for this example. | [
"Build",
"the",
"UI",
"for",
"this",
"example",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WAudioExample.java#L90-L115 | train | Build the UI. | Of course, here is the Java code you requested:
```java
private void buildUI() {
// build the configuration options UI.
WFieldLayout layout = new WFieldLayout(WFieldLayout.LAYOUT_STACKED);
layout.setMargin(new Margin(null, null, Size.LARGE, null));
add(layout);
layout.addField("Autoplay", cbAutoPlay);
layo... |
wro4j/wro4j | wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/factory/SimpleProcessorsFactory.java | SimpleProcessorsFactory.setResourcePreProcessors | public void setResourcePreProcessors(final Collection<ResourcePreProcessor> processors) {
preProcessors.clear();
if (processors != null) {
preProcessors.addAll(processors);
}
} | java | public void setResourcePreProcessors(final Collection<ResourcePreProcessor> processors) {
preProcessors.clear();
if (processors != null) {
preProcessors.addAll(processors);
}
} | [
"public",
"void",
"setResourcePreProcessors",
"(",
"final",
"Collection",
"<",
"ResourcePreProcessor",
">",
"processors",
")",
"{",
"preProcessors",
".",
"clear",
"(",
")",
";",
"if",
"(",
"processors",
"!=",
"null",
")",
"{",
"preProcessors",
".",
"addAll",
"... | {@inheritDoc} | [
"{"
] | d2a3de71ab8bf0af7061fb6327501e08198338df | https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/factory/SimpleProcessorsFactory.java#L59-L64 | test | Sets the list of resource pre processors. | Of course, here is the Java code you requested:
```java
public void setResourcePreProcessors(final Collection<ResourcePreProcessor> processors) {
preProcessors.clear();
if (processors != null) {
preProcessors.addAll(processors);
}
}
```
Hope this helps! |
jpelzer/pelzer-util | src/main/java/com/pelzer/util/StringMan.java | StringMan.concat | public static String concat(String[] array, String separator, int fromIndex, int toIndex) {
StringBuilder buf = new StringBuilder();
for (int i = fromIndex; i <= toIndex; i++) {
if (buf.length() > 0)
buf.append(separator);
buf.append(array[i]);
}
return buf.toString();
} | java | public static String concat(String[] array, String separator, int fromIndex, int toIndex) {
StringBuilder buf = new StringBuilder();
for (int i = fromIndex; i <= toIndex; i++) {
if (buf.length() > 0)
buf.append(separator);
buf.append(array[i]);
}
return buf.toString();
} | [
"public",
"static",
"String",
"concat",
"(",
"String",
"[",
"]",
"array",
",",
"String",
"separator",
",",
"int",
"fromIndex",
",",
"int",
"toIndex",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"i",
... | Concats elements in array between <tt>fromIndex</tt>, inclusive, to <tt>toIndex</tt>,
inclusive, inserting <tt>separator</tt> between them. | [
"Concats",
"elements",
"in",
"array",
"between",
"<tt",
">",
"fromIndex<",
"/",
"tt",
">",
"inclusive",
"to",
"<tt",
">",
"toIndex<",
"/",
"tt",
">",
"inclusive",
"inserting",
"<tt",
">",
"separator<",
"/",
"tt",
">",
"between",
"them",
"."
] | ec14f2573fd977d1442dba5d1507a264f5ea9aa6 | https://github.com/jpelzer/pelzer-util/blob/ec14f2573fd977d1442dba5d1507a264f5ea9aa6/src/main/java/com/pelzer/util/StringMan.java#L425-L433 | train | Concatenates the specified array of strings with the specified separator. | Of course, here is the Java code you requested:
```java
public static String concat(String[] array, String separator, int fromIndex, int toIndex) {
StringBuilder buf = new StringBuilder();
for (int i = fromIndex; i <= toIndex; i++) {
if (buf.length() > 0)
buf.append(separator);
buf.app... |
cache2k/cache2k | cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java | Cache2kBuilder.wrapCustomizationInstance | private static <T> CustomizationReferenceSupplier<T> wrapCustomizationInstance(T obj) {
if (obj == null) { return null; }
return new CustomizationReferenceSupplier<T>(obj);
} | java | private static <T> CustomizationReferenceSupplier<T> wrapCustomizationInstance(T obj) {
if (obj == null) { return null; }
return new CustomizationReferenceSupplier<T>(obj);
} | [
"private",
"static",
"<",
"T",
">",
"CustomizationReferenceSupplier",
"<",
"T",
">",
"wrapCustomizationInstance",
"(",
"T",
"obj",
")",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"new",
"CustomizationReferenceSupplier"... | Wraps to factory but passes on nulls. | [
"Wraps",
"to",
"factory",
"but",
"passes",
"on",
"nulls",
"."
] | 3c9ccff12608c598c387ec50957089784cc4b618 | https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java#L424-L427 | train | Wrap a customization instance in a Supplier. | Of course, here is the Java code you requested:
```java
private static <T> CustomizationReferenceSupplier<T> wrapCustomizationInstance(T obj) {
if (obj == null) { return null; }
return new CustomizationReferenceSupplier<T>(obj);
}
```
Hope this helps! |
jeppetto/jeppetto | jeppetto-dao-hibernate/src/main/java/org/iternine/jeppetto/dao/hibernate/AccessControlInterceptor.java | AccessControlInterceptor.onFlushDirty | @Override
public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState,
String[] propertyNames, Type[] types) {
if (entity.getClass().isAssignableFrom(AccessControlEntry.class)) {
return false;
}
Access... | java | @Override
public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState,
String[] propertyNames, Type[] types) {
if (entity.getClass().isAssignableFrom(AccessControlEntry.class)) {
return false;
}
Access... | [
"@",
"Override",
"public",
"boolean",
"onFlushDirty",
"(",
"Object",
"entity",
",",
"Serializable",
"id",
",",
"Object",
"[",
"]",
"currentState",
",",
"Object",
"[",
"]",
"previousState",
",",
"String",
"[",
"]",
"propertyNames",
",",
"Type",
"[",
"]",
"t... | ------------------------------------------------------------- | [
"-------------------------------------------------------------"
] | bd2796dcf53376052f590e727931990a2902a933 | https://github.com/jeppetto/jeppetto/blob/bd2796dcf53376052f590e727931990a2902a933/jeppetto-dao-hibernate/src/main/java/org/iternine/jeppetto/dao/hibernate/AccessControlInterceptor.java#L47-L60 | train | Override this method to perform the actual flush of the entity. | Of course, here is the Java code you requested:
```java
@Override
public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState,
String[] propertyNames, Type[] types) {
if (entity.getClass().isAssignableFrom(AccessControlEntry.clas... |
moparisthebest/beehive | beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/JdbcControlImpl.java | JdbcControlImpl.getConnectionFromDriverManager | private Connection getConnectionFromDriverManager(String dbDriverClassName, String dbUrlStr,
String userName, String password, String propertiesString)
throws SQLException
{
Connection con = null;
try {
Class.forName(dbDr... | java | private Connection getConnectionFromDriverManager(String dbDriverClassName, String dbUrlStr,
String userName, String password, String propertiesString)
throws SQLException
{
Connection con = null;
try {
Class.forName(dbDr... | [
"private",
"Connection",
"getConnectionFromDriverManager",
"(",
"String",
"dbDriverClassName",
",",
"String",
"dbUrlStr",
",",
"String",
"userName",
",",
"String",
"password",
",",
"String",
"propertiesString",
")",
"throws",
"SQLException",
"{",
"Connection",
"con",
... | Get a JDBC connection from the DriverManager.
@param dbDriverClassName Specified in the subclasse's ConnectionDriver annotation.
@param dbUrlStr Specified in the subclasse's ConnectionDriver annotation.
@param userName Specified in the subclasse's ConnectionDriver annotation.
@param password ... | [
"Get",
"a",
"JDBC",
"connection",
"from",
"the",
"DriverManager",
"."
] | 4246a0cc40ce3c05f1a02c2da2653ac622703d77 | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/JdbcControlImpl.java#L433-L456 | train | Get a Connection from the DriverManager. | Of course, here is the Java code you requested:
```java
private Connection getConnectionFromDriverManager(String dbDriverClassName, String dbUrlStr,
String userName, String password, String propertiesString)
throws SQLException
{
Connection... |
Azure/azure-sdk-for-java | authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleDefinitionsInner.java | RoleDefinitionsInner.createOrUpdateWithServiceResponseAsync | public Observable<ServiceResponse<RoleDefinitionInner>> createOrUpdateWithServiceResponseAsync(String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition) {
if (scope == null) {
throw new IllegalArgumentException("Parameter scope is required and cannot be null.");
}
if... | java | public Observable<ServiceResponse<RoleDefinitionInner>> createOrUpdateWithServiceResponseAsync(String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition) {
if (scope == null) {
throw new IllegalArgumentException("Parameter scope is required and cannot be null.");
}
if... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"RoleDefinitionInner",
">",
">",
"createOrUpdateWithServiceResponseAsync",
"(",
"String",
"scope",
",",
"String",
"roleDefinitionId",
",",
"RoleDefinitionInner",
"roleDefinition",
")",
"{",
"if",
"(",
"scope",
"==",
... | Creates or updates a role definition.
@param scope The scope of the role definition.
@param roleDefinitionId The ID of the role definition.
@param roleDefinition The values for the role definition.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the RoleDefinitionInn... | [
"Creates",
"or",
"updates",
"a",
"role",
"definition",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleDefinitionsInner.java#L309-L333 | train | Creates or updates a role definition. | Of course, here is the Java code you requested:
```java
public Observable<ServiceResponse<RoleDefinitionInner>> createOrUpdateWithServiceResponseAsync(String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition) {
if (scope == null) {
throw new IllegalArgumentException("Parameter scop... |
kocakosm/pitaya | src/org/kocakosm/pitaya/io/TextFiles.java | TextFiles.tail | public static List<String> tail(File f, Charset charset) throws IOException
{
return tail(f, 10, charset);
} | java | public static List<String> tail(File f, Charset charset) throws IOException
{
return tail(f, 10, charset);
} | [
"public",
"static",
"List",
"<",
"String",
">",
"tail",
"(",
"File",
"f",
",",
"Charset",
"charset",
")",
"throws",
"IOException",
"{",
"return",
"tail",
"(",
"f",
",",
"10",
",",
"charset",
")",
";",
"}"
] | Returns the last (up to 10) lines of the given {@code File} using the
specified charset. Named after the Unix command of the same name.
@param f the {@code File} to read.
@param charset the charset to use.
@return the last lines of the given {@code File}.
@throws NullPointerException if one of the arguments is {@cod... | [
"Returns",
"the",
"last",
"(",
"up",
"to",
"10",
")",
"lines",
"of",
"the",
"given",
"{",
"@code",
"File",
"}",
"using",
"the",
"specified",
"charset",
".",
"Named",
"after",
"the",
"Unix",
"command",
"of",
"the",
"same",
"name",
"."
] | f2b203b6cdb32723bd1249a1325a3bb5918bf99a | https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/io/TextFiles.java#L180-L183 | test | Returns the tail of the file. | Of course, here is the Java code you requested:
```java
public static List<String> tail(File f, Charset charset) throws IOException
{
return tail(f, 10, charset);
}
```
Hope this helps! |
GumTreeDiff/gumtree | core/src/main/java/com/github/gumtreediff/matchers/optimal/rted/RtedAlgorithm.java | RtedAlgorithm.spfH | private double spfH(InfoTree it1, InfoTree it2, int[] heavyPath) {
int fSize = it1.info[POST2_SIZE][it1.getCurrentNode()];
int gSize = it2.info[POST2_SIZE][it2.getCurrentNode()];
int gRevPre = it2.getSize() - 1 - it2.getCurrentNode();
int gPre = it2.info[POST2_PRE][it2.getCurrentNode()];
int gTreeSize = it... | java | private double spfH(InfoTree it1, InfoTree it2, int[] heavyPath) {
int fSize = it1.info[POST2_SIZE][it1.getCurrentNode()];
int gSize = it2.info[POST2_SIZE][it2.getCurrentNode()];
int gRevPre = it2.getSize() - 1 - it2.getCurrentNode();
int gPre = it2.info[POST2_PRE][it2.getCurrentNode()];
int gTreeSize = it... | [
"private",
"double",
"spfH",
"(",
"InfoTree",
"it1",
",",
"InfoTree",
"it2",
",",
"int",
"[",
"]",
"heavyPath",
")",
"{",
"int",
"fSize",
"=",
"it1",
".",
"info",
"[",
"POST2_SIZE",
"]",
"[",
"it1",
".",
"getCurrentNode",
"(",
")",
"]",
";",
"int",
... | Single-path function for heavy path based on Klein/Demaine algorithm.
@param it1
@param it2
@param heavyPath
@return distance between subtrees it1 and it2 | [
"Single",
"-",
"path",
"function",
"for",
"heavy",
"path",
"based",
"on",
"Klein",
"/",
"Demaine",
"algorithm",
"."
] | a772d4d652af44bff22c38a234ddffbfbd365a37 | https://github.com/GumTreeDiff/gumtree/blob/a772d4d652af44bff22c38a234ddffbfbd365a37/core/src/main/java/com/github/gumtreediff/matchers/optimal/rted/RtedAlgorithm.java#L573-L639 | train | Compute the SPFH of the two info trees. | Of course, here is the Java code you requested:
```java
private double spfH(InfoTree it1, InfoTree it2, int[] heavyPath) {
int fSize = it1.info[POST2_SIZE][it1.getCurrentNode()];
int gSize = it2.info[POST2_SIZE][it2.getCurrentNode()];
int gRevPre = it2.getSize() - 1 - it2.getCurrentNode();
int gPre = it2.inf... |
mangstadt/biweekly | src/main/java/biweekly/io/ICalTimeZone.java | ICalTimeZone.getObservance | private Observance getObservance(int year, int month, int day, int hour, int minute, int second) {
Boundary boundary = getObservanceBoundary(year, month, day, hour, minute, second);
return (boundary == null) ? null : boundary.getObservanceIn();
} | java | private Observance getObservance(int year, int month, int day, int hour, int minute, int second) {
Boundary boundary = getObservanceBoundary(year, month, day, hour, minute, second);
return (boundary == null) ? null : boundary.getObservanceIn();
} | [
"private",
"Observance",
"getObservance",
"(",
"int",
"year",
",",
"int",
"month",
",",
"int",
"day",
",",
"int",
"hour",
",",
"int",
"minute",
",",
"int",
"second",
")",
"{",
"Boundary",
"boundary",
"=",
"getObservanceBoundary",
"(",
"year",
",",
"month",... | Gets the observance that a date is effected by.
@param year the year
@param month the month (1-12)
@param day the day of the month
@param hour the hour
@param minute the minute
@param second the second
@return the observance or null if an observance cannot be found | [
"Gets",
"the",
"observance",
"that",
"a",
"date",
"is",
"effected",
"by",
"."
] | 2e21350f85c13dfff52fdef98fdbebe2976fcf61 | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/ICalTimeZone.java#L310-L313 | train | Gets the observation. | Of course, here is the Java code you requested:
```java
private Observance getObservance(int year, int month, int day, int hour, int minute, int second) {
Boundary boundary = getObservanceBoundary(year, month, day, hour, minute, second);
return (boundary == null) ? null : boundary.getObservanceIn();
}
```
Hope t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.