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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
haraldk/TwelveMonkeys | imageio/imageio-tiff/src/main/java/com/twelvemonkeys/imageio/plugins/tiff/TIFFImageWriter.java | TIFFImageWriter.copyParams | private ImageWriteParam copyParams(final ImageWriteParam param, final ImageWriter writer) {
if (param == null) {
return null;
}
// Always safe
ImageWriteParam writeParam = writer.getDefaultWriteParam();
writeParam.setSourceSubsampling(param.getSourceXSubsampling(), p... | java | private ImageWriteParam copyParams(final ImageWriteParam param, final ImageWriter writer) {
if (param == null) {
return null;
}
// Always safe
ImageWriteParam writeParam = writer.getDefaultWriteParam();
writeParam.setSourceSubsampling(param.getSourceXSubsampling(), p... | [
"private",
"ImageWriteParam",
"copyParams",
"(",
"final",
"ImageWriteParam",
"param",
",",
"final",
"ImageWriter",
"writer",
")",
"{",
"if",
"(",
"param",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"// Always safe",
"ImageWriteParam",
"writeParam",
"=",... | TODO: Candidate util method | [
"TODO",
":",
"Candidate",
"util",
"method"
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-tiff/src/main/java/com/twelvemonkeys/imageio/plugins/tiff/TIFFImageWriter.java#L393-L411 | train | Copy the parameters from the given writer to the default image write param. | Of course, here is the Java code you requested:
```java
private ImageWriteParam copyParams(final ImageWriteParam param, final ImageWriter writer) {
if (param == null) {
return null;
}
// Always safe
ImageWriteParam writeParam = writer.getDefaultWriteParam();
writePa... |
liferay/com-liferay-commerce | commerce-user-segment-service/src/main/java/com/liferay/commerce/user/segment/service/persistence/impl/CommerceUserSegmentCriterionPersistenceImpl.java | CommerceUserSegmentCriterionPersistenceImpl.findByCommerceUserSegmentEntryId | @Override
public List<CommerceUserSegmentCriterion> findByCommerceUserSegmentEntryId(
long commerceUserSegmentEntryId, int start, int end) {
return findByCommerceUserSegmentEntryId(commerceUserSegmentEntryId,
start, end, null);
} | java | @Override
public List<CommerceUserSegmentCriterion> findByCommerceUserSegmentEntryId(
long commerceUserSegmentEntryId, int start, int end) {
return findByCommerceUserSegmentEntryId(commerceUserSegmentEntryId,
start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceUserSegmentCriterion",
">",
"findByCommerceUserSegmentEntryId",
"(",
"long",
"commerceUserSegmentEntryId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByCommerceUserSegmentEntryId",
"(",
"commerceUserSe... | Returns a range of all the commerce user segment criterions where commerceUserSegmentEntryId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refer... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"user",
"segment",
"criterions",
"where",
"commerceUserSegmentEntryId",
"=",
"?",
";",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-user-segment-service/src/main/java/com/liferay/commerce/user/segment/service/persistence/impl/CommerceUserSegmentCriterionPersistenceImpl.java#L150-L155 | train | Returns a range of commerce user segment criterions from the commerce user segment entry. | Of course, here is the Java code you requested:
```java
@Override
public List<CommerceUserSegmentCriterion> findByCommerceUserSegmentEntryId(
long commerceUserSegmentEntryId, int start, int end) {
return findByCommerceUserSegmentEntryId(commerceUserSegmentEntryId,
start, end, null);
}
```
Hope this helps! |
facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/hdfs/DistributedRaidFileSystem.java | DistributedRaidFileSystem.undelete | @Override
public boolean undelete(Path f, String userName) throws IOException {
List<Codec> codecList = Codec.getCodecs();
Path[] parityPathList = new Path[codecList.size()];
for (int i=0; i<parityPathList.length; i++) {
parityPathList[i] = new Path(codecList.get(i).parityDirectory,
... | java | @Override
public boolean undelete(Path f, String userName) throws IOException {
List<Codec> codecList = Codec.getCodecs();
Path[] parityPathList = new Path[codecList.size()];
for (int i=0; i<parityPathList.length; i++) {
parityPathList[i] = new Path(codecList.get(i).parityDirectory,
... | [
"@",
"Override",
"public",
"boolean",
"undelete",
"(",
"Path",
"f",
",",
"String",
"userName",
")",
"throws",
"IOException",
"{",
"List",
"<",
"Codec",
">",
"codecList",
"=",
"Codec",
".",
"getCodecs",
"(",
")",
";",
"Path",
"[",
"]",
"parityPathList",
"... | undelete the parity file together with the src file. | [
"undelete",
"the",
"parity",
"file",
"together",
"with",
"the",
"src",
"file",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/hdfs/DistributedRaidFileSystem.java#L282-L302 | train | Delete the src file and parity files. | Of course, here is the Java code you requested:
```java
@Override
public boolean undelete(Path f, String userName) throws IOException {
List<Codec> codecList = Codec.getCodecs();
Path[] parityPathList = new Path[codecList.size()];
for (int i=0; i<parityPathList.length; i++) {
parityPathList[i] = n... |
dnsjava/dnsjava | org/xbill/DNS/Message.java | Message.getQuestion | public Record
getQuestion() {
List l = sections[Section.QUESTION];
if (l == null || l.size() == 0)
return null;
return (Record) l.get(0);
} | java | public Record
getQuestion() {
List l = sections[Section.QUESTION];
if (l == null || l.size() == 0)
return null;
return (Record) l.get(0);
} | [
"public",
"Record",
"getQuestion",
"(",
")",
"{",
"List",
"l",
"=",
"sections",
"[",
"Section",
".",
"QUESTION",
"]",
";",
"if",
"(",
"l",
"==",
"null",
"||",
"l",
".",
"size",
"(",
")",
"==",
"0",
")",
"return",
"null",
";",
"return",
"(",
"Reco... | Returns the first record in the QUESTION section.
@see Record
@see Section | [
"Returns",
"the",
"first",
"record",
"in",
"the",
"QUESTION",
"section",
"."
] | d97b6a0685d59143372bb392ab591dd8dd840b61 | https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Message.java#L264-L270 | train | Get the question record. | Of course, here is the Java code you requested:
```java
public Record
getQuestion() {
List l = sections[Section.QUESTION];
if (l == null || l.size() == 0)
return null;
return (Record) l.get(0);
}
```
Hope this helps! |
brettonw/Bag | src/main/java/com/brettonw/bag/BagArray.java | BagArray.getFloat | public Float getFloat (int index) {
Double value = getDouble (index);
return (value != null) ? value.floatValue () : null;
} | java | public Float getFloat (int index) {
Double value = getDouble (index);
return (value != null) ? value.floatValue () : null;
} | [
"public",
"Float",
"getFloat",
"(",
"int",
"index",
")",
"{",
"Double",
"value",
"=",
"getDouble",
"(",
"index",
")",
";",
"return",
"(",
"value",
"!=",
"null",
")",
"?",
"value",
".",
"floatValue",
"(",
")",
":",
"null",
";",
"}"
] | Retrieve an indexed element and return it as a Float.
@param index An integer value specifying the offset from the beginning of the array.
@return The element as a Float, or null if the element is not found. | [
"Retrieve",
"an",
"indexed",
"element",
"and",
"return",
"it",
"as",
"a",
"Float",
"."
] | 25c0ff74893b6c9a2c61bf0f97189ab82e0b2f56 | https://github.com/brettonw/Bag/blob/25c0ff74893b6c9a2c61bf0f97189ab82e0b2f56/src/main/java/com/brettonw/bag/BagArray.java#L346-L349 | train | Gets the value of the specified Nth field as a Float. | Of course, here is the Java code you requested:
```java
public Float getFloat (int index) {
Double value = getDouble (index);
return (value != null) ? value.floatValue () : null;
}
```
Hope this helps! |
citrusframework/citrus | modules/citrus-arquillian/src/main/java/com/consol/citrus/arquillian/shrinkwrap/CitrusArchiveBuilder.java | CitrusArchiveBuilder.build | public File[] build() {
MavenStrategyStage maven = Maven.configureResolver()
.workOffline(offline)
.resolve(artifactCoordinates);
return applyTransitivity(maven).asFile();
} | java | public File[] build() {
MavenStrategyStage maven = Maven.configureResolver()
.workOffline(offline)
.resolve(artifactCoordinates);
return applyTransitivity(maven).asFile();
} | [
"public",
"File",
"[",
"]",
"build",
"(",
")",
"{",
"MavenStrategyStage",
"maven",
"=",
"Maven",
".",
"configureResolver",
"(",
")",
".",
"workOffline",
"(",
"offline",
")",
".",
"resolve",
"(",
"artifactCoordinates",
")",
";",
"return",
"applyTransitivity",
... | Resolve artifacts for given coordinates.
@return | [
"Resolve",
"artifacts",
"for",
"given",
"coordinates",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-arquillian/src/main/java/com/consol/citrus/arquillian/shrinkwrap/CitrusArchiveBuilder.java#L83-L89 | train | Build the CIDCTYPE file. | Of course, here is the Java code you requested:
```java
public File[] build() {
MavenStrategyStage maven = Maven.configureResolver()
.workOffline(offline)
.resolve(artifactCoordinates);
return applyTransitivity(maven).asFile();
}
```
Hope this helps! |
jhalterman/failsafe | src/main/java/net/jodah/failsafe/FailsafeExecutor.java | FailsafeExecutor.onFailure | @Override
public FailsafeExecutor<R> onFailure(CheckedConsumer<? extends ExecutionCompletedEvent<R>> listener) {
return super.onFailure(listener);
} | java | @Override
public FailsafeExecutor<R> onFailure(CheckedConsumer<? extends ExecutionCompletedEvent<R>> listener) {
return super.onFailure(listener);
} | [
"@",
"Override",
"public",
"FailsafeExecutor",
"<",
"R",
">",
"onFailure",
"(",
"CheckedConsumer",
"<",
"?",
"extends",
"ExecutionCompletedEvent",
"<",
"R",
">",
">",
"listener",
")",
"{",
"return",
"super",
".",
"onFailure",
"(",
"listener",
")",
";",
"}"
] | Registers the {@code listener} to be called when an execution fails. If multiple policies, are configured, this
handler is called when execution is complete and <i>any</i> policy fails. | [
"Registers",
"the",
"{"
] | 65fcd3a82f7b232d2ff59bc525a59d693dd8e223 | https://github.com/jhalterman/failsafe/blob/65fcd3a82f7b232d2ff59bc525a59d693dd8e223/src/main/java/net/jodah/failsafe/FailsafeExecutor.java#L149-L152 | train | Override to provide a listener for failure. | Of course, here is the Java code you requested:
```java
@Override
public FailsafeExecutor<R> onFailure(CheckedConsumer<? extends ExecutionCompletedEvent<R>> listener) {
return super.onFailure(listener);
}
```
Hope this helps! |
chocoteam/choco-graph | src/main/java/org/chocosolver/graphsolver/cstrs/connectivity/PropSizeMaxCC.java | PropSizeMaxCC.getGLBCCPotentialNeighbors | private Map<Integer, Set<Integer>> getGLBCCPotentialNeighbors(int cc) {
Map<Integer, Set<Integer>> ccPotentialNeighbors = new HashMap<>();
// Retrieve all nodes of CC
Set<Integer> ccNodes = getGLBCCNodes(cc);
// Retrieve neighbors of the nodes of CC that are outside the CC
for (int i : ccNodes) {
Set<Integ... | java | private Map<Integer, Set<Integer>> getGLBCCPotentialNeighbors(int cc) {
Map<Integer, Set<Integer>> ccPotentialNeighbors = new HashMap<>();
// Retrieve all nodes of CC
Set<Integer> ccNodes = getGLBCCNodes(cc);
// Retrieve neighbors of the nodes of CC that are outside the CC
for (int i : ccNodes) {
Set<Integ... | [
"private",
"Map",
"<",
"Integer",
",",
"Set",
"<",
"Integer",
">",
">",
"getGLBCCPotentialNeighbors",
"(",
"int",
"cc",
")",
"{",
"Map",
"<",
"Integer",
",",
"Set",
"<",
"Integer",
">",
">",
"ccPotentialNeighbors",
"=",
"new",
"HashMap",
"<>",
"(",
")",
... | Retrieve the potential CC neighbors (i.e. not in the CC) of a GLB CC.
@param cc The GLB CC index.
@return A map with frontier nodes of the CC as keys (Integer), and their potential neighbors that are
outside the CC (Set<Integer>). Only the frontier nodes that have at least one potential neighbor outside the
CC are sto... | [
"Retrieve",
"the",
"potential",
"CC",
"neighbors",
"(",
"i",
".",
"e",
".",
"not",
"in",
"the",
"CC",
")",
"of",
"a",
"GLB",
"CC",
"."
] | 0a03b0aafc86601977728c7e3fcb5ed376f1fae9 | https://github.com/chocoteam/choco-graph/blob/0a03b0aafc86601977728c7e3fcb5ed376f1fae9/src/main/java/org/chocosolver/graphsolver/cstrs/connectivity/PropSizeMaxCC.java#L187-L204 | train | Returns a map of all the neighborhoods of the CC that are outside the CC. | Of course, here is the Java code you requested:
```java
private Map<Integer, Set<Integer>> getGLBCCPotentialNeighbors(int cc) {
Map<Integer, Set<Integer>> ccPotentialNeighbors = new HashMap<>();
// Retrieve all nodes of CC
Set<Integer> ccNodes = getGLBCCNodes(cc);
// Retrieve neighbors of the nodes of CC that ... |
dita-ot/dita-ot | src/main/java/org/ditang/relaxng/defaults/Util.java | Util.filepath2URI | private static String filepath2URI(String path) {
// return null if path is null.
if (path == null) {
return null;
}
path = escapeSpecialAsciiAndNonAscii(path);
return path;
} | java | private static String filepath2URI(String path) {
// return null if path is null.
if (path == null) {
return null;
}
path = escapeSpecialAsciiAndNonAscii(path);
return path;
} | [
"private",
"static",
"String",
"filepath2URI",
"(",
"String",
"path",
")",
"{",
"// return null if path is null.",
"if",
"(",
"path",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"path",
"=",
"escapeSpecialAsciiAndNonAscii",
"(",
"path",
")",
";",
"retu... | To escape a file path to a URI, by using %HH to represent
special ASCII characters: 0x00~0x1F, 0x7F, ' ', '<', '>', '#', '%'
and '"' and non-ASCII characters (whose value >= 128).
'\' character will also be escaped.
@param path The path to be escaped.
@return The escaped uri. | [
"To",
"escape",
"a",
"file",
"path",
"to",
"a",
"URI",
"by",
"using",
"%HH",
"to",
"represent",
"special",
"ASCII",
"characters",
":",
"0x00~0x1F",
"0x7F",
"<",
">",
"#",
"%",
"and",
"and",
"non",
"-",
"ASCII",
"characters",
"(",
"whose",
"value",
">",... | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/ditang/relaxng/defaults/Util.java#L76-L83 | train | Convert a filepath to a URI. | Of course, here is the Java code you requested:
```java
private static String filepath2URI(String path) {
// return null if path is null.
if (path == null) {
return null;
}
path = escapeSpecialAsciiAndNonAscii(path);
return path;
}
```
Hope this helps! |
liferay/com-liferay-commerce | commerce-currency-service/src/main/java/com/liferay/commerce/currency/service/persistence/impl/CommerceCurrencyPersistenceImpl.java | CommerceCurrencyPersistenceImpl.countByG_C | @Override
public int countByG_C(long groupId, String code) {
FinderPath finderPath = FINDER_PATH_COUNT_BY_G_C;
Object[] finderArgs = new Object[] { groupId, code };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
StringBundler query = new StringBundler(3);
... | java | @Override
public int countByG_C(long groupId, String code) {
FinderPath finderPath = FINDER_PATH_COUNT_BY_G_C;
Object[] finderArgs = new Object[] { groupId, code };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
StringBundler query = new StringBundler(3);
... | [
"@",
"Override",
"public",
"int",
"countByG_C",
"(",
"long",
"groupId",
",",
"String",
"code",
")",
"{",
"FinderPath",
"finderPath",
"=",
"FINDER_PATH_COUNT_BY_G_C",
";",
"Object",
"[",
"]",
"finderArgs",
"=",
"new",
"Object",
"[",
"]",
"{",
"groupId",
",",
... | Returns the number of commerce currencies where groupId = ? and code = ?.
@param groupId the group ID
@param code the code
@return the number of matching commerce currencies | [
"Returns",
"the",
"number",
"of",
"commerce",
"currencies",
"where",
"groupId",
"=",
"?",
";",
"and",
"code",
"=",
"?",
";",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-currency-service/src/main/java/com/liferay/commerce/currency/service/persistence/impl/CommerceCurrencyPersistenceImpl.java#L2172-L2233 | train | Returns the number of items matching the conditions of the commerce currency in the database. | Of course, here is the Java code you requested:
```java
@Override
public int countByG_C(long groupId, String code) {
FinderPath finderPath = FINDER_PATH_COUNT_BY_G_C;
Object[] finderArgs = new Object[] { groupId, code };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == n... |
whitesource/fs-agent | src/main/java/org/whitesource/agent/dependency/resolver/npm/YarnDependencyCollector.java | YarnDependencyCollector.isDescendant | private boolean isDescendant(DependencyInfo ancestor, DependencyInfo descendant){
for (DependencyInfo child : ancestor.getChildren()){
if (child.equals(descendant)){
return true;
}
if (isDescendant(child, descendant)){
return true;
... | java | private boolean isDescendant(DependencyInfo ancestor, DependencyInfo descendant){
for (DependencyInfo child : ancestor.getChildren()){
if (child.equals(descendant)){
return true;
}
if (isDescendant(child, descendant)){
return true;
... | [
"private",
"boolean",
"isDescendant",
"(",
"DependencyInfo",
"ancestor",
",",
"DependencyInfo",
"descendant",
")",
"{",
"for",
"(",
"DependencyInfo",
"child",
":",
"ancestor",
".",
"getChildren",
"(",
")",
")",
"{",
"if",
"(",
"child",
".",
"equals",
"(",
"d... | preventing circular dependencies by making sure the dependency is not a descendant of its own | [
"preventing",
"circular",
"dependencies",
"by",
"making",
"sure",
"the",
"dependency",
"is",
"not",
"a",
"descendant",
"of",
"its",
"own"
] | d6ee4842c4f08f4aeda7eb2307b24c49b6bed0e1 | https://github.com/whitesource/fs-agent/blob/d6ee4842c4f08f4aeda7eb2307b24c49b6bed0e1/src/main/java/org/whitesource/agent/dependency/resolver/npm/YarnDependencyCollector.java#L163-L173 | train | Is descendant of ancestor. | Of course, here is the Java code you requested:
```java
private boolean isDescendant(DependencyInfo ancestor, DependencyInfo descendant){
for (DependencyInfo child : ancestor.getChildren()){
if (child.equals(descendant)){
return true;
}
if (isDescendant(child... |
aspectran/aspectran | core/src/main/java/com/aspectran/core/context/env/AbstractEnvironment.java | AbstractEnvironment.doGetDefaultProfiles | private Set<String> doGetDefaultProfiles() {
synchronized (defaultProfiles) {
if (defaultProfiles.isEmpty()) {
String[] profiles = getProfilesFromSystemProperty(DEFAULT_PROFILES_PROPERTY_NAME);
if (profiles != null) {
setDefaultProfiles(profiles);
... | java | private Set<String> doGetDefaultProfiles() {
synchronized (defaultProfiles) {
if (defaultProfiles.isEmpty()) {
String[] profiles = getProfilesFromSystemProperty(DEFAULT_PROFILES_PROPERTY_NAME);
if (profiles != null) {
setDefaultProfiles(profiles);
... | [
"private",
"Set",
"<",
"String",
">",
"doGetDefaultProfiles",
"(",
")",
"{",
"synchronized",
"(",
"defaultProfiles",
")",
"{",
"if",
"(",
"defaultProfiles",
".",
"isEmpty",
"(",
")",
")",
"{",
"String",
"[",
"]",
"profiles",
"=",
"getProfilesFromSystemProperty... | Returns the set of default profiles explicitly set via
{@link #setDefaultProfiles(String...)}, then check for the presence of the
{@value #DEFAULT_PROFILES_PROPERTY_NAME} property and assign its value (if any)
to the set of default profiles. | [
"Returns",
"the",
"set",
"of",
"default",
"profiles",
"explicitly",
"set",
"via",
"{"
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/context/env/AbstractEnvironment.java#L121-L135 | train | Get the default profiles. | Of course, here is the Java code you requested:
```java
private Set<String> doGetDefaultProfiles() {
synchronized (defaultProfiles) {
if (defaultProfiles.isEmpty()) {
String[] profiles = getProfilesFromSystemProperty(DEFAULT_PROFILES_PROPERTY_NAME);
if (profiles != n... |
shrinkwrap/shrinkwrap | impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/AssetUtil.java | AssetUtil.getPathForClassloaderResource | public static ArchivePath getPathForClassloaderResource(String resourceName) {
String extractedPath = null;
if (resourceName.lastIndexOf('/') != -1) {
extractedPath = resourceName.substring(0, resourceName.lastIndexOf('/'));
}
return new BasicPath(extractedPath);
} | java | public static ArchivePath getPathForClassloaderResource(String resourceName) {
String extractedPath = null;
if (resourceName.lastIndexOf('/') != -1) {
extractedPath = resourceName.substring(0, resourceName.lastIndexOf('/'));
}
return new BasicPath(extractedPath);
} | [
"public",
"static",
"ArchivePath",
"getPathForClassloaderResource",
"(",
"String",
"resourceName",
")",
"{",
"String",
"extractedPath",
"=",
"null",
";",
"if",
"(",
"resourceName",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
"!=",
"-",
"1",
")",
"{",
"extractedPat... | Helper to extract a ClassloaderResources path information. <br/>
<br/>
ie: /user/test/file.properties = /user/test/
@param resourceName
The name of the resource
@return A Path representation of the give resource | [
"Helper",
"to",
"extract",
"a",
"ClassloaderResources",
"path",
"information",
".",
"<br",
"/",
">",
"<br",
"/",
">",
"ie",
":",
"/",
"user",
"/",
"test",
"/",
"file",
".",
"properties",
"=",
"/",
"user",
"/",
"test",
"/"
] | 3f8a1a6d344651428c709a63ebb52d35343c5387 | https://github.com/shrinkwrap/shrinkwrap/blob/3f8a1a6d344651428c709a63ebb52d35343c5387/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/AssetUtil.java#L73-L79 | train | Gets the path for a class loader resource. | Of course, here is the Java code you requested:
```java
public static ArchivePath getPathForClassloaderResource(String resourceName) {
String extractedPath = null;
if (resourceName.lastIndexOf('/') != -1) {
extractedPath = resourceName.substring(0, resourceName.lastIndexOf('/'));
}
... |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/asn1/x509/X509Name.java | X509Name.getInstance | public static X509Name getInstance(
ASN1TaggedObject obj,
boolean explicit)
{
return getInstance(ASN1Sequence.getInstance(obj, explicit));
} | java | public static X509Name getInstance(
ASN1TaggedObject obj,
boolean explicit)
{
return getInstance(ASN1Sequence.getInstance(obj, explicit));
} | [
"public",
"static",
"X509Name",
"getInstance",
"(",
"ASN1TaggedObject",
"obj",
",",
"boolean",
"explicit",
")",
"{",
"return",
"getInstance",
"(",
"ASN1Sequence",
".",
"getInstance",
"(",
"obj",
",",
"explicit",
")",
")",
";",
"}"
] | Return a X509Name based on the passed in tagged object.
@param obj tag object holding name.
@param explicit true if explicitly tagged false otherwise.
@return the X509Name | [
"Return",
"a",
"X509Name",
"based",
"on",
"the",
"passed",
"in",
"tagged",
"object",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/asn1/x509/X509Name.java#L228-L233 | train | Get an X509Name from an ASN. 1 Tagged Object. | Of course, here is the Java code you requested:
```java
public static X509Name getInstance(
ASN1TaggedObject obj,
boolean explicit)
{
return getInstance(ASN1Sequence.getInstance(obj, explicit));
}
```
Hope this helps! |
httl/httl | httl/src/main/java/httl/Engine.java | Engine.getTemplate | public Template getTemplate(String name, Object args) throws IOException, ParseException {
if (args instanceof String)
return getTemplate(name, (String) args);
if (args instanceof Locale)
return getTemplate(name, (Locale) args);
return getTemplate(name, null, null, args);... | java | public Template getTemplate(String name, Object args) throws IOException, ParseException {
if (args instanceof String)
return getTemplate(name, (String) args);
if (args instanceof Locale)
return getTemplate(name, (Locale) args);
return getTemplate(name, null, null, args);... | [
"public",
"Template",
"getTemplate",
"(",
"String",
"name",
",",
"Object",
"args",
")",
"throws",
"IOException",
",",
"ParseException",
"{",
"if",
"(",
"args",
"instanceof",
"String",
")",
"return",
"getTemplate",
"(",
"name",
",",
"(",
"String",
")",
"args"... | Get template.
@param name - template name
@return template instance
@throws IOException - If an I/O error occurs
@throws ParseException - If the template cannot be parsed
@see #getEngine() | [
"Get",
"template",
"."
] | e13e00f4ab41252a8f53d6dafd4a6610be9dcaad | https://github.com/httl/httl/blob/e13e00f4ab41252a8f53d6dafd4a6610be9dcaad/httl/src/main/java/httl/Engine.java#L369-L375 | train | Get a template from the specified name. | Of course, here is the Java code you requested:
```java
public Template getTemplate(String name, Object args) throws IOException, ParseException {
if (args instanceof String)
return getTemplate(name, (String) args);
if (args instanceof Locale)
return getTemplate(name, (Locale) a... |
windup/windup | reporting/api/src/main/java/org/jboss/windup/reporting/config/classification/Classification.java | Classification.resolvePayload | @Override
public FileModel resolvePayload(GraphRewrite event, EvaluationContext context, WindupVertexFrame payload)
{
checkVariableName(event, context);
if (payload instanceof FileReferenceModel)
{
return ((FileReferenceModel) payload).getFile();
}
if (payload... | java | @Override
public FileModel resolvePayload(GraphRewrite event, EvaluationContext context, WindupVertexFrame payload)
{
checkVariableName(event, context);
if (payload instanceof FileReferenceModel)
{
return ((FileReferenceModel) payload).getFile();
}
if (payload... | [
"@",
"Override",
"public",
"FileModel",
"resolvePayload",
"(",
"GraphRewrite",
"event",
",",
"EvaluationContext",
"context",
",",
"WindupVertexFrame",
"payload",
")",
"{",
"checkVariableName",
"(",
"event",
",",
"context",
")",
";",
"if",
"(",
"payload",
"instance... | Set the payload to the fileModel of the given instance even though the variable is not directly referencing it. This is mainly to simplify the
creation of the rule, when the FileModel itself is not being iterated but just a model referencing it. | [
"Set",
"the",
"payload",
"to",
"the",
"fileModel",
"of",
"the",
"given",
"instance",
"even",
"though",
"the",
"variable",
"is",
"not",
"directly",
"referencing",
"it",
".",
"This",
"is",
"mainly",
"to",
"simplify",
"the",
"creation",
"of",
"the",
"rule",
"... | 6668f09e7f012d24a0b4212ada8809417225b2ad | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/reporting/api/src/main/java/org/jboss/windup/reporting/config/classification/Classification.java#L102-L115 | train | Override this method to resolve a single CRASCTYPE. | Of course, here is the Java code you requested:
```java
@Override
public FileModel resolvePayload(GraphRewrite event, EvaluationContext context, WindupVertexFrame payload)
{
checkVariableName(event, context);
if (payload instanceof FileReferenceModel)
{
return ((FileReferenc... |
alibaba/ARouter | arouter-api/src/main/java/com/alibaba/android/arouter/core/InstrumentationHook.java | InstrumentationHook.newActivity | public Activity newActivity(ClassLoader cl, String className,
Intent intent)
throws InstantiationException, IllegalAccessException,
ClassNotFoundException {
// return (Activity)cl.loadClass(className).newInstance();
Class<?> targetActivity = cl.lo... | java | public Activity newActivity(ClassLoader cl, String className,
Intent intent)
throws InstantiationException, IllegalAccessException,
ClassNotFoundException {
// return (Activity)cl.loadClass(className).newInstance();
Class<?> targetActivity = cl.lo... | [
"public",
"Activity",
"newActivity",
"(",
"ClassLoader",
"cl",
",",
"String",
"className",
",",
"Intent",
"intent",
")",
"throws",
"InstantiationException",
",",
"IllegalAccessException",
",",
"ClassNotFoundException",
"{",
"// return (Activity)cl.loadClass(className).... | Hook the instrumentation's newActivity, inject
<p>
Perform instantiation of the process's {@link Activity} object. The
default implementation provides the normal system behavior.
@param cl The ClassLoader with which to instantiate the object.
@param className The name of the class implementing the Activity
obj... | [
"Hook",
"the",
"instrumentation",
"s",
"newActivity",
"inject",
"<p",
">",
"Perform",
"instantiation",
"of",
"the",
"process",
"s",
"{",
"@link",
"Activity",
"}",
"object",
".",
"The",
"default",
"implementation",
"provides",
"the",
"normal",
"system",
"behavior... | 1a06912a6e14a57112db1204b43f81c43d721732 | https://github.com/alibaba/ARouter/blob/1a06912a6e14a57112db1204b43f81c43d721732/arouter-api/src/main/java/com/alibaba/android/arouter/core/InstrumentationHook.java#L39-L68 | train | Create an activity instance from a class name. | Of course, here is the Java code you requested:
```java
public Activity newActivity(ClassLoader cl, String className,
Intent intent)
throws InstantiationException, IllegalAccessException,
ClassNotFoundException {
// return (Activity)cl.loadClass(className... |
Unidata/thredds | cdm/src/main/java/ucar/unidata/geoloc/ogc/WKTParser.java | WKTParser.convertWKTToProjection | public static ProjectionImpl convertWKTToProjection(WKTParser srp) {
if (!srp.isPlanarProjection()) {
return new ucar.unidata.geoloc.projection.LatLonProjection();
} else {
String projectionType = srp.getProjectionType();
double falseEasting = 0;
double falseNorthing = 0;
Pr... | java | public static ProjectionImpl convertWKTToProjection(WKTParser srp) {
if (!srp.isPlanarProjection()) {
return new ucar.unidata.geoloc.projection.LatLonProjection();
} else {
String projectionType = srp.getProjectionType();
double falseEasting = 0;
double falseNorthing = 0;
Pr... | [
"public",
"static",
"ProjectionImpl",
"convertWKTToProjection",
"(",
"WKTParser",
"srp",
")",
"{",
"if",
"(",
"!",
"srp",
".",
"isPlanarProjection",
"(",
")",
")",
"{",
"return",
"new",
"ucar",
".",
"unidata",
".",
"geoloc",
".",
"projection",
".",
"LatLonPr... | Convert OGC spatial reference WKT to a ProjectionImpl.
An IllegalArgumentException may be thrown if a parameter is missing.
@param srp The parsed OGC WKT spatial reference text.
@return The ProjectionImpl class.
@throws java.text.ParseException If the OGIS spatial reference text was not parseable. | [
"Convert",
"OGC",
"spatial",
"reference",
"WKT",
"to",
"a",
"ProjectionImpl",
".",
"An",
"IllegalArgumentException",
"may",
"be",
"thrown",
"if",
"a",
"parameter",
"is",
"missing",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/geoloc/ogc/WKTParser.java#L611-L691 | test | Convert a WKT file to a LatLon Projection object | Of course, here is the Java code you requested:
```java
public static ProjectionImpl convertWKTToProjection(WKTParser srp) {
if (!srp.isPlanarProjection()) {
return new ucar.unidata.geoloc.projection.LatLonProjection();
} else {
String projectionType = srp.getProjectionType();
double fal... |
Unidata/thredds | ui/src/main/java/ucar/nc2/ui/geoloc/Rubberband.java | Rubberband.anchor | public boolean anchor(Point p) {
firstStretch = true;
anchorPt.x = p.x;
anchorPt.y = p.y;
stretchedPt.x = lastPt.x = anchorPt.x;
stretchedPt.y = lastPt.y = anchorPt.y;
return true;
} | java | public boolean anchor(Point p) {
firstStretch = true;
anchorPt.x = p.x;
anchorPt.y = p.y;
stretchedPt.x = lastPt.x = anchorPt.x;
stretchedPt.y = lastPt.y = anchorPt.y;
return true;
} | [
"public",
"boolean",
"anchor",
"(",
"Point",
"p",
")",
"{",
"firstStretch",
"=",
"true",
";",
"anchorPt",
".",
"x",
"=",
"p",
".",
"x",
";",
"anchorPt",
".",
"y",
"=",
"p",
".",
"y",
";",
"stretchedPt",
".",
"x",
"=",
"lastPt",
".",
"x",
"=",
"... | Set the anchor point. | [
"Set",
"the",
"anchor",
"point",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/geoloc/Rubberband.java#L73-L82 | test | Anchor the polygon. | Of course, here is the Java code you requested:
```java
public boolean anchor(Point p) {
firstStretch = true;
anchorPt.x = p.x;
anchorPt.y = p.y;
stretchedPt.x = lastPt.x = anchorPt.x;
stretchedPt.y = lastPt.y = anchorPt.y;
return true;
}
```
Hope this helps! |
shevek/jcpp | src/main/java/org/anarres/cpp/NumericValue.java | NumericValue.toJavaLangNumber | @Nonnull
public Number toJavaLangNumber() {
int flags = getFlags();
if ((flags & F_DOUBLE) != 0)
return doubleValue();
else if ((flags & F_FLOAT) != 0)
return floatValue();
else if ((flags & (F_LONG | F_LONGLONG)) != 0)
return longValue();
... | java | @Nonnull
public Number toJavaLangNumber() {
int flags = getFlags();
if ((flags & F_DOUBLE) != 0)
return doubleValue();
else if ((flags & F_FLOAT) != 0)
return floatValue();
else if ((flags & (F_LONG | F_LONGLONG)) != 0)
return longValue();
... | [
"@",
"Nonnull",
"public",
"Number",
"toJavaLangNumber",
"(",
")",
"{",
"int",
"flags",
"=",
"getFlags",
"(",
")",
";",
"if",
"(",
"(",
"flags",
"&",
"F_DOUBLE",
")",
"!=",
"0",
")",
"return",
"doubleValue",
"(",
")",
";",
"else",
"if",
"(",
"(",
"f... | private static final int S_MAXLEN_INT = String.valueOf(Integer.MAX_VALUE).length(); | [
"private",
"static",
"final",
"int",
"S_MAXLEN_INT",
"=",
"String",
".",
"valueOf",
"(",
"Integer",
".",
"MAX_VALUE",
")",
".",
"length",
"()",
";"
] | 71462c702097cabf8304202c740f780285fc35a8 | https://github.com/shevek/jcpp/blob/71462c702097cabf8304202c740f780285fc35a8/src/main/java/org/anarres/cpp/NumericValue.java#L117-L141 | train | Returns the Java language number value of this field. | Of course, here is the Java code you requested:
```java
@Nonnull
public Number toJavaLangNumber() {
int flags = getFlags();
if ((flags & F_DOUBLE) != 0)
return doubleValue();
else if ((flags & F_FLOAT) != 0)
return floatValue();
else if ((flags & (F_LONG | F_... |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/validation/SARLValidator.java | SARLValidator.checkDefaultSkillAnnotation | @Check
@SuppressWarnings("checkstyle:nestedifdepth")
public void checkDefaultSkillAnnotation(SarlCapacity capacity) {
final String annotationId = DefaultSkill.class.getName();
final XAnnotation annotation = IterableExtensions.findFirst(capacity.getAnnotations(), it -> {
return Strings.equal(annotationId, it.ge... | java | @Check
@SuppressWarnings("checkstyle:nestedifdepth")
public void checkDefaultSkillAnnotation(SarlCapacity capacity) {
final String annotationId = DefaultSkill.class.getName();
final XAnnotation annotation = IterableExtensions.findFirst(capacity.getAnnotations(), it -> {
return Strings.equal(annotationId, it.ge... | [
"@",
"Check",
"@",
"SuppressWarnings",
"(",
"\"checkstyle:nestedifdepth\"",
")",
"public",
"void",
"checkDefaultSkillAnnotation",
"(",
"SarlCapacity",
"capacity",
")",
"{",
"final",
"String",
"annotationId",
"=",
"DefaultSkill",
".",
"class",
".",
"getName",
"(",
")... | Check the correct usage of the {@link DefaultSkill} annotation.
@param capacity the associated capacity to check. | [
"Check",
"the",
"correct",
"usage",
"of",
"the",
"{",
"@link",
"DefaultSkill",
"}",
"annotation",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/validation/SARLValidator.java#L2764-L2801 | train | Check if the default skill annotation is present. | Of course, here is the Java code you requested:
```java
@Check
@SuppressWarnings("checkstyle:nestedifdepth")
public void checkDefaultSkillAnnotation(SarlCapacity capacity) {
final String annotationId = DefaultSkill.class.getName();
final XAnnotation annotation = IterableExtensions.findFirst(capacity.getAnnotatio... |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgFile.java | DwgFile.applyExtrusions | public void applyExtrusions() {
for( int i = 0; i < dwgObjects.size(); i++ ) {
DwgObject dwgObject = (DwgObject) dwgObjects.get(i);
if (dwgObject instanceof DwgArc) {
double[] arcCenter = ((DwgArc) dwgObject).getCenter();
double[] arcExt = ((DwgArc) dwgObj... | java | public void applyExtrusions() {
for( int i = 0; i < dwgObjects.size(); i++ ) {
DwgObject dwgObject = (DwgObject) dwgObjects.get(i);
if (dwgObject instanceof DwgArc) {
double[] arcCenter = ((DwgArc) dwgObject).getCenter();
double[] arcExt = ((DwgArc) dwgObj... | [
"public",
"void",
"applyExtrusions",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"dwgObjects",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"DwgObject",
"dwgObject",
"=",
"(",
"DwgObject",
")",
"dwgObjects",
".",
"get",
"(",... | Modify the geometry of the objects applying the Extrusion vector where it
is necessary | [
"Modify",
"the",
"geometry",
"of",
"the",
"objects",
"applying",
"the",
"Extrusion",
"vector",
"where",
"it",
"is",
"necessary"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgFile.java#L120-L268 | train | Apply the extrusion to the objects in the DWG file | Of course, here is the Java code you requested:
```java
public void applyExtrusions() {
for( int i = 0; i < dwgObjects.size(); i++ ) {
DwgObject dwgObject = (DwgObject) dwgObjects.get(i);
if (dwgObject instanceof DwgArc) {
double[] arcCenter = ((DwgArc) dwgObject).getCen... |
CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/ProfileHandler.java | ProfileHandler.addMultiValuesForKey | @Deprecated
public void addMultiValuesForKey(final String key, final ArrayList<String> values) {
CleverTapAPI cleverTapAPI = weakReference.get();
if (cleverTapAPI == null) {
Logger.d("CleverTap Instance is null.");
} else {
cleverTapAPI.addMultiValuesForKey(key, value... | java | @Deprecated
public void addMultiValuesForKey(final String key, final ArrayList<String> values) {
CleverTapAPI cleverTapAPI = weakReference.get();
if (cleverTapAPI == null) {
Logger.d("CleverTap Instance is null.");
} else {
cleverTapAPI.addMultiValuesForKey(key, value... | [
"@",
"Deprecated",
"public",
"void",
"addMultiValuesForKey",
"(",
"final",
"String",
"key",
",",
"final",
"ArrayList",
"<",
"String",
">",
"values",
")",
"{",
"CleverTapAPI",
"cleverTapAPI",
"=",
"weakReference",
".",
"get",
"(",
")",
";",
"if",
"(",
"clever... | Add a collection of unique values to a multi-value user profile property
If the property does not exist it will be created
<p/>
Max 100 values, on reaching 100 cap, oldest value(s) will be removed.
Values must be Strings and are limited to 512 characters.
<p/>
If the key currently contains a scalar value, the key will ... | [
"Add",
"a",
"collection",
"of",
"unique",
"values",
"to",
"a",
"multi",
"-",
"value",
"user",
"profile",
"property",
"If",
"the",
"property",
"does",
"not",
"exist",
"it",
"will",
"be",
"created",
"<p",
"/",
">",
"Max",
"100",
"values",
"on",
"reaching",... | be134c06a4f07494c398335ad9ff4976633743e1 | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/ProfileHandler.java#L75-L83 | train | Add a list of values to a single key. | Of course, here is the Java code you requested:
```java
@Deprecated
public void addMultiValuesForKey(final String key, final ArrayList<String> values) {
CleverTapAPI cleverTapAPI = weakReference.get();
if (cleverTapAPI == null) {
Logger.d("CleverTap Instance is null.");
} else {... |
ops4j/org.ops4j.pax.wicket | service/src/main/java/org/ops4j/pax/wicket/internal/BundleDelegatingClassResolver.java | BundleDelegatingClassResolver.getResources | public Iterator<URL> getResources(String name) {
ArrayList<URL> collectedResources = new ArrayList<URL>();
try {
synchronized (bundles) {
Collection<Bundle> values = bundles.values();
for (Bundle bundle : values) {
final Enumeration<URL> en... | java | public Iterator<URL> getResources(String name) {
ArrayList<URL> collectedResources = new ArrayList<URL>();
try {
synchronized (bundles) {
Collection<Bundle> values = bundles.values();
for (Bundle bundle : values) {
final Enumeration<URL> en... | [
"public",
"Iterator",
"<",
"URL",
">",
"getResources",
"(",
"String",
"name",
")",
"{",
"ArrayList",
"<",
"URL",
">",
"collectedResources",
"=",
"new",
"ArrayList",
"<",
"URL",
">",
"(",
")",
";",
"try",
"{",
"synchronized",
"(",
"bundles",
")",
"{",
"... | {@inheritDoc} | [
"{"
] | ef7cb4bdf918e9e61ec69789b9c690567616faa9 | https://github.com/ops4j/org.ops4j.pax.wicket/blob/ef7cb4bdf918e9e61ec69789b9c690567616faa9/service/src/main/java/org/ops4j/pax/wicket/internal/BundleDelegatingClassResolver.java#L152-L172 | train | Get the resources from the bundle. | Of course, here is the Java code you requested:
```java
public Iterator<URL> getResources(String name) {
ArrayList<URL> collectedResources = new ArrayList<URL>();
try {
synchronized (bundles) {
Collection<Bundle> values = bundles.values();
for (Bundle bundle ... |
aws/aws-sdk-java | aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/model/ModifyDBInstanceRequest.java | ModifyDBInstanceRequest.setProcessorFeatures | public void setProcessorFeatures(java.util.Collection<ProcessorFeature> processorFeatures) {
if (processorFeatures == null) {
this.processorFeatures = null;
return;
}
this.processorFeatures = new com.amazonaws.internal.SdkInternalList<ProcessorFeature>(processorFeatures)... | java | public void setProcessorFeatures(java.util.Collection<ProcessorFeature> processorFeatures) {
if (processorFeatures == null) {
this.processorFeatures = null;
return;
}
this.processorFeatures = new com.amazonaws.internal.SdkInternalList<ProcessorFeature>(processorFeatures)... | [
"public",
"void",
"setProcessorFeatures",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"ProcessorFeature",
">",
"processorFeatures",
")",
"{",
"if",
"(",
"processorFeatures",
"==",
"null",
")",
"{",
"this",
".",
"processorFeatures",
"=",
"null",
";",
"ret... | <p>
The number of CPU cores and the number of threads per core for the DB instance class of the DB instance.
</p>
@param processorFeatures
The number of CPU cores and the number of threads per core for the DB instance class of the DB instance. | [
"<p",
">",
"The",
"number",
"of",
"CPU",
"cores",
"and",
"the",
"number",
"of",
"threads",
"per",
"core",
"for",
"the",
"DB",
"instance",
"class",
"of",
"the",
"DB",
"instance",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/model/ModifyDBInstanceRequest.java#L5615-L5622 | train | Sets the value of the processorFeatures property. | Of course, here is the Java code you requested:
```java
public void setProcessorFeatures(java.util.Collection<ProcessorFeature> processorFeatures) {
if (processorFeatures == null) {
this.processorFeatures = null;
return;
}
this.processorFeatures = new com.amazonaws.inte... |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/ObjectUtils.java | ObjectUtils.cloneIfPossible | @GwtIncompatible("incompatible method")
public static <T> T cloneIfPossible(final T obj) {
final T clone = clone(obj);
return clone == null ? obj : clone;
} | java | @GwtIncompatible("incompatible method")
public static <T> T cloneIfPossible(final T obj) {
final T clone = clone(obj);
return clone == null ? obj : clone;
} | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"cloneIfPossible",
"(",
"final",
"T",
"obj",
")",
"{",
"final",
"T",
"clone",
"=",
"clone",
"(",
"obj",
")",
";",
"return",
"clone",
"==",
"null",
"?",
... | <p>Clone an object if possible.</p>
<p>This method is similar to {@link #clone(Object)}, but will return the provided
instance as the return value instead of {@code null} if the instance
is not cloneable. This is more convenient if the caller uses different
implementations (e.g. of a service) and some of the implement... | [
"<p",
">",
"Clone",
"an",
"object",
"if",
"possible",
".",
"<",
"/",
"p",
">"
] | 9e2dfbbda3668cfa5d935fe76479d1426c294504 | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/ObjectUtils.java#L729-L733 | train | Clones the given object if possible. | Of course, here is the Java code you requested:
```java
@GwtIncompatible("incompatible method")
public static <T> T cloneIfPossible(final T obj) {
final T clone = clone(obj);
return clone == null ? obj : clone;
}
```
Hope this helps! |
alkacon/opencms-core | src/org/opencms/db/CmsTempFolderExportPointDriver.java | CmsTempFolderExportPointDriver.shouldUseTempFolderForDestination | private boolean shouldUseTempFolderForDestination(String destination) {
destination = removeLeadingSlash(destination);
for (String tempFolderDestination : m_tempFolderDestinations) {
tempFolderDestination = removeLeadingSlash(tempFolderDestination);
if (CmsStringUtil.isPrefixPat... | java | private boolean shouldUseTempFolderForDestination(String destination) {
destination = removeLeadingSlash(destination);
for (String tempFolderDestination : m_tempFolderDestinations) {
tempFolderDestination = removeLeadingSlash(tempFolderDestination);
if (CmsStringUtil.isPrefixPat... | [
"private",
"boolean",
"shouldUseTempFolderForDestination",
"(",
"String",
"destination",
")",
"{",
"destination",
"=",
"removeLeadingSlash",
"(",
"destination",
")",
";",
"for",
"(",
"String",
"tempFolderDestination",
":",
"m_tempFolderDestinations",
")",
"{",
"tempFold... | Returns true if the given RFS destination should be replaced with the corresponding destination in the temporary export point folder.<p>
@param destination an export point RFS destination
@return true if the corresponding export point destination in the temporary export point folder should be used | [
"Returns",
"true",
"if",
"the",
"given",
"RFS",
"destination",
"should",
"be",
"replaced",
"with",
"the",
"corresponding",
"destination",
"in",
"the",
"temporary",
"export",
"point",
"folder",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsTempFolderExportPointDriver.java#L190-L200 | train | Checks if the destination is a temp folder. | Of course, here is the Java code you requested:
```java
private boolean shouldUseTempFolderForDestination(String destination) {
destination = removeLeadingSlash(destination);
for (String tempFolderDestination : m_tempFolderDestinations) {
tempFolderDestination = removeLeadingSlash(tempFold... |
aws/aws-sdk-java | aws-java-sdk-mediaconnect/src/main/java/com/amazonaws/services/mediaconnect/model/transform/StartFlowRequestMarshaller.java | StartFlowRequestMarshaller.marshall | public void marshall(StartFlowRequest startFlowRequest, ProtocolMarshaller protocolMarshaller) {
if (startFlowRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(startFlowRequest.getFlowArn(), ... | java | public void marshall(StartFlowRequest startFlowRequest, ProtocolMarshaller protocolMarshaller) {
if (startFlowRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(startFlowRequest.getFlowArn(), ... | [
"public",
"void",
"marshall",
"(",
"StartFlowRequest",
"startFlowRequest",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"startFlowRequest",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Invalid argument passed to marshall(.... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-mediaconnect/src/main/java/com/amazonaws/services/mediaconnect/model/transform/StartFlowRequestMarshaller.java#L42-L53 | train | marshalls the given startFlowRequest to the marshall method. | Of course, here is the Java code you requested:
```java
public void marshall(StartFlowRequest startFlowRequest, ProtocolMarshaller protocolMarshaller) {
if (startFlowRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
pr... |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/ZonedDateTime.java | ZonedDateTime.ofLocal | public static ZonedDateTime ofLocal(LocalDateTime localDateTime, ZoneId zone, ZoneOffset preferredOffset) {
Objects.requireNonNull(localDateTime, "localDateTime");
Objects.requireNonNull(zone, "zone");
if (zone instanceof ZoneOffset) {
return new ZonedDateTime(localDateTime, (ZoneOff... | java | public static ZonedDateTime ofLocal(LocalDateTime localDateTime, ZoneId zone, ZoneOffset preferredOffset) {
Objects.requireNonNull(localDateTime, "localDateTime");
Objects.requireNonNull(zone, "zone");
if (zone instanceof ZoneOffset) {
return new ZonedDateTime(localDateTime, (ZoneOff... | [
"public",
"static",
"ZonedDateTime",
"ofLocal",
"(",
"LocalDateTime",
"localDateTime",
",",
"ZoneId",
"zone",
",",
"ZoneOffset",
"preferredOffset",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"localDateTime",
",",
"\"localDateTime\"",
")",
";",
"Objects",
".",
... | Obtains an instance of {@code ZonedDateTime} from a local date-time
using the preferred offset if possible.
<p>
The local date-time is resolved to a single instant on the time-line.
This is achieved by finding a valid offset from UTC/Greenwich for the local
date-time as defined by the {@link ZoneRules rules} of the zon... | [
"Obtains",
"an",
"instance",
"of",
"{",
"@code",
"ZonedDateTime",
"}",
"from",
"a",
"local",
"date",
"-",
"time",
"using",
"the",
"preferred",
"offset",
"if",
"possible",
".",
"<p",
">",
"The",
"local",
"date",
"-",
"time",
"is",
"resolved",
"to",
"a",
... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/ZonedDateTime.java#L360-L383 | train | Gets the ZonedDateTime from the given local date - time and zone. | Of course, here is the Java code you requested:
```java
public static ZonedDateTime ofLocal(LocalDateTime localDateTime, ZoneId zone, ZoneOffset preferredOffset) {
Objects.requireNonNull(localDateTime, "localDateTime");
Objects.requireNonNull(zone, "zone");
if (zone instanceof ZoneOffset) {
... |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/map/impl/query/QueryEngineImpl.java | QueryEngineImpl.runOnAllPartitions | private Result runOnAllPartitions(Query query) {
PartitionIdSet mutablePartitionIds = getAllPartitionIds();
Result result = doRunOnQueryThreads(query, mutablePartitionIds, ALL_NODES);
if (isResultFromAnyPartitionMissing(mutablePartitionIds)) {
doRunOnPartitionThreads(query, mutableP... | java | private Result runOnAllPartitions(Query query) {
PartitionIdSet mutablePartitionIds = getAllPartitionIds();
Result result = doRunOnQueryThreads(query, mutablePartitionIds, ALL_NODES);
if (isResultFromAnyPartitionMissing(mutablePartitionIds)) {
doRunOnPartitionThreads(query, mutableP... | [
"private",
"Result",
"runOnAllPartitions",
"(",
"Query",
"query",
")",
"{",
"PartitionIdSet",
"mutablePartitionIds",
"=",
"getAllPartitionIds",
"(",
")",
";",
"Result",
"result",
"=",
"doRunOnQueryThreads",
"(",
"query",
",",
"mutablePartitionIds",
",",
"ALL_NODES",
... | query thread first, fallback to partition thread | [
"query",
"thread",
"first",
"fallback",
"to",
"partition",
"thread"
] | 8c4bc10515dbbfb41a33e0302c0caedf3cda1baf | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/query/QueryEngineImpl.java#L127-L137 | train | Run on all partitions of the query. | Of course, here is the Java code you requested:
```java
private Result runOnAllPartitions(Query query) {
PartitionIdSet mutablePartitionIds = getAllPartitionIds();
Result result = doRunOnQueryThreads(query, mutablePartitionIds, ALL_NODES);
if (isResultFromAnyPartitionMissing(mutablePartitionId... |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/tracing/ThresholdLogReporter.java | ThresholdLogReporter.isOverThreshold | private boolean isOverThreshold(final ThresholdLogSpan span) {
String service = (String) span.tag(Tags.PEER_SERVICE.getKey());
if (SERVICE_KV.equals(service)) {
return span.durationMicros() >= kvThreshold;
} else if (SERVICE_N1QL.equals(service)) {
return span.durationMic... | java | private boolean isOverThreshold(final ThresholdLogSpan span) {
String service = (String) span.tag(Tags.PEER_SERVICE.getKey());
if (SERVICE_KV.equals(service)) {
return span.durationMicros() >= kvThreshold;
} else if (SERVICE_N1QL.equals(service)) {
return span.durationMic... | [
"private",
"boolean",
"isOverThreshold",
"(",
"final",
"ThresholdLogSpan",
"span",
")",
"{",
"String",
"service",
"=",
"(",
"String",
")",
"span",
".",
"tag",
"(",
"Tags",
".",
"PEER_SERVICE",
".",
"getKey",
"(",
")",
")",
";",
"if",
"(",
"SERVICE_KV",
"... | Checks if the given span is over the threshold and eligible for being
reported.
@param span the span to check.
@return true if it is, false otherwise. | [
"Checks",
"if",
"the",
"given",
"span",
"is",
"over",
"the",
"threshold",
"and",
"eligible",
"for",
"being",
"reported",
"."
] | 97f0427112c2168fee1d6499904f5fa0e24c6797 | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/tracing/ThresholdLogReporter.java#L162-L177 | train | Checks if the span is over threshold. | Of course, here is the Java code you requested:
```java
private boolean isOverThreshold(final ThresholdLogSpan span) {
String service = (String) span.tag(Tags.PEER_SERVICE.getKey());
if (SERVICE_KV.equals(service)) {
return span.durationMicros() >= kvThreshold;
} else if (SERVICE_N1... |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/activator/TimeoutKey.java | TimeoutKey.setTimeoutByInterval | public void setTimeoutByInterval(int type, long interval)
{
if (ivTimeoutType != CURRENT_TIME)
{
// If the keys has expired, and is not in use, then allow the
// time out time to be reset, and the bean re-loaded. d210290
if (ivExpired == true &&
... | java | public void setTimeoutByInterval(int type, long interval)
{
if (ivTimeoutType != CURRENT_TIME)
{
// If the keys has expired, and is not in use, then allow the
// time out time to be reset, and the bean re-loaded. d210290
if (ivExpired == true &&
... | [
"public",
"void",
"setTimeoutByInterval",
"(",
"int",
"type",
",",
"long",
"interval",
")",
"{",
"if",
"(",
"ivTimeoutType",
"!=",
"CURRENT_TIME",
")",
"{",
"// If the keys has expired, and is not in use, then allow the",
"// time out time to be reset, and the bean re-loaded. ... | Changes the timeout for this key from the 'current time' to a
specific time out value by applying the specified interval to the
current time or re-calculates a specific time out value for a
key that has expired/timed out and will be reused (re-loaded). <p>
This method may be used to convert a key that contains the cur... | [
"Changes",
"the",
"timeout",
"for",
"this",
"key",
"from",
"the",
"current",
"time",
"to",
"a",
"specific",
"time",
"out",
"value",
"by",
"applying",
"the",
"specified",
"interval",
"to",
"the",
"current",
"time",
"or",
"re",
"-",
"calculates",
"a",
"speci... | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/activator/TimeoutKey.java#L197-L298 | train | Set the timeout value of a CDI bean by a specified interval. | Of course, here is the Java code you requested:
```java
public void setTimeoutByInterval(int type, long interval)
{
if (ivTimeoutType != CURRENT_TIME)
{
// If the keys has expired, and is not in use, then allow the
// time out time to be reset, and the bean re-loaded. ... |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/Compiler.java | Compiler.getWhatToShow | public int getWhatToShow(int opPos)
{
int axesType = getOp(opPos);
int testType = getOp(opPos + 3);
// System.out.println("testType: "+testType);
switch (testType)
{
case OpCodes.NODETYPE_COMMENT :
return DTMFilter.SHOW_COMMENT;
case OpCodes.NODETYPE_TEXT :
// return DTMFilter... | java | public int getWhatToShow(int opPos)
{
int axesType = getOp(opPos);
int testType = getOp(opPos + 3);
// System.out.println("testType: "+testType);
switch (testType)
{
case OpCodes.NODETYPE_COMMENT :
return DTMFilter.SHOW_COMMENT;
case OpCodes.NODETYPE_TEXT :
// return DTMFilter... | [
"public",
"int",
"getWhatToShow",
"(",
"int",
"opPos",
")",
"{",
"int",
"axesType",
"=",
"getOp",
"(",
"opPos",
")",
";",
"int",
"testType",
"=",
"getOp",
"(",
"opPos",
"+",
"3",
")",
";",
"// System.out.println(\"testType: \"+testType);",
"switch",
"(",
"te... | Get a {@link org.w3c.dom.traversal.NodeFilter} bit set that tells what
to show for a given node test.
@param opPos the op map position for the location step.
@return {@link org.w3c.dom.traversal.NodeFilter} bit set that tells what
to show for a given node test. | [
"Get",
"a",
"{",
"@link",
"org",
".",
"w3c",
".",
"dom",
".",
"traversal",
".",
"NodeFilter",
"}",
"bit",
"set",
"that",
"tells",
"what",
"to",
"show",
"for",
"a",
"given",
"node",
"test",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/Compiler.java#L742-L805 | train | Get what to show. | Of course, here is the Java code you requested:
```java
public int getWhatToShow(int opPos)
{
int axesType = getOp(opPos);
int testType = getOp(opPos + 3);
// System.out.println("testType: "+testType);
switch (testType)
{
case OpCodes.NODETYPE_COMMENT :
return DTMFilter.SHOW_COMMENT;
... |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java | PyGenerator._generate | protected void _generate(SarlSkill skill, IExtraLanguageGeneratorContext context) {
final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(skill);
final PyAppendable appendable = createAppendable(jvmType, context);
List<JvmTypeReference> superTypes = getSuperTypes(skill.getExtends(), skill.get... | java | protected void _generate(SarlSkill skill, IExtraLanguageGeneratorContext context) {
final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(skill);
final PyAppendable appendable = createAppendable(jvmType, context);
List<JvmTypeReference> superTypes = getSuperTypes(skill.getExtends(), skill.get... | [
"protected",
"void",
"_generate",
"(",
"SarlSkill",
"skill",
",",
"IExtraLanguageGeneratorContext",
"context",
")",
"{",
"final",
"JvmDeclaredType",
"jvmType",
"=",
"getJvmModelAssociations",
"(",
")",
".",
"getInferredType",
"(",
"skill",
")",
";",
"final",
"PyAppe... | Generate the given object.
@param skill the skill.
@param context the context. | [
"Generate",
"the",
"given",
"object",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java#L850-L870 | train | Generate the code for the SARL skill. | Of course, here is the Java code you requested:
```java
protected void _generate(SarlSkill skill, IExtraLanguageGeneratorContext context) {
final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(skill);
final PyAppendable appendable = createAppendable(jvmType, context);
List<JvmTypeReference>... |
aws/aws-sdk-java | aws-java-sdk-iam/src/main/java/com/amazonaws/services/identitymanagement/model/ListInstanceProfilesResult.java | ListInstanceProfilesResult.setInstanceProfiles | public void setInstanceProfiles(java.util.Collection<InstanceProfile> instanceProfiles) {
if (instanceProfiles == null) {
this.instanceProfiles = null;
return;
}
this.instanceProfiles = new com.amazonaws.internal.SdkInternalList<InstanceProfile>(instanceProfiles);
} | java | public void setInstanceProfiles(java.util.Collection<InstanceProfile> instanceProfiles) {
if (instanceProfiles == null) {
this.instanceProfiles = null;
return;
}
this.instanceProfiles = new com.amazonaws.internal.SdkInternalList<InstanceProfile>(instanceProfiles);
} | [
"public",
"void",
"setInstanceProfiles",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"InstanceProfile",
">",
"instanceProfiles",
")",
"{",
"if",
"(",
"instanceProfiles",
"==",
"null",
")",
"{",
"this",
".",
"instanceProfiles",
"=",
"null",
";",
"return",... | <p>
A list of instance profiles.
</p>
@param instanceProfiles
A list of instance profiles. | [
"<p",
">",
"A",
"list",
"of",
"instance",
"profiles",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iam/src/main/java/com/amazonaws/services/identitymanagement/model/ListInstanceProfilesResult.java#L77-L84 | train | Sets the value of the instanceProfiles property. | Of course, here is the Java code you requested:
```java
public void setInstanceProfiles(java.util.Collection<InstanceProfile> instanceProfiles) {
if (instanceProfiles == null) {
this.instanceProfiles = null;
return;
}
this.instanceProfiles = new com.amazonaws.internal.S... |
flow/caustic | api/src/main/java/com/flowpowered/caustic/api/data/VertexData.java | VertexData.getAttributeName | public String getAttributeName(int index) {
final VertexAttribute attribute = getAttribute(index);
if (attribute == null) {
return null;
}
return attribute.getName();
} | java | public String getAttributeName(int index) {
final VertexAttribute attribute = getAttribute(index);
if (attribute == null) {
return null;
}
return attribute.getName();
} | [
"public",
"String",
"getAttributeName",
"(",
"int",
"index",
")",
"{",
"final",
"VertexAttribute",
"attribute",
"=",
"getAttribute",
"(",
"index",
")",
";",
"if",
"(",
"attribute",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"attribute",
... | Returns the name of the attribute at the provided index, or null if none can be found.
@param index The index to lookup
@return The name of the attribute, or null if none can be found | [
"Returns",
"the",
"name",
"of",
"the",
"attribute",
"at",
"the",
"provided",
"index",
"or",
"null",
"if",
"none",
"can",
"be",
"found",
"."
] | 88652fcf0621ce158a0e92ce4c570ed6b1f6fca9 | https://github.com/flow/caustic/blob/88652fcf0621ce158a0e92ce4c570ed6b1f6fca9/api/src/main/java/com/flowpowered/caustic/api/data/VertexData.java#L220-L226 | train | Gets the name of the attribute at the given index. | Of course, here is the Java code you requested:
```java
public String getAttributeName(int index) {
final VertexAttribute attribute = getAttribute(index);
if (attribute == null) {
return null;
}
return attribute.getName();
}
```
Hope this helps! |
h2oai/h2o-2 | src/main/java/water/fvec/AppendableVec.java | AppendableVec.close | public Vec close(Futures fs) {
// Compute #chunks
int nchunk = _espc.length;
DKV.remove(chunkKey(nchunk),fs); // remove potential trailing key
while( nchunk > 0 && _espc[nchunk-1] == 0 ) {
nchunk--;
DKV.remove(chunkKey(nchunk),fs); // remove potential trailing key
}
boolean hasNumber... | java | public Vec close(Futures fs) {
// Compute #chunks
int nchunk = _espc.length;
DKV.remove(chunkKey(nchunk),fs); // remove potential trailing key
while( nchunk > 0 && _espc[nchunk-1] == 0 ) {
nchunk--;
DKV.remove(chunkKey(nchunk),fs); // remove potential trailing key
}
boolean hasNumber... | [
"public",
"Vec",
"close",
"(",
"Futures",
"fs",
")",
"{",
"// Compute #chunks",
"int",
"nchunk",
"=",
"_espc",
".",
"length",
";",
"DKV",
".",
"remove",
"(",
"chunkKey",
"(",
"nchunk",
")",
",",
"fs",
")",
";",
"// remove potential trailing key",
"while",
... | reads, plus computes rows-per-chunk, min/max/mean, etc. | [
"reads",
"plus",
"computes",
"rows",
"-",
"per",
"-",
"chunk",
"min",
"/",
"max",
"/",
"mean",
"etc",
"."
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/fvec/AppendableVec.java#L124-L183 | train | Close the Vec. | Of course, here is the Java code you requested:
```java
public Vec close(Futures fs) {
// Compute #chunks
int nchunk = _espc.length;
DKV.remove(chunkKey(nchunk),fs); // remove potential trailing key
while( nchunk > 0 && _espc[nchunk-1] == 0 ) {
nchunk--;
DKV.remove(chunkKey(nchunk),fs); // ... |
ow2-chameleon/fuchsia | bases/knx/calimero/src/main/java/tuwien/auto/calimero/process/ProcessCommunicatorImpl.java | ProcessCommunicatorImpl.readString | public String readString(GroupAddress dst) throws KNXTimeoutException,
KNXRemoteException, KNXLinkClosedException, KNXFormatException
{
final byte[] apdu = readFromGroup(dst, priority, 0, 14);
final DPTXlatorString t = new DPTXlatorString(DPTXlatorString.DPT_STRING_8859_1);
extractGroupASDU(apdu, t);
r... | java | public String readString(GroupAddress dst) throws KNXTimeoutException,
KNXRemoteException, KNXLinkClosedException, KNXFormatException
{
final byte[] apdu = readFromGroup(dst, priority, 0, 14);
final DPTXlatorString t = new DPTXlatorString(DPTXlatorString.DPT_STRING_8859_1);
extractGroupASDU(apdu, t);
r... | [
"public",
"String",
"readString",
"(",
"GroupAddress",
"dst",
")",
"throws",
"KNXTimeoutException",
",",
"KNXRemoteException",
",",
"KNXLinkClosedException",
",",
"KNXFormatException",
"{",
"final",
"byte",
"[",
"]",
"apdu",
"=",
"readFromGroup",
"(",
"dst",
",",
... | /* (non-Javadoc)
@see tuwien.auto.calimero.process.ProcessCommunicator#readString
(tuwien.auto.calimero.GroupAddress) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 4e9318eadbdeb945e529789f573b45386e619bed | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/process/ProcessCommunicatorImpl.java#L365-L372 | train | Reads a string from the specified destination address. | Of course, here is the Java code you requested:
```java
public String readString(GroupAddress dst) throws KNXTimeoutException,
KNXRemoteException, KNXLinkClosedException, KNXFormatException
{
final byte[] apdu = readFromGroup(dst, priority, 0, 14);
final DPTXlatorString t = new DPTXlatorString(DPTXlatorStri... |
apache/incubator-druid | sql/src/main/java/org/apache/druid/sql/calcite/planner/Calcites.java | Calcites.calciteTimestampToJoda | public static DateTime calciteTimestampToJoda(final long timestamp, final DateTimeZone timeZone)
{
return new DateTime(timestamp, DateTimeZone.UTC).withZoneRetainFields(timeZone);
} | java | public static DateTime calciteTimestampToJoda(final long timestamp, final DateTimeZone timeZone)
{
return new DateTime(timestamp, DateTimeZone.UTC).withZoneRetainFields(timeZone);
} | [
"public",
"static",
"DateTime",
"calciteTimestampToJoda",
"(",
"final",
"long",
"timestamp",
",",
"final",
"DateTimeZone",
"timeZone",
")",
"{",
"return",
"new",
"DateTime",
"(",
"timestamp",
",",
"DateTimeZone",
".",
"UTC",
")",
".",
"withZoneRetainFields",
"(",
... | The inverse of {@link #jodaToCalciteTimestamp(DateTime, DateTimeZone)}.
@param timestamp Calcite style timestamp
@param timeZone session time zone
@return joda timestamp, with time zone set to the session time zone | [
"The",
"inverse",
"of",
"{",
"@link",
"#jodaToCalciteTimestamp",
"(",
"DateTime",
"DateTimeZone",
")",
"}",
"."
] | f776b9408962b9006cfcfe4d6c1794751972cc8e | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/sql/src/main/java/org/apache/druid/sql/calcite/planner/Calcites.java#L325-L328 | train | Calculate the JodaDateTime from a timestamp. | Of course, here is the Java code you requested:
```java
public static DateTime calciteTimestampToJoda(final long timestamp, final DateTimeZone timeZone)
{
return new DateTime(timestamp, DateTimeZone.UTC).withZoneRetainFields(timeZone);
}
```
Hope this helps! |
validator/validator | src/nu/validator/xml/AttributesImpl.java | AttributesImpl.addAttribute | public void addAttribute(String localName, String value) {
if ("id".equals(localName)) {
super.addAttribute("", localName, localName, "ID", value);
} else {
super.addAttribute("", localName, localName, "CDATA", value);
}
} | java | public void addAttribute(String localName, String value) {
if ("id".equals(localName)) {
super.addAttribute("", localName, localName, "ID", value);
} else {
super.addAttribute("", localName, localName, "CDATA", value);
}
} | [
"public",
"void",
"addAttribute",
"(",
"String",
"localName",
",",
"String",
"value",
")",
"{",
"if",
"(",
"\"id\"",
".",
"equals",
"(",
"localName",
")",
")",
"{",
"super",
".",
"addAttribute",
"(",
"\"\"",
",",
"localName",
",",
"localName",
",",
"\"ID... | Adds an attribute that is not in a namespace. The infoset type
of the attribute will be ID if the <code>localName</code> is
"id" and CDATA otherwise.
@param localName the local name of the attribute
@param value the value of the attribute | [
"Adds",
"an",
"attribute",
"that",
"is",
"not",
"in",
"a",
"namespace",
".",
"The",
"infoset",
"type",
"of",
"the",
"attribute",
"will",
"be",
"ID",
"if",
"the",
"<code",
">",
"localName<",
"/",
"code",
">",
"is",
"id",
"and",
"CDATA",
"otherwise",
"."... | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/xml/AttributesImpl.java#L55-L61 | train | Add an attribute to the CBE. | Of course, here is the Java code you requested:
```java
public void addAttribute(String localName, String value) {
if ("id".equals(localName)) {
super.addAttribute("", localName, localName, "ID", value);
} else {
super.addAttribute("", localName, localName, "CDATA", value);
... |
kiegroup/droolsjbpm-tools | drools-eclipse/org.kie.eclipse/src/main/java/org/kie/eclipse/server/ServerProxy.java | ServerProxy.start | @Override
public void start(String launchMode, IOperationListener listener) {
// TODO Auto-generated method stub
server.start(launchMode, listener);
} | java | @Override
public void start(String launchMode, IOperationListener listener) {
// TODO Auto-generated method stub
server.start(launchMode, listener);
} | [
"@",
"Override",
"public",
"void",
"start",
"(",
"String",
"launchMode",
",",
"IOperationListener",
"listener",
")",
"{",
"// TODO Auto-generated method stub",
"server",
".",
"start",
"(",
"launchMode",
",",
"listener",
")",
";",
"}"
] | /* (non-Javadoc)
@see org.eclipse.wst.server.core.IServer#start(java.lang.String, org.eclipse.wst.server.core.IServer.IOperationListener) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 05e1f73c591178360a198dca29f99d73918991db | https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.kie.eclipse/src/main/java/org/kie/eclipse/server/ServerProxy.java#L388-L392 | test | Start the service. | Of course, here is the Java code you requested:
```java
@Override
public void start(String launchMode, IOperationListener listener) {
// TODO Auto-generated method stub
server.start(launchMode, listener);
}
```
Hope this helps! |
OpenLiberty/open-liberty | dev/com.ibm.ws.clientcontainer/src/com/ibm/ws/clientcontainer/internal/ClientRunnerImpl.java | ClientRunnerImpl.processPostConstruct | @FFDCIgnore(InjectionException.class)
private void processPostConstruct() {
ApplicationClient appClient = ((ClientModuleMetaData) cmd.getModuleMetaData()).getAppClient();
boolean isMetadataComplete = appClient.isMetadataComplete();
LifecycleCallbackHelper helper = new LifecycleCallbackHelper... | java | @FFDCIgnore(InjectionException.class)
private void processPostConstruct() {
ApplicationClient appClient = ((ClientModuleMetaData) cmd.getModuleMetaData()).getAppClient();
boolean isMetadataComplete = appClient.isMetadataComplete();
LifecycleCallbackHelper helper = new LifecycleCallbackHelper... | [
"@",
"FFDCIgnore",
"(",
"InjectionException",
".",
"class",
")",
"private",
"void",
"processPostConstruct",
"(",
")",
"{",
"ApplicationClient",
"appClient",
"=",
"(",
"(",
"ClientModuleMetaData",
")",
"cmd",
".",
"getModuleMetaData",
"(",
")",
")",
".",
"getAppC... | Process PostContruct annotation or metadata for Main class or Login Callback class. | [
"Process",
"PostContruct",
"annotation",
"or",
"metadata",
"for",
"Main",
"class",
"or",
"Login",
"Callback",
"class",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.clientcontainer/src/com/ibm/ws/clientcontainer/internal/ClientRunnerImpl.java#L117-L133 | train | Process post construct lifecycle callbacks. | Of course, here is the Java code you requested:
```java
@FFDCIgnore(InjectionException.class)
private void processPostConstruct() {
ApplicationClient appClient = ((ClientModuleMetaData) cmd.getModuleMetaData()).getAppClient();
boolean isMetadataComplete = appClient.isMetadataComplete();
Lif... |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java | SDMath.diag | public SDVariable diag(String name, SDVariable x) {
SDVariable ret = f().diag(x);
return updateVariableNameAndReference(ret, name);
} | java | public SDVariable diag(String name, SDVariable x) {
SDVariable ret = f().diag(x);
return updateVariableNameAndReference(ret, name);
} | [
"public",
"SDVariable",
"diag",
"(",
"String",
"name",
",",
"SDVariable",
"x",
")",
"{",
"SDVariable",
"ret",
"=",
"f",
"(",
")",
".",
"diag",
"(",
"x",
")",
";",
"return",
"updateVariableNameAndReference",
"(",
"ret",
",",
"name",
")",
";",
"}"
] | Returns an output variable with diagonal values equal to the specified values; off-diagonal values will be set to 0<br>
For example, if input = [1,2,3], then output is given by:<br>
[ 1, 0, 0]<br>
[ 0, 2, 0]<br>
[ 0, 0, 3]<br>
<br>
Higher input ranks are also supported: if input has shape [a,...,R-1] then output[i,...,... | [
"Returns",
"an",
"output",
"variable",
"with",
"diagonal",
"values",
"equal",
"to",
"the",
"specified",
"values",
";",
"off",
"-",
"diagonal",
"values",
"will",
"be",
"set",
"to",
"0<br",
">",
"For",
"example",
"if",
"input",
"=",
"[",
"1",
"2",
"3",
"... | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java#L799-L802 | train | Diagonal operation. | Of course, here is the Java code you requested:
```java
public SDVariable diag(String name, SDVariable x) {
SDVariable ret = f().diag(x);
return updateVariableNameAndReference(ret, name);
}
```
Hope this helps! |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/implementation/TextAnalyticsImpl.java | TextAnalyticsImpl.detectLanguageWithServiceResponseAsync | public Observable<ServiceResponse<LanguageBatchResult>> detectLanguageWithServiceResponseAsync(DetectLanguageOptionalParameter detectLanguageOptionalParameter) {
if (this.client.azureRegion() == null) {
throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be... | java | public Observable<ServiceResponse<LanguageBatchResult>> detectLanguageWithServiceResponseAsync(DetectLanguageOptionalParameter detectLanguageOptionalParameter) {
if (this.client.azureRegion() == null) {
throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"LanguageBatchResult",
">",
">",
"detectLanguageWithServiceResponseAsync",
"(",
"DetectLanguageOptionalParameter",
"detectLanguageOptionalParameter",
")",
"{",
"if",
"(",
"this",
".",
"client",
".",
"azureRegion",
"(",
... | The API returns the detected language and a numeric score between 0 and 1.
Scores close to 1 indicate 100% certainty that the identified language is true. A total of 120 languages are supported.
@param detectLanguageOptionalParameter the object representing the optional parameters to be set before calling this API
@th... | [
"The",
"API",
"returns",
"the",
"detected",
"language",
"and",
"a",
"numeric",
"score",
"between",
"0",
"and",
"1",
".",
"Scores",
"close",
"to",
"1",
"indicate",
"100%",
"certainty",
"that",
"the",
"identified",
"language",
"is",
"true",
".",
"A",
"total"... | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/implementation/TextAnalyticsImpl.java#L422-L429 | train | Detects language in the input text. | Of course, here is the Java code you requested:
```java
public Observable<ServiceResponse<LanguageBatchResult>> detectLanguageWithServiceResponseAsync(DetectLanguageOptionalParameter detectLanguageOptionalParameter) {
if (this.client.azureRegion() == null) {
throw new IllegalArgumentException("Para... |
UrielCh/ovh-java-sdk | ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java | ApiOvhDbaaslogs.serviceName_input_inputId_configuration_logstash_PUT | public OvhOperation serviceName_input_inputId_configuration_logstash_PUT(String serviceName, String inputId, String filterSection, String inputSection, String patternSection) throws IOException {
String qPath = "/dbaas/logs/{serviceName}/input/{inputId}/configuration/logstash";
StringBuilder sb = path(qPath, servic... | java | public OvhOperation serviceName_input_inputId_configuration_logstash_PUT(String serviceName, String inputId, String filterSection, String inputSection, String patternSection) throws IOException {
String qPath = "/dbaas/logs/{serviceName}/input/{inputId}/configuration/logstash";
StringBuilder sb = path(qPath, servic... | [
"public",
"OvhOperation",
"serviceName_input_inputId_configuration_logstash_PUT",
"(",
"String",
"serviceName",
",",
"String",
"inputId",
",",
"String",
"filterSection",
",",
"String",
"inputSection",
",",
"String",
"patternSection",
")",
"throws",
"IOException",
"{",
"St... | Update the logstash configuration
REST: PUT /dbaas/logs/{serviceName}/input/{inputId}/configuration/logstash
@param serviceName [required] Service name
@param inputId [required] Input ID
@param patternSection [required] Pattern section
@param inputSection [required] Input section
@param filterSection [required] Filter... | [
"Update",
"the",
"logstash",
"configuration"
] | 6d531a40e56e09701943e334c25f90f640c55701 | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java#L275-L284 | train | Update logstash configuration | Of course, here is the Java code you requested:
```java
public OvhOperation serviceName_input_inputId_configuration_logstash_PUT(String serviceName, String inputId, String filterSection, String inputSection, String patternSection) throws IOException {
String qPath = "/dbaas/logs/{serviceName}/input/{inputId}/configu... |
datastax/java-driver | core/src/main/java/com/datastax/oss/driver/internal/core/context/StartupOptionsBuilder.java | StartupOptionsBuilder.build | public Map<String, String> build() {
NullAllowingImmutableMap.Builder<String, String> builder = NullAllowingImmutableMap.builder(3);
// add compression (if configured) and driver name and version
String compressionAlgorithm = context.getCompressor().algorithm();
if (compressionAlgorithm != null && !comp... | java | public Map<String, String> build() {
NullAllowingImmutableMap.Builder<String, String> builder = NullAllowingImmutableMap.builder(3);
// add compression (if configured) and driver name and version
String compressionAlgorithm = context.getCompressor().algorithm();
if (compressionAlgorithm != null && !comp... | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"build",
"(",
")",
"{",
"NullAllowingImmutableMap",
".",
"Builder",
"<",
"String",
",",
"String",
">",
"builder",
"=",
"NullAllowingImmutableMap",
".",
"builder",
"(",
"3",
")",
";",
"// add compression (if c... | Builds a map of options to send in a Startup message.
<p>The default set of options are built here and include {@link
com.datastax.oss.protocol.internal.request.Startup#COMPRESSION_KEY} (if the context passed in
has a compressor/algorithm set), and the driver's {@link #DRIVER_NAME_KEY} and {@link
#DRIVER_VERSION_KEY}.... | [
"Builds",
"a",
"map",
"of",
"options",
"to",
"send",
"in",
"a",
"Startup",
"message",
"."
] | 612a63f2525618e2020e86c9ad75ab37adba6132 | https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/core/src/main/java/com/datastax/oss/driver/internal/core/context/StartupOptionsBuilder.java#L48-L59 | train | Build the result set. | Of course, here is the Java code you requested:
```java
public Map<String, String> build() {
NullAllowingImmutableMap.Builder<String, String> builder = NullAllowingImmutableMap.builder(3);
// add compression (if configured) and driver name and version
String compressionAlgorithm = context.getCompressor().a... |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.takeWhile | public static <T> Iterator<T> takeWhile(Iterator<T> self, @ClosureParams(FirstParam.FirstGenericType.class) Closure condition) {
return new TakeWhileIterator<T>(self, condition);
} | java | public static <T> Iterator<T> takeWhile(Iterator<T> self, @ClosureParams(FirstParam.FirstGenericType.class) Closure condition) {
return new TakeWhileIterator<T>(self, condition);
} | [
"public",
"static",
"<",
"T",
">",
"Iterator",
"<",
"T",
">",
"takeWhile",
"(",
"Iterator",
"<",
"T",
">",
"self",
",",
"@",
"ClosureParams",
"(",
"FirstParam",
".",
"FirstGenericType",
".",
"class",
")",
"Closure",
"condition",
")",
"{",
"return",
"new"... | Returns the longest prefix of elements in this iterator where
each element passed to the given condition closure evaluates to true.
<p>
<pre class="groovyTestCase">
def a = 0
def iter = [ hasNext:{ true }, next:{ a++ } ] as Iterator
assert [].iterator().takeWhile{ it {@code <} 3 }.toList() == []
assert [1, 2, 3, 4, 5]... | [
"Returns",
"the",
"longest",
"prefix",
"of",
"elements",
"in",
"this",
"iterator",
"where",
"each",
"element",
"passed",
"to",
"the",
"given",
"condition",
"closure",
"evaluates",
"to",
"true",
".",
"<p",
">",
"<pre",
"class",
"=",
"groovyTestCase",
">",
"de... | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L11029-L11031 | train | Creates an iterator that iterates over the elements of the iterator until the condition returns true. | Of course, here is the Java code you requested:
```java
public static <T> Iterator<T> takeWhile(Iterator<T> self, @ClosureParams(FirstParam.FirstGenericType.class) Closure condition) {
return new TakeWhileIterator<T>(self, condition);
}
```
Hope this helps! |
dubboclub/dubbo-plus | restful/src/main/java/net/dubboclub/restful/export/RestfulHandler.java | RestfulHandler.handle | @Override
public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
String requestUri = request.getRequestURI();
if(!StringUtils.contains(requestUri,contextPath)){
response.sendError(404);
return;
}
req... | java | @Override
public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
String requestUri = request.getRequestURI();
if(!StringUtils.contains(requestUri,contextPath)){
response.sendError(404);
return;
}
req... | [
"@",
"Override",
"public",
"void",
"handle",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"String",
"requestUri",
"=",
"request",
".",
"getRequestURI",
"(",
")",
";",
"if"... | 所有restful的入口
http://ip:port/contextpath/${path}/${method}/${version}/${group}
@param request
@param response
@throws IOException
@throws ServletException | [
"所有restful的入口",
"http",
":",
"//",
"ip",
":",
"port",
"/",
"contextpath",
"/",
"$",
"{",
"path",
"}",
"/",
"$",
"{",
"method",
"}",
"/",
"$",
"{",
"version",
"}",
"/",
"$",
"{",
"group",
"}"
] | defac66b2ad50d0b60d6991a0c49e06a602abb34 | https://github.com/dubboclub/dubbo-plus/blob/defac66b2ad50d0b60d6991a0c49e06a602abb34/restful/src/main/java/net/dubboclub/restful/export/RestfulHandler.java#L48-L107 | train | Handle a request. | Of course, here is the Java code you requested:
```java
@Override
public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
String requestUri = request.getRequestURI();
if(!StringUtils.contains(requestUri,contextPath)){
response.... |
camunda/camunda-bpmn-model | src/main/java/org/camunda/bpm/model/bpmn/builder/AbstractUserTaskBuilder.java | AbstractUserTaskBuilder.camundaTaskListenerClass | @SuppressWarnings("rawtypes")
public B camundaTaskListenerClass(String eventName, Class listenerClass) {
return camundaTaskListenerClass(eventName, listenerClass.getName());
} | java | @SuppressWarnings("rawtypes")
public B camundaTaskListenerClass(String eventName, Class listenerClass) {
return camundaTaskListenerClass(eventName, listenerClass.getName());
} | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"B",
"camundaTaskListenerClass",
"(",
"String",
"eventName",
",",
"Class",
"listenerClass",
")",
"{",
"return",
"camundaTaskListenerClass",
"(",
"eventName",
",",
"listenerClass",
".",
"getName",
"(",
")",... | Add a class based task listener with specified event name
@param eventName - event names to listen to
@param fullQualifiedClassName - a string representing a class
@return the builder object | [
"Add",
"a",
"class",
"based",
"task",
"listener",
"with",
"specified",
"event",
"name"
] | debcadf041d10fa62b799de0307b832cea84e5d4 | https://github.com/camunda/camunda-bpmn-model/blob/debcadf041d10fa62b799de0307b832cea84e5d4/src/main/java/org/camunda/bpm/model/bpmn/builder/AbstractUserTaskBuilder.java#L189-L192 | train | Create a new camundaTaskListener object with the specified listener class name. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("rawtypes")
public B camundaTaskListenerClass(String eventName, Class listenerClass) {
return camundaTaskListenerClass(eventName, listenerClass.getName());
}
```
Hope this helps! |
OpenHFT/Chronicle-Network | src/main/java/net/openhft/chronicle/network/connection/TcpChannelHub.java | TcpChannelHub.close | @Override
public void close() {
if (closed)
return;
closed = true;
tcpSocketConsumer.prepareToShutdown();
if (shouldSendCloseMessage)
eventLoop.addHandler(new EventHandler() {
@Override
public boolean action() throws InvalidEv... | java | @Override
public void close() {
if (closed)
return;
closed = true;
tcpSocketConsumer.prepareToShutdown();
if (shouldSendCloseMessage)
eventLoop.addHandler(new EventHandler() {
@Override
public boolean action() throws InvalidEv... | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"{",
"if",
"(",
"closed",
")",
"return",
";",
"closed",
"=",
"true",
";",
"tcpSocketConsumer",
".",
"prepareToShutdown",
"(",
")",
";",
"if",
"(",
"shouldSendCloseMessage",
")",
"eventLoop",
".",
"addHa... | called when we are completed finished with using the TcpChannelHub | [
"called",
"when",
"we",
"are",
"completed",
"finished",
"with",
"using",
"the",
"TcpChannelHub"
] | b50d232a1763b1400d5438c7925dce845e5c387a | https://github.com/OpenHFT/Chronicle-Network/blob/b50d232a1763b1400d5438c7925dce845e5c387a/src/main/java/net/openhft/chronicle/network/connection/TcpChannelHub.java#L490-L529 | train | Close the TcpChannelHub. | Of course, here is the Java code you requested:
```java
@Override
public void close() {
if (closed)
return;
closed = true;
tcpSocketConsumer.prepareToShutdown();
if (shouldSendCloseMessage)
eventLoop.addHandler(new EventHandler() {
@Override... |
HtmlUnit/htmlunit-cssparser | src/main/java/com/gargoylesoftware/css/dom/CSSFontFaceRuleImpl.java | CSSFontFaceRuleImpl.setCssText | @Override
public void setCssText(final String cssText) throws DOMException {
try {
final CSSOMParser parser = new CSSOMParser();
final AbstractCSSRuleImpl r = parser.parseRule(cssText);
// The rule must be a font face rule
if (r instanceof CSSFontFaceRuleImpl... | java | @Override
public void setCssText(final String cssText) throws DOMException {
try {
final CSSOMParser parser = new CSSOMParser();
final AbstractCSSRuleImpl r = parser.parseRule(cssText);
// The rule must be a font face rule
if (r instanceof CSSFontFaceRuleImpl... | [
"@",
"Override",
"public",
"void",
"setCssText",
"(",
"final",
"String",
"cssText",
")",
"throws",
"DOMException",
"{",
"try",
"{",
"final",
"CSSOMParser",
"parser",
"=",
"new",
"CSSOMParser",
"(",
")",
";",
"final",
"AbstractCSSRuleImpl",
"r",
"=",
"parser",
... | {@inheritDoc} | [
"{"
] | 384e4170737169b5b4c87c5766495d9b8a6d3866 | https://github.com/HtmlUnit/htmlunit-cssparser/blob/384e4170737169b5b4c87c5766495d9b8a6d3866/src/main/java/com/gargoylesoftware/css/dom/CSSFontFaceRuleImpl.java#L62-L90 | train | Sets the CSS text of the document. | Of course, here is the Java code you requested:
```java
@Override
public void setCssText(final String cssText) throws DOMException {
try {
final CSSOMParser parser = new CSSOMParser();
final AbstractCSSRuleImpl r = parser.parseRule(cssText);
// The rule must be a font f... |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheProviderWrapper.java | CacheProviderWrapper.getEntry | @Override
public com.ibm.websphere.cache.CacheEntry getEntry(Object id, int source, boolean ignoreCounting, boolean incrementRefCount) {
final String methodName = "getEntry()";
com.ibm.websphere.cache.CacheEntry ce = this.coreCache.get(id);
if (tc.isDebugEnabled()) {
Tr.debug(tc,... | java | @Override
public com.ibm.websphere.cache.CacheEntry getEntry(Object id, int source, boolean ignoreCounting, boolean incrementRefCount) {
final String methodName = "getEntry()";
com.ibm.websphere.cache.CacheEntry ce = this.coreCache.get(id);
if (tc.isDebugEnabled()) {
Tr.debug(tc,... | [
"@",
"Override",
"public",
"com",
".",
"ibm",
".",
"websphere",
".",
"cache",
".",
"CacheEntry",
"getEntry",
"(",
"Object",
"id",
",",
"int",
"source",
",",
"boolean",
"ignoreCounting",
",",
"boolean",
"incrementRefCount",
")",
"{",
"final",
"String",
"metho... | This returns the cache entry identified by the specified cache id.
It returns null if not in the cache.
@param id The cache id for the entry. The id cannot be null.
@param source The source - local or remote (No effect on CoreCache)
@param ignoreCounting true to ignore the statistics counting (No effect on CoreCache)
... | [
"This",
"returns",
"the",
"cache",
"entry",
"identified",
"by",
"the",
"specified",
"cache",
"id",
".",
"It",
"returns",
"null",
"if",
"not",
"in",
"the",
"cache",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheProviderWrapper.java#L198-L206 | train | This method is called by the Cache Entry Manager to get a cache entry from the cache. | Of course, here is the Java code you requested:
```java
@Override
public com.ibm.websphere.cache.CacheEntry getEntry(Object id, int source, boolean ignoreCounting, boolean incrementRefCount) {
final String methodName = "getEntry()";
com.ibm.websphere.cache.CacheEntry ce = this.coreCache.get(id);
... |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/network/vlan_interface_binding.java | vlan_interface_binding.get | public static vlan_interface_binding[] get(nitro_service service, Long id) throws Exception{
vlan_interface_binding obj = new vlan_interface_binding();
obj.set_id(id);
vlan_interface_binding response[] = (vlan_interface_binding[]) obj.get_resources(service);
return response;
} | java | public static vlan_interface_binding[] get(nitro_service service, Long id) throws Exception{
vlan_interface_binding obj = new vlan_interface_binding();
obj.set_id(id);
vlan_interface_binding response[] = (vlan_interface_binding[]) obj.get_resources(service);
return response;
} | [
"public",
"static",
"vlan_interface_binding",
"[",
"]",
"get",
"(",
"nitro_service",
"service",
",",
"Long",
"id",
")",
"throws",
"Exception",
"{",
"vlan_interface_binding",
"obj",
"=",
"new",
"vlan_interface_binding",
"(",
")",
";",
"obj",
".",
"set_id",
"(",
... | Use this API to fetch vlan_interface_binding resources of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"vlan_interface_binding",
"resources",
"of",
"given",
"name",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/vlan_interface_binding.java#L198-L203 | train | Use this API to fetch vlan_interface_binding resources of given name. | Of course, here is the Java code you requested:
```java
public static vlan_interface_binding[] get(nitro_service service, Long id) throws Exception{
vlan_interface_binding obj = new vlan_interface_binding();
obj.set_id(id);
vlan_interface_binding response[] = (vlan_interface_binding[]) obj.get_resources(service)... |
jbundle/jbundle | app/program/script/src/main/java/org/jbundle/app/program/manual/convert/ConvertCode.java | ConvertCode.getDestPath | public File getDestPath(String sourcePath)
{
String destPathname = DBConstants.BLANK;
String dirPrefix = this.getProperty(DIR_PREFIX);
String sourceDir = this.getProperty(SOURCE_DIR);
String destDir = this.getProperty(DEST_DIR);
int startPath = sourcePath.indexOf(sourceDir);... | java | public File getDestPath(String sourcePath)
{
String destPathname = DBConstants.BLANK;
String dirPrefix = this.getProperty(DIR_PREFIX);
String sourceDir = this.getProperty(SOURCE_DIR);
String destDir = this.getProperty(DEST_DIR);
int startPath = sourcePath.indexOf(sourceDir);... | [
"public",
"File",
"getDestPath",
"(",
"String",
"sourcePath",
")",
"{",
"String",
"destPathname",
"=",
"DBConstants",
".",
"BLANK",
";",
"String",
"dirPrefix",
"=",
"this",
".",
"getProperty",
"(",
"DIR_PREFIX",
")",
";",
"String",
"sourceDir",
"=",
"this",
... | Get the destination pathname.
@param sourcePath The path to the source file
@return The path to place the destination file | [
"Get",
"the",
"destination",
"pathname",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/app/program/script/src/main/java/org/jbundle/app/program/manual/convert/ConvertCode.java#L194-L227 | train | Get the destination path. | Of course, here is the Java code you requested:
```java
public File getDestPath(String sourcePath)
{
String destPathname = DBConstants.BLANK;
String dirPrefix = this.getProperty(DIR_PREFIX);
String sourceDir = this.getProperty(SOURCE_DIR);
String destDir = this.getProperty(DEST_DIR... |
doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyObject.java | LazyObject.optBoolean | public boolean optBoolean(String key){
LazyNode token=getOptionalFieldToken(key);
if(token==null)return false;
if(token.type==LazyNode.VALUE_STRING || token.type==LazyNode.VALUE_ESTRING){
String str=token.getStringValue().toLowerCase().trim();
if(str.equals("true"))return true;
if(str.equals("false"))ret... | java | public boolean optBoolean(String key){
LazyNode token=getOptionalFieldToken(key);
if(token==null)return false;
if(token.type==LazyNode.VALUE_STRING || token.type==LazyNode.VALUE_ESTRING){
String str=token.getStringValue().toLowerCase().trim();
if(str.equals("true"))return true;
if(str.equals("false"))ret... | [
"public",
"boolean",
"optBoolean",
"(",
"String",
"key",
")",
"{",
"LazyNode",
"token",
"=",
"getOptionalFieldToken",
"(",
"key",
")",
";",
"if",
"(",
"token",
"==",
"null",
")",
"return",
"false",
";",
"if",
"(",
"token",
".",
"type",
"==",
"LazyNode",
... | Returns the boolean value stored in this object for the given key.
Returns false if there is no such key.
@param key the name of the field on this object
@return the requested boolean value or false if there was no such key | [
"Returns",
"the",
"boolean",
"value",
"stored",
"in",
"this",
"object",
"for",
"the",
"given",
"key",
".",
"Returns",
"false",
"if",
"there",
"is",
"no",
"such",
"key",
"."
] | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyObject.java#L534-L547 | train | Returns the boolean value stored in this object for the given key. | Of course, here is the Java code you requested:
```java
public boolean optBoolean(String key){
LazyNode token=getOptionalFieldToken(key);
if(token==null)return false;
if(token.type==LazyNode.VALUE_STRING || token.type==LazyNode.VALUE_ESTRING){
String str=token.getStringValue().toLowerCase().trim();
if(str.... |
thorntail/thorntail | core/container/src/main/java/org/wildfly/swarm/container/config/EnvironmentConfigNodeFactory.java | EnvironmentConfigNodeFactory.load | public static ConfigNode load(Map<String, String> input) {
ConfigNode config = new ConfigNode();
load(config, input);
return config;
} | java | public static ConfigNode load(Map<String, String> input) {
ConfigNode config = new ConfigNode();
load(config, input);
return config;
} | [
"public",
"static",
"ConfigNode",
"load",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"input",
")",
"{",
"ConfigNode",
"config",
"=",
"new",
"ConfigNode",
"(",
")",
";",
"load",
"(",
"config",
",",
"input",
")",
";",
"return",
"config",
";",
"}"
] | Load a given {@link Properties} into a {@link ConfigNode}.
@param input The properties to load.
@return The loaded {@code ConfigNode}. | [
"Load",
"a",
"given",
"{",
"@link",
"Properties",
"}",
"into",
"a",
"{",
"@link",
"ConfigNode",
"}",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/core/container/src/main/java/org/wildfly/swarm/container/config/EnvironmentConfigNodeFactory.java#L44-L50 | train | Load a CRUCTYPE configuration from a map of key - value pairs. | Of course, here is the Java code you requested:
```java
public static ConfigNode load(Map<String, String> input) {
ConfigNode config = new ConfigNode();
load(config, input);
return config;
}
```
Hope this helps! |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/GV/AbstractHBCIJob.java | AbstractHBCIJob.saveBasicValues | private void saveBasicValues(HashMap<String, String> result, int ref) {
// wenn noch keine basic-daten gespeichert sind
if (jobResult.getDialogId() == null) {
// Pfad des originalen MsgHead-Segmentes holen und um "orig_" ergaenzen,
// um den Key fuer die entsprechenden Daten in d... | java | private void saveBasicValues(HashMap<String, String> result, int ref) {
// wenn noch keine basic-daten gespeichert sind
if (jobResult.getDialogId() == null) {
// Pfad des originalen MsgHead-Segmentes holen und um "orig_" ergaenzen,
// um den Key fuer die entsprechenden Daten in d... | [
"private",
"void",
"saveBasicValues",
"(",
"HashMap",
"<",
"String",
",",
"String",
">",
"result",
",",
"int",
"ref",
")",
"{",
"// wenn noch keine basic-daten gespeichert sind",
"if",
"(",
"jobResult",
".",
"getDialogId",
"(",
")",
"==",
"null",
")",
"{",
"//... | /* wenn wenigstens ein HBCI-Rückgabewert für den aktuellen GV gefunden wurde,
so werden im outStore zusätzlich die entsprechenden Dialog-Parameter
gespeichert (Property @c basic.*) | [
"/",
"*",
"wenn",
"wenigstens",
"ein",
"HBCI",
"-",
"Rückgabewert",
"für",
"den",
"aktuellen",
"GV",
"gefunden",
"wurde",
"so",
"werden",
"im",
"outStore",
"zusätzlich",
"die",
"entsprechenden",
"Dialog",
"-",
"Parameter",
"gespeichert",
"(",
"Property"
] | 5e24f7e429d6b555e1d993196b4cf1adda6433cf | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/GV/AbstractHBCIJob.java#L750-L766 | train | Save basic values. | Of course, here is the Java code you requested:
```java
private void saveBasicValues(HashMap<String, String> result, int ref) {
// wenn noch keine basic-daten gespeichert sind
if (jobResult.getDialogId() == null) {
// Pfad des originalen MsgHead-Segmentes holen und um "orig_" ergaenzen,
... |
Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/tools/DOMHelper.java | DOMHelper.appendChild | public static void appendChild(Document doc, Element parentElement, String elementName, String elementValue) {
Element child = doc.createElement(elementName);
Text text = doc.createTextNode(elementValue);
child.appendChild(text);
parentElement.appendChild(child);
} | java | public static void appendChild(Document doc, Element parentElement, String elementName, String elementValue) {
Element child = doc.createElement(elementName);
Text text = doc.createTextNode(elementValue);
child.appendChild(text);
parentElement.appendChild(child);
} | [
"public",
"static",
"void",
"appendChild",
"(",
"Document",
"doc",
",",
"Element",
"parentElement",
",",
"String",
"elementName",
",",
"String",
"elementValue",
")",
"{",
"Element",
"child",
"=",
"doc",
".",
"createElement",
"(",
"elementName",
")",
";",
"Text... | Add a child element to a parent element
@param doc
@param parentElement
@param elementName
@param elementValue | [
"Add",
"a",
"child",
"element",
"to",
"a",
"parent",
"element"
] | 2ff9f9580e76043f19d2fc3234d87e16a95fa485 | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/tools/DOMHelper.java#L229-L234 | train | Append a child element to a parent element. | Of course, here is the Java code you requested:
```java
public static void appendChild(Document doc, Element parentElement, String elementName, String elementValue) {
Element child = doc.createElement(elementName);
Text text = doc.createTextNode(elementValue);
child.appendChild(text);
p... |
lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/linsol/chol/LinearSolverChol_ZDRM.java | LinearSolverChol_ZDRM.solveInternalL | private void solveInternalL() {
// This takes advantage of the diagonal elements always being real numbers
// solve L*y=b storing y in x
TriangularSolver_ZDRM.solveL_diagReal(t, vv, n);
// solve L^T*x=y
TriangularSolver_ZDRM.solveConjTranL_diagReal(t, vv, n);
} | java | private void solveInternalL() {
// This takes advantage of the diagonal elements always being real numbers
// solve L*y=b storing y in x
TriangularSolver_ZDRM.solveL_diagReal(t, vv, n);
// solve L^T*x=y
TriangularSolver_ZDRM.solveConjTranL_diagReal(t, vv, n);
} | [
"private",
"void",
"solveInternalL",
"(",
")",
"{",
"// This takes advantage of the diagonal elements always being real numbers",
"// solve L*y=b storing y in x",
"TriangularSolver_ZDRM",
".",
"solveL_diagReal",
"(",
"t",
",",
"vv",
",",
"n",
")",
";",
"// solve L^T*x=y",
"Tr... | Used internally to find the solution to a single column vector. | [
"Used",
"internally",
"to",
"find",
"the",
"solution",
"to",
"a",
"single",
"column",
"vector",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/linsol/chol/LinearSolverChol_ZDRM.java#L114-L122 | train | Solve L using internal L. | Of course, here is the Java code you requested:
```java
private void solveInternalL() {
// This takes advantage of the diagonal elements always being real numbers
// solve L*y=b storing y in x
TriangularSolver_ZDRM.solveL_diagReal(t, vv, n);
// solve L^T*x=y
TriangularSolver_Z... |
boonproject/boon | boon/src/main/java/org/boon/Str.java | Str.in | @Universal
public static boolean in( char[] chars, String str ) {
return Chr.in ( chars, FastStringUtils.toCharArray(str) );
} | java | @Universal
public static boolean in( char[] chars, String str ) {
return Chr.in ( chars, FastStringUtils.toCharArray(str) );
} | [
"@",
"Universal",
"public",
"static",
"boolean",
"in",
"(",
"char",
"[",
"]",
"chars",
",",
"String",
"str",
")",
"{",
"return",
"Chr",
".",
"in",
"(",
"chars",
",",
"FastStringUtils",
".",
"toCharArray",
"(",
"str",
")",
")",
";",
"}"
] | See if chars is in another string
@param chars chars
@param str string
@return true or false | [
"See",
"if",
"chars",
"is",
"in",
"another",
"string"
] | 9bc6870dbe5dd58c45c18d8edb493e8efc089463 | https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/Str.java#L213-L216 | test | Check if a char array is in a string. | Of course, here is the Java code you requested:
```java
@Universal
public static boolean in( char[] chars, String str ) {
return Chr.in ( chars, FastStringUtils.toCharArray(str) );
}
```
Hope this helps! |
konvergeio/cofoja | src/main/java/com/google/java/contract/core/apt/AbstractTypeBuilder.java | AbstractTypeBuilder.visitAnnotation | @Requires({
"parent != null",
"annotation != null",
"owner != null",
"p != null"
})
protected void visitAnnotation(
Element parent, AnnotationMirror annotation,
boolean primary, ClassName owner, ElementModel p) {
if (utils.isContractAnnotation(annotation)) {
ContractAnnotationM... | java | @Requires({
"parent != null",
"annotation != null",
"owner != null",
"p != null"
})
protected void visitAnnotation(
Element parent, AnnotationMirror annotation,
boolean primary, ClassName owner, ElementModel p) {
if (utils.isContractAnnotation(annotation)) {
ContractAnnotationM... | [
"@",
"Requires",
"(",
"{",
"\"parent != null\"",
",",
"\"annotation != null\"",
",",
"\"owner != null\"",
",",
"\"p != null\"",
"}",
")",
"protected",
"void",
"visitAnnotation",
"(",
"Element",
"parent",
",",
"AnnotationMirror",
"annotation",
",",
"boolean",
"primary"... | Visits an annotation and adds a corresponding node to the
specified Element.
Despite the name, this method is not inherited through any
visitor interface. It is not intended for external calls.
@param parent the target of the annotation
@param annotation the annotation
@param primary whether this is a primary contrac... | [
"Visits",
"an",
"annotation",
"and",
"adds",
"a",
"corresponding",
"node",
"to",
"the",
"specified",
"Element",
"."
] | 6ded58fa05eb5bf85f16353c8dd4c70bee59121a | https://github.com/konvergeio/cofoja/blob/6ded58fa05eb5bf85f16353c8dd4c70bee59121a/src/main/java/com/google/java/contract/core/apt/AbstractTypeBuilder.java#L205-L221 | train | Visit an annotation. | Of course, here is the Java code you requested:
```java
@Requires({
"parent != null",
"annotation != null",
"owner != null",
"p != null"
})
protected void visitAnnotation(
Element parent, AnnotationMirror annotation,
boolean primary, ClassName owner, ElementModel p) {
if (utils.isCo... |
burberius/eve-esi | src/main/java/net/troja/eve/esi/api/ClonesApi.java | ClonesApi.getCharactersCharacterIdImplants | public List<Integer> getCharactersCharacterIdImplants(Integer characterId, String datasource, String ifNoneMatch,
String token) throws ApiException {
ApiResponse<List<Integer>> resp = getCharactersCharacterIdImplantsWithHttpInfo(characterId, datasource,
ifNoneMatch, token);
r... | java | public List<Integer> getCharactersCharacterIdImplants(Integer characterId, String datasource, String ifNoneMatch,
String token) throws ApiException {
ApiResponse<List<Integer>> resp = getCharactersCharacterIdImplantsWithHttpInfo(characterId, datasource,
ifNoneMatch, token);
r... | [
"public",
"List",
"<",
"Integer",
">",
"getCharactersCharacterIdImplants",
"(",
"Integer",
"characterId",
",",
"String",
"datasource",
",",
"String",
"ifNoneMatch",
",",
"String",
"token",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"List",
"<",
"Integ... | Get active implants Return implants on the active clone of a character
--- This route is cached for up to 120 seconds SSO Scope:
esi-clones.read_implants.v1
@param characterId
An EVE character ID (required)
@param datasource
The server name you would like data from (optional, default to
tranquility)
@param ifNoneMatch... | [
"Get",
"active",
"implants",
"Return",
"implants",
"on",
"the",
"active",
"clone",
"of",
"a",
"character",
"---",
"This",
"route",
"is",
"cached",
"for",
"up",
"to",
"120",
"seconds",
"SSO",
"Scope",
":",
"esi",
"-",
"clones",
".",
"read_implants",
".",
... | 24a941c592cfc15f23471ef849b282fbc582ca13 | https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/api/ClonesApi.java#L313-L318 | train | Get list of CDN coding for a character Get list of CDN coding for a character | Of course, here is the Java code you requested:
```java
public List<Integer> getCharactersCharacterIdImplants(Integer characterId, String datasource, String ifNoneMatch,
String token) throws ApiException {
ApiResponse<List<Integer>> resp = getCharactersCharacterIdImplantsWithHttpInfo(characterId, d... |
agaricusb/SpecialSourceMP | src/main/java/net/md_5/specialsource/mavenplugin/InstallRemappedFileMojo.java | InstallRemappedFileMojo.generateModel | private Model generateModel()
{
Model model = new Model();
model.setModelVersion( "4.0.0" );
model.setGroupId( groupId );
model.setArtifactId( artifactId );
model.setVersion( version );
model.setPackaging( packaging );
model.setDescription( "POM was created... | java | private Model generateModel()
{
Model model = new Model();
model.setModelVersion( "4.0.0" );
model.setGroupId( groupId );
model.setArtifactId( artifactId );
model.setVersion( version );
model.setPackaging( packaging );
model.setDescription( "POM was created... | [
"private",
"Model",
"generateModel",
"(",
")",
"{",
"Model",
"model",
"=",
"new",
"Model",
"(",
")",
";",
"model",
".",
"setModelVersion",
"(",
"\"4.0.0\"",
")",
";",
"model",
".",
"setGroupId",
"(",
"groupId",
")",
";",
"model",
".",
"setArtifactId",
"(... | Generates a minimal model from the user-supplied artifact information.
@return The generated model, never <code>null</code>. | [
"Generates",
"a",
"minimal",
"model",
"from",
"the",
"user",
"-",
"supplied",
"artifact",
"information",
"."
] | 350daa04831fb93a51a57a30009c572ade0a88bf | https://github.com/agaricusb/SpecialSourceMP/blob/350daa04831fb93a51a57a30009c572ade0a88bf/src/main/java/net/md_5/specialsource/mavenplugin/InstallRemappedFileMojo.java#L422-L436 | train | Generate a Model object from the generated code. | Of course, here is the Java code you requested:
```java
private Model generateModel()
{
Model model = new Model();
model.setModelVersion( "4.0.0" );
model.setGroupId( groupId );
model.setArtifactId( artifactId );
model.setVersion( version );
model.setPackaging( pac... |
Red5/red5-client | src/main/java/org/red5/client/net/rtmp/BaseRTMPClientHandler.java | BaseRTMPClientHandler.invoke | @Override
public void invoke(String method, IPendingServiceCallback callback) {
log.debug("invoke method: {} params {} callback {}", new Object[] { method, callback });
// get it from the conn manager
if (conn != null) {
conn.invoke(method, callback);
} else {
... | java | @Override
public void invoke(String method, IPendingServiceCallback callback) {
log.debug("invoke method: {} params {} callback {}", new Object[] { method, callback });
// get it from the conn manager
if (conn != null) {
conn.invoke(method, callback);
} else {
... | [
"@",
"Override",
"public",
"void",
"invoke",
"(",
"String",
"method",
",",
"IPendingServiceCallback",
"callback",
")",
"{",
"log",
".",
"debug",
"(",
"\"invoke method: {} params {} callback {}\"",
",",
"new",
"Object",
"[",
"]",
"{",
"method",
",",
"callback",
"... | Invoke a method on the server.
@param method
Method name
@param callback
Callback handler | [
"Invoke",
"a",
"method",
"on",
"the",
"server",
"."
] | f894495b60e59d7cfba647abd9b934237cac9d45 | https://github.com/Red5/red5-client/blob/f894495b60e59d7cfba647abd9b934237cac9d45/src/main/java/org/red5/client/net/rtmp/BaseRTMPClientHandler.java#L498-L510 | train | Invoke a
CTYPE service method. | Of course, here is the Java code you requested:
```java
@Override
public void invoke(String method, IPendingServiceCallback callback) {
log.debug("invoke method: {} params {} callback {}", new Object[] { method, callback });
// get it from the conn manager
if (conn != null) {
... |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/ns/nslimitidentifier_stats.java | nslimitidentifier_stats.get | public static nslimitidentifier_stats get(nitro_service service, String name) throws Exception{
nslimitidentifier_stats obj = new nslimitidentifier_stats();
obj.set_name(name);
nslimitidentifier_stats response = (nslimitidentifier_stats) obj.stat_resource(service);
return response;
} | java | public static nslimitidentifier_stats get(nitro_service service, String name) throws Exception{
nslimitidentifier_stats obj = new nslimitidentifier_stats();
obj.set_name(name);
nslimitidentifier_stats response = (nslimitidentifier_stats) obj.stat_resource(service);
return response;
} | [
"public",
"static",
"nslimitidentifier_stats",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"nslimitidentifier_stats",
"obj",
"=",
"new",
"nslimitidentifier_stats",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"nam... | Use this API to fetch statistics of nslimitidentifier_stats resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"statistics",
"of",
"nslimitidentifier_stats",
"resource",
"of",
"given",
"name",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/ns/nslimitidentifier_stats.java#L216-L221 | train | Use this API to fetch statistics of nslimitidentifier_stats resource of given name. | Of course, here is the Java code you requested:
```java
public static nslimitidentifier_stats get(nitro_service service, String name) throws Exception{
nslimitidentifier_stats obj = new nslimitidentifier_stats();
obj.set_name(name);
nslimitidentifier_stats response = (nslimitidentifier_stats) obj.stat_resource(s... |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/utils/HealthPinger.java | HealthPinger.mapToServiceHealth | private static Observable<PingServiceHealth> mapToServiceHealth(final String scope,
final ServiceType type, final Observable<? extends CouchbaseResponse> input,
final AtomicReference<CouchbaseRequest> request, final long timeout, final TimeUnit timeUnit) {
return input
.map(new Func1... | java | private static Observable<PingServiceHealth> mapToServiceHealth(final String scope,
final ServiceType type, final Observable<? extends CouchbaseResponse> input,
final AtomicReference<CouchbaseRequest> request, final long timeout, final TimeUnit timeUnit) {
return input
.map(new Func1... | [
"private",
"static",
"Observable",
"<",
"PingServiceHealth",
">",
"mapToServiceHealth",
"(",
"final",
"String",
"scope",
",",
"final",
"ServiceType",
"type",
",",
"final",
"Observable",
"<",
"?",
"extends",
"CouchbaseResponse",
">",
"input",
",",
"final",
"AtomicR... | Helper method to perform the proper health conversion.
@param input the response input
@return the converted output. | [
"Helper",
"method",
"to",
"perform",
"the",
"proper",
"health",
"conversion",
"."
] | 97f0427112c2168fee1d6499904f5fa0e24c6797 | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/utils/HealthPinger.java#L190-L240 | train | Map the response to service health. | Of course, here is the Java code you requested:
```java
private static Observable<PingServiceHealth> mapToServiceHealth(final String scope,
final ServiceType type, final Observable<? extends CouchbaseResponse> input,
final AtomicReference<CouchbaseRequest> request, final long timeout, final TimeUnit ti... |
tiefaces/TieFaces | src/org/tiefaces/components/websheet/configuration/ConfigRange.java | ConfigRange.buildAt | public final int buildAt(final String fullName,
final ConfigBuildRef configBuildRef, final int atRow,
final Map<String, Object> context,
final List<RowsMapping> currentRowsMappingList) {
if (commandList != null) {
for (int i = 0; i < commandList.size(); i++) {
Command command = commandList.get... | java | public final int buildAt(final String fullName,
final ConfigBuildRef configBuildRef, final int atRow,
final Map<String, Object> context,
final List<RowsMapping> currentRowsMappingList) {
if (commandList != null) {
for (int i = 0; i < commandList.size(); i++) {
Command command = commandList.get... | [
"public",
"final",
"int",
"buildAt",
"(",
"final",
"String",
"fullName",
",",
"final",
"ConfigBuildRef",
"configBuildRef",
",",
"final",
"int",
"atRow",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"context",
",",
"final",
"List",
"<",
"RowsMappin... | build the config range at specified point (start row). context include
the data objects for evaluation. build sequence is inside-out. e.g. first
build all the command area the range included. each command will hold the
final length after data populated. then buildCells build all cells in the
range except those commands... | [
"build",
"the",
"config",
"range",
"at",
"specified",
"point",
"(",
"start",
"row",
")",
".",
"context",
"include",
"the",
"data",
"objects",
"for",
"evaluation",
".",
"build",
"sequence",
"is",
"inside",
"-",
"out",
".",
"e",
".",
"g",
".",
"first",
"... | 3b57b9701ed0f080b5fa4fa78269cc0c422b34ba | https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/configuration/ConfigRange.java#L311-L335 | test | Creates a new row index based on the full name. | Of course, here is the Java code you requested:
```java
public final int buildAt(final String fullName,
final ConfigBuildRef configBuildRef, final int atRow,
final Map<String, Object> context,
final List<RowsMapping> currentRowsMappingList) {
if (commandList != null) {
for (int i = 0; i < commandL... |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/classreading/ClasspathReader.java | ClasspathReader.findResourcesByContextLoader | private final URL[] findResourcesByContextLoader()
{
List<URL> list = new ArrayList<URL>();
ClassLoader classLoader = this.getClass().getClassLoader();
assert classLoader != null;
URL[] urls = ((URLClassLoader) classLoader).getURLs();
for (String fullyQualifi... | java | private final URL[] findResourcesByContextLoader()
{
List<URL> list = new ArrayList<URL>();
ClassLoader classLoader = this.getClass().getClassLoader();
assert classLoader != null;
URL[] urls = ((URLClassLoader) classLoader).getURLs();
for (String fullyQualifi... | [
"private",
"final",
"URL",
"[",
"]",
"findResourcesByContextLoader",
"(",
")",
"{",
"List",
"<",
"URL",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"URL",
">",
"(",
")",
";",
"ClassLoader",
"classLoader",
"=",
"this",
".",
"getClass",
"(",
")",
".",
"ge... | Scan class resources into a basePackagetoScan path.
@return list of class path included in the base package | [
"Scan",
"class",
"resources",
"into",
"a",
"basePackagetoScan",
"path",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/classreading/ClasspathReader.java#L226-L240 | train | Find resources by context loader. | Of course, here is the Java code you requested:
```java
private final URL[] findResourcesByContextLoader()
{
List<URL> list = new ArrayList<URL>();
ClassLoader classLoader = this.getClass().getClassLoader();
assert classLoader != null;
URL[] urls = ((URLClassLoader) classLoa... |
mangstadt/biweekly | src/main/java/biweekly/util/com/google/ical/util/DTBuilder.java | DTBuilder.normalizeDate | private void normalizeDate() {
while (day <= 0) {
int days = TimeUtils.yearLength(month > 2 ? year : year - 1);
day += days;
--year;
}
if (month <= 0) {
int years = month / 12 - 1;
year += years;
month -= 12 * years;
} else if (month > 12) {
int years = (month - 1) / 12;
year += years;
... | java | private void normalizeDate() {
while (day <= 0) {
int days = TimeUtils.yearLength(month > 2 ? year : year - 1);
day += days;
--year;
}
if (month <= 0) {
int years = month / 12 - 1;
year += years;
month -= 12 * years;
} else if (month > 12) {
int years = (month - 1) / 12;
year += years;
... | [
"private",
"void",
"normalizeDate",
"(",
")",
"{",
"while",
"(",
"day",
"<=",
"0",
")",
"{",
"int",
"days",
"=",
"TimeUtils",
".",
"yearLength",
"(",
"month",
">",
"2",
"?",
"year",
":",
"year",
"-",
"1",
")",
";",
"day",
"+=",
"days",
";",
"--",... | Makes sure that the date fields are in the proper ranges (for example,
converts 32 January to 1 February). | [
"Makes",
"sure",
"that",
"the",
"date",
"fields",
"are",
"in",
"the",
"proper",
"ranges",
"(",
"for",
"example",
"converts",
"32",
"January",
"to",
"1",
"February",
")",
"."
] | 2e21350f85c13dfff52fdef98fdbebe2976fcf61 | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/com/google/ical/util/DTBuilder.java#L226-L263 | train | Normalizes the date. | Of course, here is the Java code you requested:
```java
private void normalizeDate() {
while (day <= 0) {
int days = TimeUtils.yearLength(month > 2 ? year : year - 1);
day += days;
--year;
}
if (month <= 0) {
int years = month / 12 - 1;
year += years;
month -= 12 * years;
} else if (month > ... |
gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/agent/capability/reasoning/bayes/unbbayes/ShanksAgentBayesianReasoningCapability.java | ShanksAgentBayesianReasoningCapability.addSoftEvidences | public static void addSoftEvidences(BayesianReasonerShanksAgent agent,
HashMap<String, HashMap<String, Double>> softEvidences)
throws ShanksException {
ShanksAgentBayesianReasoningCapability.addSoftEvidences(
agent.getBayesianNetwork(), softEvidences);
} | java | public static void addSoftEvidences(BayesianReasonerShanksAgent agent,
HashMap<String, HashMap<String, Double>> softEvidences)
throws ShanksException {
ShanksAgentBayesianReasoningCapability.addSoftEvidences(
agent.getBayesianNetwork(), softEvidences);
} | [
"public",
"static",
"void",
"addSoftEvidences",
"(",
"BayesianReasonerShanksAgent",
"agent",
",",
"HashMap",
"<",
"String",
",",
"HashMap",
"<",
"String",
",",
"Double",
">",
">",
"softEvidences",
")",
"throws",
"ShanksException",
"{",
"ShanksAgentBayesianReasoningCap... | Add a set of soft-evidences to the Bayesian network to reason with it.
@param agent
@param softEvidences
@throws ShanksException | [
"Add",
"a",
"set",
"of",
"soft",
"-",
"evidences",
"to",
"the",
"Bayesian",
"network",
"to",
"reason",
"with",
"it",
"."
] | 35d87a81c22731f4f83bbd0571c9c6d466bd16be | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/agent/capability/reasoning/bayes/unbbayes/ShanksAgentBayesianReasoningCapability.java#L629-L634 | train | Add the soft Evidences to the Bayesian network | Of course, here is the Java code you requested:
```java
public static void addSoftEvidences(BayesianReasonerShanksAgent agent,
HashMap<String, HashMap<String, Double>> softEvidences)
throws ShanksException {
ShanksAgentBayesianReasoningCapability.addSoftEvidences(
agent.... |
facebook/fresco | fbcore/src/main/java/com/facebook/common/util/UriUtil.java | UriUtil.getUriForResourceId | public static Uri getUriForResourceId(int resourceId) {
return new Uri.Builder()
.scheme(LOCAL_RESOURCE_SCHEME)
.path(String.valueOf(resourceId))
.build();
} | java | public static Uri getUriForResourceId(int resourceId) {
return new Uri.Builder()
.scheme(LOCAL_RESOURCE_SCHEME)
.path(String.valueOf(resourceId))
.build();
} | [
"public",
"static",
"Uri",
"getUriForResourceId",
"(",
"int",
"resourceId",
")",
"{",
"return",
"new",
"Uri",
".",
"Builder",
"(",
")",
".",
"scheme",
"(",
"LOCAL_RESOURCE_SCHEME",
")",
".",
"path",
"(",
"String",
".",
"valueOf",
"(",
"resourceId",
")",
")... | Return a URI for the given resource ID.
The returned URI consists of a {@link #LOCAL_RESOURCE_SCHEME} scheme and
the resource ID as path.
@param resourceId the resource ID to use
@return the URI | [
"Return",
"a",
"URI",
"for",
"the",
"given",
"resource",
"ID",
".",
"The",
"returned",
"URI",
"consists",
"of",
"a",
"{",
"@link",
"#LOCAL_RESOURCE_SCHEME",
"}",
"scheme",
"and",
"the",
"resource",
"ID",
"as",
"path",
"."
] | 0b85879d51c5036d5e46e627a6651afefc0b971a | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/fbcore/src/main/java/com/facebook/common/util/UriUtil.java#L247-L252 | train | Get uri for resource id | Of course, here is the Java code you requested:
```java
public static Uri getUriForResourceId(int resourceId) {
return new Uri.Builder()
.scheme(LOCAL_RESOURCE_SCHEME)
.path(String.valueOf(resourceId))
.build();
}
```
Hope this helps! |
aws/aws-sdk-java | aws-java-sdk-lightsail/src/main/java/com/amazonaws/services/lightsail/AmazonLightsailClient.java | AmazonLightsailClient.getInstanceAccessDetails | @Override
public GetInstanceAccessDetailsResult getInstanceAccessDetails(GetInstanceAccessDetailsRequest request) {
request = beforeClientExecution(request);
return executeGetInstanceAccessDetails(request);
} | java | @Override
public GetInstanceAccessDetailsResult getInstanceAccessDetails(GetInstanceAccessDetailsRequest request) {
request = beforeClientExecution(request);
return executeGetInstanceAccessDetails(request);
} | [
"@",
"Override",
"public",
"GetInstanceAccessDetailsResult",
"getInstanceAccessDetails",
"(",
"GetInstanceAccessDetailsRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeGetInstanceAccessDetails",
"(",
"request"... | <p>
Returns temporary SSH keys you can use to connect to a specific virtual private server, or <i>instance</i>.
</p>
<p>
The <code>get instance access details</code> operation supports tag-based access control via resource tags
applied to the resource identified by instanceName. For more information, see the <a
href="h... | [
"<p",
">",
"Returns",
"temporary",
"SSH",
"keys",
"you",
"can",
"use",
"to",
"connect",
"to",
"a",
"specific",
"virtual",
"private",
"server",
"or",
"<i",
">",
"instance<",
"/",
"i",
">",
".",
"<",
"/",
"p",
">",
"<p",
">",
"The",
"<code",
">",
"ge... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-lightsail/src/main/java/com/amazonaws/services/lightsail/AmazonLightsailClient.java#L4386-L4390 | train | Retrieves the access details for an instance. | Of course, here is the Java code you requested:
```java
@Override
public GetInstanceAccessDetailsResult getInstanceAccessDetails(GetInstanceAccessDetailsRequest request) {
request = beforeClientExecution(request);
return executeGetInstanceAccessDetails(request);
}
```
Hope this helps! |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/style/sld/XmlCharsetDetector.java | XmlCharsetDetector.getXmlEncoding | protected static String getXmlEncoding(Reader reader) {
try {
StringWriter sw = new StringWriter(MAX_XMLDECL_SIZE);
int c;
int count = 0;
for (; (6 > count) && (-1 != (c = reader.read())); count++) {
sw.write(c);
}
/*
... | java | protected static String getXmlEncoding(Reader reader) {
try {
StringWriter sw = new StringWriter(MAX_XMLDECL_SIZE);
int c;
int count = 0;
for (; (6 > count) && (-1 != (c = reader.read())); count++) {
sw.write(c);
}
/*
... | [
"protected",
"static",
"String",
"getXmlEncoding",
"(",
"Reader",
"reader",
")",
"{",
"try",
"{",
"StringWriter",
"sw",
"=",
"new",
"StringWriter",
"(",
"MAX_XMLDECL_SIZE",
")",
";",
"int",
"c",
";",
"int",
"count",
"=",
"0",
";",
"for",
"(",
";",
"(",
... | Gets the encoding of the xml request made to the dispatcher. This works by reading the temp
file where we are storing the request, looking to match the header specified encoding that
should be present on all xml files. This call should only be made after the temp file has
been set. If no encoding is found, or if an IOE... | [
"Gets",
"the",
"encoding",
"of",
"the",
"xml",
"request",
"made",
"to",
"the",
"dispatcher",
".",
"This",
"works",
"by",
"reading",
"the",
"temp",
"file",
"where",
"we",
"are",
"storing",
"the",
"request",
"looking",
"to",
"match",
"the",
"header",
"specif... | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/sld/XmlCharsetDetector.java#L445-L507 | train | Get the XML encoding from the reader. | Of course, here is the Java code you requested:
```java
protected static String getXmlEncoding(Reader reader) {
try {
StringWriter sw = new StringWriter(MAX_XMLDECL_SIZE);
int c;
int count = 0;
for (; (6 > count) && (-1 != (c = reader.read())); count++) {
... |
leancloud/java-sdk-all | android-sdk/realtime-sample-app/src/main/java/cn/leancloud/realtime_sample_app/LoginActivity.java | LoginActivity.onRequestPermissionsResult | @Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
@NonNull int[] grantResults) {
if (requestCode == REQUEST_READ_CONTACTS) {
if (grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
... | java | @Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
@NonNull int[] grantResults) {
if (requestCode == REQUEST_READ_CONTACTS) {
if (grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
... | [
"@",
"Override",
"public",
"void",
"onRequestPermissionsResult",
"(",
"int",
"requestCode",
",",
"@",
"NonNull",
"String",
"[",
"]",
"permissions",
",",
"@",
"NonNull",
"int",
"[",
"]",
"grantResults",
")",
"{",
"if",
"(",
"requestCode",
"==",
"REQUEST_READ_CO... | Callback received when a permissions request has been completed. | [
"Callback",
"received",
"when",
"a",
"permissions",
"request",
"has",
"been",
"completed",
"."
] | 323f8e7ee38051b1350790e5192304768c5c9f5f | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/android-sdk/realtime-sample-app/src/main/java/cn/leancloud/realtime_sample_app/LoginActivity.java#L139-L147 | train | Override to handle permissions result. | Of course, here is the Java code you requested:
```java
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
@NonNull int[] grantResults) {
if (requestCode == REQUEST_READ_CONTACTS) {
if (grantResults.length == 1 && grantR... |
nutzam/nutzboot | nutzboot-starter/nutzboot-starter-tio-websocket/src/main/java/org/nutz/boot/starter/tio/websocketbean/TioWebsocketMsgHandler.java | TioWebsocketMsgHandler.handshake | @Override
public HttpResponse handshake(HttpRequest httpRequest, HttpResponse httpResponse, ChannelContext channelContext) throws Exception {
String clientip = httpRequest.getClientIp();
log.debugf("receive {}'s websocket handshake packet \r\n{}", clientip, httpRequest.toString());
TioWebso... | java | @Override
public HttpResponse handshake(HttpRequest httpRequest, HttpResponse httpResponse, ChannelContext channelContext) throws Exception {
String clientip = httpRequest.getClientIp();
log.debugf("receive {}'s websocket handshake packet \r\n{}", clientip, httpRequest.toString());
TioWebso... | [
"@",
"Override",
"public",
"HttpResponse",
"handshake",
"(",
"HttpRequest",
"httpRequest",
",",
"HttpResponse",
"httpResponse",
",",
"ChannelContext",
"channelContext",
")",
"throws",
"Exception",
"{",
"String",
"clientip",
"=",
"httpRequest",
".",
"getClientIp",
"(",... | handshake
@param httpRequest tio-http-request
@param httpResponse tio-http-response
@param channelContext context
@return tio-http-response
@throws Exception e | [
"handshake"
] | fd33fd4fdce058eab594f28e4d3202f997e3c66a | https://github.com/nutzam/nutzboot/blob/fd33fd4fdce058eab594f28e4d3202f997e3c66a/nutzboot-starter/nutzboot-starter-tio-websocket/src/main/java/org/nutz/boot/starter/tio/websocketbean/TioWebsocketMsgHandler.java#L37-L47 | train | Handle a websocket handshake. | Of course, here is the Java code you requested:
```java
@Override
public HttpResponse handshake(HttpRequest httpRequest, HttpResponse httpResponse, ChannelContext channelContext) throws Exception {
String clientip = httpRequest.getClientIp();
log.debugf("receive {}'s websocket handshake packet \r\n... |
facebookarchive/hadoop-20 | src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/PoolManager.java | PoolManager.getPoolNames | public synchronized Collection<String> getPoolNames() {
List<String> list = new ArrayList<String>();
for (Pool pool: getPools()) {
list.add(pool.getName());
}
Collections.sort(list);
return list;
} | java | public synchronized Collection<String> getPoolNames() {
List<String> list = new ArrayList<String>();
for (Pool pool: getPools()) {
list.add(pool.getName());
}
Collections.sort(list);
return list;
} | [
"public",
"synchronized",
"Collection",
"<",
"String",
">",
"getPoolNames",
"(",
")",
"{",
"List",
"<",
"String",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"Pool",
"pool",
":",
"getPools",
"(",
")",
")",
"{"... | Get all pool names that have been seen either in the allocation file or in
a MapReduce job. | [
"Get",
"all",
"pool",
"names",
"that",
"have",
"been",
"seen",
"either",
"in",
"the",
"allocation",
"file",
"or",
"in",
"a",
"MapReduce",
"job",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/PoolManager.java#L610-L617 | train | Get the list of pool names. | Of course, here is the Java code you requested:
```java
public synchronized Collection<String> getPoolNames() {
List<String> list = new ArrayList<String>();
for (Pool pool: getPools()) {
list.add(pool.getName());
}
Collections.sort(list);
return list;
}
```
Hope this helps! |
js-lib-com/commons | src/main/java/js/util/Files.java | Files.path2unix | public static String path2unix(String path)
{
if(path == null) {
return null;
}
if(path.endsWith("/") || path.endsWith("\\")) {
path = path.substring(0, path.length() - 1);
}
return path.replaceAll("(^[a-zA-Z]\\:\\\\?)?\\\\", "/");
} | java | public static String path2unix(String path)
{
if(path == null) {
return null;
}
if(path.endsWith("/") || path.endsWith("\\")) {
path = path.substring(0, path.length() - 1);
}
return path.replaceAll("(^[a-zA-Z]\\:\\\\?)?\\\\", "/");
} | [
"public",
"static",
"String",
"path2unix",
"(",
"String",
"path",
")",
"{",
"if",
"(",
"path",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"path",
".",
"endsWith",
"(",
"\"/\"",
")",
"||",
"path",
".",
"endsWith",
"(",
"\"\\\\\"",
... | Convert file path to an Unix like path string. If given <code>path</code> is Windows like replaces drive letter
with Unix path root and all Windows path separators to Unix counterpart.
<pre>
D:\\temp\file.txt -> /temp/file.txt
</pre>
If <code>path</code> is already Unix like this method leave it as it is but remov... | [
"Convert",
"file",
"path",
"to",
"an",
"Unix",
"like",
"path",
"string",
".",
"If",
"given",
"<code",
">",
"path<",
"/",
"code",
">",
"is",
"Windows",
"like",
"replaces",
"drive",
"letter",
"with",
"Unix",
"path",
"root",
"and",
"all",
"Windows",
"path",... | f8c64482142b163487745da74feb106f0765c16b | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L724-L733 | train | Converts a path in unix format to a unix format. | Of course, here is the Java code you requested:
```java
public static String path2unix(String path)
{
if(path == null) {
return null;
}
if(path.endsWith("/") || path.endsWith("\\")) {
path = path.substring(0, path.length() - 1);
}
return path.replaceAll("(^[a-zA-Z]\\:\\\\?)?\\... |
mgormley/prim | src/main/java_generated/edu/jhu/prim/vector/IntIntVectorSlice.java | IntIntVectorSlice.product | public void product(IntIntVector other) {
// TODO: Add special case for IntIntDenseVector.
for (int i=0; i<size; i++) {
elements[i + start] *= other.get(i);
}
} | java | public void product(IntIntVector other) {
// TODO: Add special case for IntIntDenseVector.
for (int i=0; i<size; i++) {
elements[i + start] *= other.get(i);
}
} | [
"public",
"void",
"product",
"(",
"IntIntVector",
"other",
")",
"{",
"// TODO: Add special case for IntIntDenseVector.",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"size",
";",
"i",
"++",
")",
"{",
"elements",
"[",
"i",
"+",
"start",
"]",
"*=",
"ot... | Updates this vector to be the entrywise product (i.e. Hadamard product) of this vector with the other. | [
"Updates",
"this",
"vector",
"to",
"be",
"the",
"entrywise",
"product",
"(",
"i",
".",
"e",
".",
"Hadamard",
"product",
")",
"of",
"this",
"vector",
"with",
"the",
"other",
"."
] | 5dce5e1ae94a9ae558a6262fc246e1a24f56686c | https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java_generated/edu/jhu/prim/vector/IntIntVectorSlice.java#L155-L160 | train | Product the elements of this vector with another vector. | Of course, here is the Java code you requested:
```java
public void product(IntIntVector other) {
// TODO: Add special case for IntIntDenseVector.
for (int i=0; i<size; i++) {
elements[i + start] *= other.get(i);
}
}
```
Hope this helps! |
sawano/java-commons | src/main/java/se/sawano/java/commons/lang/validate/Validate.java | Validate.matchesPattern | public static CharSequence matchesPattern(final CharSequence input, final String pattern, final String message, final Object... values) {
return INSTANCE.matchesPattern(input, pattern, message, values);
} | java | public static CharSequence matchesPattern(final CharSequence input, final String pattern, final String message, final Object... values) {
return INSTANCE.matchesPattern(input, pattern, message, values);
} | [
"public",
"static",
"CharSequence",
"matchesPattern",
"(",
"final",
"CharSequence",
"input",
",",
"final",
"String",
"pattern",
",",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"values",
")",
"{",
"return",
"INSTANCE",
".",
"matchesPattern",
"("... | <p>Validate that the specified argument character sequence matches the specified regular expression pattern; otherwise throwing an exception with the specified message.</p>
<pre>Validate.matchesPattern("hi", "[a-z]*", "%s does not match %s", "hi" "[a-z]*");</pre>
<p>The syntax of the pattern is the one used in the {@li... | [
"<p",
">",
"Validate",
"that",
"the",
"specified",
"argument",
"character",
"sequence",
"matches",
"the",
"specified",
"regular",
"expression",
"pattern",
";",
"otherwise",
"throwing",
"an",
"exception",
"with",
"the",
"specified",
"message",
".",
"<",
"/",
"p",... | 6f219c9e8dec4401dbe528d17ae6ec1ef9c0d284 | https://github.com/sawano/java-commons/blob/6f219c9e8dec4401dbe528d17ae6ec1ef9c0d284/src/main/java/se/sawano/java/commons/lang/validate/Validate.java#L1402-L1404 | train | Matches a CharSequence pattern. | Of course, here is the Java code you requested:
```java
public static CharSequence matchesPattern(final CharSequence input, final String pattern, final String message, final Object... values) {
return INSTANCE.matchesPattern(input, pattern, message, values);
}
```
Hope this helps! |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/lang/ArrayUtil.java | ArrayUtil.ensureCapacity | public static byte[] ensureCapacity(byte array[], int capacity){
if(capacity<=0 || capacity-array.length<=0)
return array;
int newCapacity = array.length*2;
if(newCapacity-capacity< 0)
newCapacity = capacity;
if(newCapacity<0){
if(capacity<0) // overf... | java | public static byte[] ensureCapacity(byte array[], int capacity){
if(capacity<=0 || capacity-array.length<=0)
return array;
int newCapacity = array.length*2;
if(newCapacity-capacity< 0)
newCapacity = capacity;
if(newCapacity<0){
if(capacity<0) // overf... | [
"public",
"static",
"byte",
"[",
"]",
"ensureCapacity",
"(",
"byte",
"array",
"[",
"]",
",",
"int",
"capacity",
")",
"{",
"if",
"(",
"capacity",
"<=",
"0",
"||",
"capacity",
"-",
"array",
".",
"length",
"<=",
"0",
")",
"return",
"array",
";",
"int",
... | /*-------------------------------------------------[ ensureCapacity ]--------------------------------------------------- | [
"/",
"*",
"-------------------------------------------------",
"[",
"ensureCapacity",
"]",
"---------------------------------------------------"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/ArrayUtil.java#L288-L301 | train | Ensure capacity of byte array. | Of course, here is the Java code you requested:
```java
public static byte[] ensureCapacity(byte array[], int capacity){
if(capacity<=0 || capacity-array.length<=0)
return array;
int newCapacity = array.length*2;
if(newCapacity-capacity< 0)
newCapacity = capacity;
... |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsFactoryFactoryImpl.java | JmsFactoryFactoryImpl.createQueue | @Override
public JmsQueue createQueue(String name) throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "createQueue", name);
JmsQueue queue = null;
// if name string is null, empty or just "queue://", throw exception
... | java | @Override
public JmsQueue createQueue(String name) throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "createQueue", name);
JmsQueue queue = null;
// if name string is null, empty or just "queue://", throw exception
... | [
"@",
"Override",
"public",
"JmsQueue",
"createQueue",
"(",
"String",
"name",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
... | This method is called by the application to create a jms administered
queue object. | [
"This",
"method",
"is",
"called",
"by",
"the",
"application",
"to",
"create",
"a",
"jms",
"administered",
"queue",
"object",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsFactoryFactoryImpl.java#L304-L336 | train | This method is called by the application to create a new instance of a JMS Queue. | Of course, here is the Java code you requested:
```java
@Override
public JmsQueue createQueue(String name) throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "createQueue", name);
JmsQueue queue = null;
// if name string... |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/MapTilePathModel.java | MapTilePathModel.getCategory | private String getCategory(String group)
{
for (final PathCategory category : categories.values())
{
if (category.getGroups().contains(group))
{
return category.getName();
}
}
return null;
} | java | private String getCategory(String group)
{
for (final PathCategory category : categories.values())
{
if (category.getGroups().contains(group))
{
return category.getName();
}
}
return null;
} | [
"private",
"String",
"getCategory",
"(",
"String",
"group",
")",
"{",
"for",
"(",
"final",
"PathCategory",
"category",
":",
"categories",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"category",
".",
"getGroups",
"(",
")",
".",
"contains",
"(",
"group",... | Get the group category.
@param group The group name.
@return The category name (<code>null</code> if undefined). | [
"Get",
"the",
"group",
"category",
"."
] | cac3d5578532cf11724a737b9f09e71bf9995ab2 | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/MapTilePathModel.java#L233-L243 | train | Gets the category name. | Of course, here is the Java code you requested:
```java
private String getCategory(String group)
{
for (final PathCategory category : categories.values())
{
if (category.getGroups().contains(group))
{
return category.getName();
}
}
... |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/model/ChemCompBond.java | ChemCompBond.getNumericalBondOrder | public int getNumericalBondOrder() {
if (value_order.equals("SING")) {
return 1;
} else if (value_order.equals("DOUB")) {
return 2;
} else if (value_order.equals("TRIP")) {
return 3;
} else if (value_order.equals("QUAD")) {
return 4;
} else {
logger.error("Unknown or non-numeric value for value... | java | public int getNumericalBondOrder() {
if (value_order.equals("SING")) {
return 1;
} else if (value_order.equals("DOUB")) {
return 2;
} else if (value_order.equals("TRIP")) {
return 3;
} else if (value_order.equals("QUAD")) {
return 4;
} else {
logger.error("Unknown or non-numeric value for value... | [
"public",
"int",
"getNumericalBondOrder",
"(",
")",
"{",
"if",
"(",
"value_order",
".",
"equals",
"(",
"\"SING\"",
")",
")",
"{",
"return",
"1",
";",
"}",
"else",
"if",
"(",
"value_order",
".",
"equals",
"(",
"\"DOUB\"",
")",
")",
"{",
"return",
"2",
... | Converts this ChemCompBond's value_order attribute into an int using the
conversion:
<pre>
SING -> 1
DOUB -> 2
TRIP -> 3
QUAD -> 4
</pre>
Any other values will return -1.
<p>
(Source:
http://mmcif.rcsb.org/dictionaries/mmcif_mdb.dic/Items/_chem_comp_bond.
value_order.html)
@return the numerical value of this ChemCom... | [
"Converts",
"this",
"ChemCompBond",
"s",
"value_order",
"attribute",
"into",
"an",
"int",
"using",
"the",
"conversion",
":"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/model/ChemCompBond.java#L118-L132 | train | Gets the numerical bond order. | Of course, here is the Java code you requested:
```java
public int getNumericalBondOrder() {
if (value_order.equals("SING")) {
return 1;
} else if (value_order.equals("DOUB")) {
return 2;
} else if (value_order.equals("TRIP")) {
return 3;
} else if (value_order.equals("QUAD")) {
return 4;
} else ... |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java | JobsImpl.getAsync | public ServiceFuture<CloudJob> getAsync(String jobId, JobGetOptions jobGetOptions, final ServiceCallback<CloudJob> serviceCallback) {
return ServiceFuture.fromHeaderResponse(getWithServiceResponseAsync(jobId, jobGetOptions), serviceCallback);
} | java | public ServiceFuture<CloudJob> getAsync(String jobId, JobGetOptions jobGetOptions, final ServiceCallback<CloudJob> serviceCallback) {
return ServiceFuture.fromHeaderResponse(getWithServiceResponseAsync(jobId, jobGetOptions), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"CloudJob",
">",
"getAsync",
"(",
"String",
"jobId",
",",
"JobGetOptions",
"jobGetOptions",
",",
"final",
"ServiceCallback",
"<",
"CloudJob",
">",
"serviceCallback",
")",
"{",
"return",
"ServiceFuture",
".",
"fromHeaderResponse",
"(",... | Gets information about the specified job.
@param jobId The ID of the job.
@param jobGetOptions Additional parameters for the operation
@param serviceCallback the async ServiceCallback to handle successful and failed responses.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link... | [
"Gets",
"information",
"about",
"the",
"specified",
"job",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java#L702-L704 | train | Gets a Cloud Job. Gets the details of a Cloud Job. | Of course, here is the Java code you requested:
```java
public ServiceFuture<CloudJob> getAsync(String jobId, JobGetOptions jobGetOptions, final ServiceCallback<CloudJob> serviceCallback) {
return ServiceFuture.fromHeaderResponse(getWithServiceResponseAsync(jobId, jobGetOptions), serviceCallback);
}
```
H... |
nextreports/nextreports-server | src/ro/nextreports/server/web/NextServerConfiguration.java | NextServerConfiguration.getConfiguration | public Configuration getConfiguration() {
if (configuration == null) {
try {
configuration = new PropertiesConfiguration(getClass().getResource("/nextserver.properties"));
} catch (ConfigurationException e) {
throw new RuntimeException(e);
}
}
return configuration;
} | java | public Configuration getConfiguration() {
if (configuration == null) {
try {
configuration = new PropertiesConfiguration(getClass().getResource("/nextserver.properties"));
} catch (ConfigurationException e) {
throw new RuntimeException(e);
}
}
return configuration;
} | [
"public",
"Configuration",
"getConfiguration",
"(",
")",
"{",
"if",
"(",
"configuration",
"==",
"null",
")",
"{",
"try",
"{",
"configuration",
"=",
"new",
"PropertiesConfiguration",
"(",
"getClass",
"(",
")",
".",
"getResource",
"(",
"\"/nextserver.properties\"",
... | used by StorageUpdate9 to put existing properties inside JCR | [
"used",
"by",
"StorageUpdate9",
"to",
"put",
"existing",
"properties",
"inside",
"JCR"
] | cfce12f5c6d52cb6a739388d50142c6e2e07c55e | https://github.com/nextreports/nextreports-server/blob/cfce12f5c6d52cb6a739388d50142c6e2e07c55e/src/ro/nextreports/server/web/NextServerConfiguration.java#L41-L50 | train | Gets the configuration. | Of course, here is the Java code you requested:
```java
public Configuration getConfiguration() {
if (configuration == null) {
try {
configuration = new PropertiesConfiguration(getClass().getResource("/nextserver.properties"));
} catch (ConfigurationException e) {
throw new RuntimeException(e);
}
... |
tstirrat/ucm-twine | src/main/java/org/ucmtwine/proxy/injector/BaseInjector.java | BaseInjector.enumerateClasses | public List<Class<?>> enumerateClasses(URL propertiesFile, String prefix) {
// find mapped service classes in service.properties
Properties properties = new Properties();
InputStream is = null;
try {
is = propertiesFile.openStream();
if (is != null) {
properties.load(is);
}
... | java | public List<Class<?>> enumerateClasses(URL propertiesFile, String prefix) {
// find mapped service classes in service.properties
Properties properties = new Properties();
InputStream is = null;
try {
is = propertiesFile.openStream();
if (is != null) {
properties.load(is);
}
... | [
"public",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"enumerateClasses",
"(",
"URL",
"propertiesFile",
",",
"String",
"prefix",
")",
"{",
"// find mapped service classes in service.properties",
"Properties",
"properties",
"=",
"new",
"Properties",
"(",
")",
";",
"I... | {@inheritDoc} | [
"{"
] | df53650f26c404c8de74ae06efa70c963933d4e9 | https://github.com/tstirrat/ucm-twine/blob/df53650f26c404c8de74ae06efa70c963933d4e9/src/main/java/org/ucmtwine/proxy/injector/BaseInjector.java#L20-L65 | valid | Enumerate classes from the properties file. | Of course, here is the Java code you requested:
```java
public List<Class<?>> enumerateClasses(URL propertiesFile, String prefix) {
// find mapped service classes in service.properties
Properties properties = new Properties();
InputStream is = null;
try {
is = propertiesFile.openStream();
... |
overturetool/overture | core/typechecker/src/main/java/org/overture/typechecker/visitor/TypeCheckerDefinitionVisitor.java | TypeCheckerDefinitionVisitor.setMeasureExp | private void setMeasureExp(TypeCheckInfo question, SFunctionDefinitionBase node, Environment base, Environment local, NameScope scope) throws AnalysisException
{
PType actual = node.getMeasure().apply(THIS, question.newInfo(local));
node.setMeasureName(node.getName().getMeasureName(node.getName().getLocation()));
... | java | private void setMeasureExp(TypeCheckInfo question, SFunctionDefinitionBase node, Environment base, Environment local, NameScope scope) throws AnalysisException
{
PType actual = node.getMeasure().apply(THIS, question.newInfo(local));
node.setMeasureName(node.getName().getMeasureName(node.getName().getLocation()));
... | [
"private",
"void",
"setMeasureExp",
"(",
"TypeCheckInfo",
"question",
",",
"SFunctionDefinitionBase",
"node",
",",
"Environment",
"base",
",",
"Environment",
"local",
",",
"NameScope",
"scope",
")",
"throws",
"AnalysisException",
"{",
"PType",
"actual",
"=",
"node",... | Set measureDef to a newly created function, based on the measure expression.
@throws AnalysisException | [
"Set",
"measureDef",
"to",
"a",
"newly",
"created",
"function",
"based",
"on",
"the",
"measure",
"expression",
"."
] | 83175dc6c24fa171cde4fcf61ecb648eba3bdbc1 | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/typechecker/src/main/java/org/overture/typechecker/visitor/TypeCheckerDefinitionVisitor.java#L1697-L1751 | train | Set the measure expression. | Of course, here is the Java code you requested:
```java
private void setMeasureExp(TypeCheckInfo question, SFunctionDefinitionBase node, Environment base, Environment local, NameScope scope) throws AnalysisException
{
PType actual = node.getMeasure().apply(THIS, question.newInfo(local));
node.setMeasureName(node.... |
Erudika/para | para-core/src/main/java/com/erudika/para/core/App.java | App.addDatatypes | public void addDatatypes(ParaObject... objects) {
// register a new data type
if (objects != null && objects.length > 0) {
for (ParaObject obj : objects) {
if (obj != null && obj.getType() != null) {
addDatatype(obj.getPlural(), obj.getType());
}
}
}
} | java | public void addDatatypes(ParaObject... objects) {
// register a new data type
if (objects != null && objects.length > 0) {
for (ParaObject obj : objects) {
if (obj != null && obj.getType() != null) {
addDatatype(obj.getPlural(), obj.getType());
}
}
}
} | [
"public",
"void",
"addDatatypes",
"(",
"ParaObject",
"...",
"objects",
")",
"{",
"// register a new data type",
"if",
"(",
"objects",
"!=",
"null",
"&&",
"objects",
".",
"length",
">",
"0",
")",
"{",
"for",
"(",
"ParaObject",
"obj",
":",
"objects",
")",
"{... | Adds unknown types to this app's list of data types. Called on create().
@param objects a list of new objects | [
"Adds",
"unknown",
"types",
"to",
"this",
"app",
"s",
"list",
"of",
"data",
"types",
".",
"Called",
"on",
"create",
"()",
"."
] | 5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9 | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/core/App.java#L899-L908 | train | Add a list of data types to the entity. | Of course, here is the Java code you requested:
```java
public void addDatatypes(ParaObject... objects) {
// register a new data type
if (objects != null && objects.length > 0) {
for (ParaObject obj : objects) {
if (obj != null && obj.getType() != null) {
addDatatype(obj.getPlural(), obj.getType());
... |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/engine/bcel/UnpackedCodeFactory.java | UnpackedCodeFactory.analyze | @Override
public UnpackedCode analyze(IAnalysisCache analysisCache, MethodDescriptor descriptor) throws CheckedAnalysisException {
Method method = getMethod(analysisCache, descriptor);
Code code = method.getCode();
if (code == null) {
return null;
}
byte[] instru... | java | @Override
public UnpackedCode analyze(IAnalysisCache analysisCache, MethodDescriptor descriptor) throws CheckedAnalysisException {
Method method = getMethod(analysisCache, descriptor);
Code code = method.getCode();
if (code == null) {
return null;
}
byte[] instru... | [
"@",
"Override",
"public",
"UnpackedCode",
"analyze",
"(",
"IAnalysisCache",
"analysisCache",
",",
"MethodDescriptor",
"descriptor",
")",
"throws",
"CheckedAnalysisException",
"{",
"Method",
"method",
"=",
"getMethod",
"(",
"analysisCache",
",",
"descriptor",
")",
";"... | /*
(non-Javadoc)
@see
edu.umd.cs.findbugs.classfile.IAnalysisEngine#analyze(edu.umd.cs.findbugs
.classfile.IAnalysisCache, java.lang.Object) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/engine/bcel/UnpackedCodeFactory.java#L49-L68 | train | Analyzes a method descriptor and returns the unpacked code of the method. | Of course, here is the Java code you requested:
```java
@Override
public UnpackedCode analyze(IAnalysisCache analysisCache, MethodDescriptor descriptor) throws CheckedAnalysisException {
Method method = getMethod(analysisCache, descriptor);
Code code = method.getCode();
if (code == null) {
... |
UrielCh/ovh-java-sdk | ovh-java-sdk-saascsp2/src/main/java/net/minidev/ovh/api/ApiOvhSaascsp2.java | ApiOvhSaascsp2.serviceName_changeAdministratorPassword_POST | public OvhOfficeTask serviceName_changeAdministratorPassword_POST(String serviceName, String newPassword) throws IOException {
String qPath = "/saas/csp2/{serviceName}/changeAdministratorPassword";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, ... | java | public OvhOfficeTask serviceName_changeAdministratorPassword_POST(String serviceName, String newPassword) throws IOException {
String qPath = "/saas/csp2/{serviceName}/changeAdministratorPassword";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, ... | [
"public",
"OvhOfficeTask",
"serviceName_changeAdministratorPassword_POST",
"(",
"String",
"serviceName",
",",
"String",
"newPassword",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/saas/csp2/{serviceName}/changeAdministratorPassword\"",
";",
"StringBuilder",
"s... | Changes the tenant administrator's password
REST: POST /saas/csp2/{serviceName}/changeAdministratorPassword
@param newPassword [required] New password for the tenant administrator
@param serviceName [required] The unique identifier of your Office service
API beta | [
"Changes",
"the",
"tenant",
"administrator",
"s",
"password"
] | 6d531a40e56e09701943e334c25f90f640c55701 | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-saascsp2/src/main/java/net/minidev/ovh/api/ApiOvhSaascsp2.java#L254-L261 | train | Change the Administrator password | Of course, here is the Java code you requested:
```java
public OvhOfficeTask serviceName_changeAdministratorPassword_POST(String serviceName, String newPassword) throws IOException {
String qPath = "/saas/csp2/{serviceName}/changeAdministratorPassword";
StringBuilder sb = path(qPath, serviceName);
HashMap<String... |
the-fascinator/plugin-indexer-solr | src/main/java/com/googlecode/fascinator/indexer/SolrIndexer.java | SolrIndexer.indexByGroovyScript | private String indexByGroovyScript(DigitalObject object, Payload payload, String confOid, String rulesOid,
Properties props) throws RuleException {
try {
if (engine == null) {
SimpleBindings bindings = new SimpleBindings();
ScriptEngineManager manager = new ScriptEngineManager();
engine = manager.g... | java | private String indexByGroovyScript(DigitalObject object, Payload payload, String confOid, String rulesOid,
Properties props) throws RuleException {
try {
if (engine == null) {
SimpleBindings bindings = new SimpleBindings();
ScriptEngineManager manager = new ScriptEngineManager();
engine = manager.g... | [
"private",
"String",
"indexByGroovyScript",
"(",
"DigitalObject",
"object",
",",
"Payload",
"payload",
",",
"String",
"confOid",
",",
"String",
"rulesOid",
",",
"Properties",
"props",
")",
"throws",
"RuleException",
"{",
"try",
"{",
"if",
"(",
"engine",
"==",
... | Index a payload using the provided data using a groovy script
@param object
: The DigitalObject to index
@param payload
: The Payload to index
@param in
: Reader containing the new empty document
@param inConf
: An InputStream holding the config file
@param rulesOid
: The oid of the rules file to use
@param props
: Pr... | [
"Index",
"a",
"payload",
"using",
"the",
"provided",
"data",
"using",
"a",
"groovy",
"script"
] | 001159b18b78a87daa5d8b2a17ced28694bae156 | https://github.com/the-fascinator/plugin-indexer-solr/blob/001159b18b78a87daa5d8b2a17ced28694bae156/src/main/java/com/googlecode/fascinator/indexer/SolrIndexer.java#L723-L766 | train | Index by groovy script | Of course, here is the Java code you requested:
```java
private String indexByGroovyScript(DigitalObject object, Payload payload, String confOid, String rulesOid,
Properties props) throws RuleException {
try {
if (engine == null) {
SimpleBindings bindings = new SimpleBindings();
ScriptEngineManager ma... |
jbossws/jbossws-common | src/main/java/org/jboss/ws/common/injection/resolvers/ResourceReferenceResolver.java | ResourceReferenceResolver.resolveMethod | @Override
protected String resolveMethod(Method method)
{
final String fallBackName = convertToBeanName(method.getName());
final String resourceName = method.getAnnotation(Resource.class).name();
return getName(resourceName, fallBackName);
} | java | @Override
protected String resolveMethod(Method method)
{
final String fallBackName = convertToBeanName(method.getName());
final String resourceName = method.getAnnotation(Resource.class).name();
return getName(resourceName, fallBackName);
} | [
"@",
"Override",
"protected",
"String",
"resolveMethod",
"(",
"Method",
"method",
")",
"{",
"final",
"String",
"fallBackName",
"=",
"convertToBeanName",
"(",
"method",
".",
"getName",
"(",
")",
")",
";",
"final",
"String",
"resourceName",
"=",
"method",
".",
... | /* (non-Javadoc)
@see org.jboss.ws.common.injection.resolvers.AbstractReferenceResolver#resolveMethod(java.lang.reflect.Method) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | fcff8a3ef9bfe046d6fa8c855a3fe4f62841add7 | https://github.com/jbossws/jbossws-common/blob/fcff8a3ef9bfe046d6fa8c855a3fe4f62841add7/src/main/java/org/jboss/ws/common/injection/resolvers/ResourceReferenceResolver.java#L61-L68 | train | Resolves a method name to a resource name. | Of course, here is the Java code you requested:
```java
@Override
protected String resolveMethod(Method method)
{
final String fallBackName = convertToBeanName(method.getName());
final String resourceName = method.getAnnotation(Resource.class).name();
return getName(resourceName, fallBackName... |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.getCompleteThrough | public Date getCompleteThrough()
{
Date value = (Date) getCachedValue(TaskField.COMPLETE_THROUGH);
if (value == null)
{
int percentComplete = NumberHelper.getInt(getPercentageComplete());
switch (percentComplete)
{
case 0:
{
break;
... | java | public Date getCompleteThrough()
{
Date value = (Date) getCachedValue(TaskField.COMPLETE_THROUGH);
if (value == null)
{
int percentComplete = NumberHelper.getInt(getPercentageComplete());
switch (percentComplete)
{
case 0:
{
break;
... | [
"public",
"Date",
"getCompleteThrough",
"(",
")",
"{",
"Date",
"value",
"=",
"(",
"Date",
")",
"getCachedValue",
"(",
"TaskField",
".",
"COMPLETE_THROUGH",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"int",
"percentComplete",
"=",
"NumberHelper",
... | Retrieve the "complete through" date.
@return complete through date | [
"Retrieve",
"the",
"complete",
"through",
"date",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L4215-L4252 | train | Get the complete through value. | Of course, here is the Java code you requested:
```java
public Date getCompleteThrough()
{
Date value = (Date) getCachedValue(TaskField.COMPLETE_THROUGH);
if (value == null)
{
int percentComplete = NumberHelper.getInt(getPercentageComplete());
switch (percentComplete)
{
... |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionGroupVertex.java | ExecutionGroupVertex.addInitialSubtask | void addInitialSubtask(final ExecutionVertex ev) {
if (ev == null) {
throw new IllegalArgumentException("Argument ev must not be null");
}
if (this.initialGroupMemberAdded.compareAndSet(false, true)) {
this.groupMembers.add(ev);
}
} | java | void addInitialSubtask(final ExecutionVertex ev) {
if (ev == null) {
throw new IllegalArgumentException("Argument ev must not be null");
}
if (this.initialGroupMemberAdded.compareAndSet(false, true)) {
this.groupMembers.add(ev);
}
} | [
"void",
"addInitialSubtask",
"(",
"final",
"ExecutionVertex",
"ev",
")",
"{",
"if",
"(",
"ev",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Argument ev must not be null\"",
")",
";",
"}",
"if",
"(",
"this",
".",
"initialGroupMember... | Adds the initial execution vertex to this group vertex.
@param ev
The new execution vertex to be added. | [
"Adds",
"the",
"initial",
"execution",
"vertex",
"to",
"this",
"group",
"vertex",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionGroupVertex.java#L279-L288 | train | Adds an initial subtask to this execution vertex. | Of course, here is the Java code you requested:
```java
void addInitialSubtask(final ExecutionVertex ev) {
if (ev == null) {
throw new IllegalArgumentException("Argument ev must not be null");
}
if (this.initialGroupMemberAdded.compareAndSet(false, true)) {
this.groupMembers.add(ev);
}
}
```
Hope thi... |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/StrictMath.java | StrictMath.floorOrCeil | private static double floorOrCeil(double a,
double negativeBoundary,
double positiveBoundary,
double sign) {
int exponent = Math.getExponent(a);
if (exponent < 0) {
/*
... | java | private static double floorOrCeil(double a,
double negativeBoundary,
double positiveBoundary,
double sign) {
int exponent = Math.getExponent(a);
if (exponent < 0) {
/*
... | [
"private",
"static",
"double",
"floorOrCeil",
"(",
"double",
"a",
",",
"double",
"negativeBoundary",
",",
"double",
"positiveBoundary",
",",
"double",
"sign",
")",
"{",
"int",
"exponent",
"=",
"Math",
".",
"getExponent",
"(",
"a",
")",
";",
"if",
"(",
"exp... | Internal method to share logic between floor and ceil.
@param a the value to be floored or ceiled
@param negativeBoundary result for values in (-1, 0)
@param positiveBoundary result for values in (0, 1)
@param increment value to add when the argument is non-integral | [
"Internal",
"method",
"to",
"share",
"logic",
"between",
"floor",
"and",
"ceil",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/StrictMath.java#L370-L405 | train | Floor or ceiling. | Of course, here is the Java code you requested:
```java
private static double floorOrCeil(double a,
double negativeBoundary,
double positiveBoundary,
double sign) {
int exponent = Math.getExponent(... |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java | PackageIndexFrameWriter.addAllClassesLink | protected void addAllClassesLink(Content ul) {
Content linkContent = getHyperLink(DocPaths.ALLCLASSES_FRAME,
allclassesLabel, "", "packageFrame");
Content li = HtmlTree.LI(linkContent);
ul.addContent(li);
} | java | protected void addAllClassesLink(Content ul) {
Content linkContent = getHyperLink(DocPaths.ALLCLASSES_FRAME,
allclassesLabel, "", "packageFrame");
Content li = HtmlTree.LI(linkContent);
ul.addContent(li);
} | [
"protected",
"void",
"addAllClassesLink",
"(",
"Content",
"ul",
")",
"{",
"Content",
"linkContent",
"=",
"getHyperLink",
"(",
"DocPaths",
".",
"ALLCLASSES_FRAME",
",",
"allclassesLabel",
",",
"\"\"",
",",
"\"packageFrame\"",
")",
";",
"Content",
"li",
"=",
"Html... | Adds "All Classes" link for the top of the left-hand frame page to the
documentation tree.
@param ul the Content object to which the "All Classes" link should be added | [
"Adds",
"All",
"Classes",
"link",
"for",
"the",
"top",
"of",
"the",
"left",
"-",
"hand",
"frame",
"page",
"to",
"the",
"documentation",
"tree",
"."
] | a53d069bbdb2c60232ed3811c19b65e41c3e60e0 | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java#L154-L159 | train | Adds the allclasses link. | Of course, here is the Java code you requested:
```java
protected void addAllClassesLink(Content ul) {
Content linkContent = getHyperLink(DocPaths.ALLCLASSES_FRAME,
allclassesLabel, "", "packageFrame");
Content li = HtmlTree.LI(linkContent);
ul.addContent(li);
}
```
Hope th... |
Microsoft/azure-spring-boot | azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/aad/AADAuthenticationFilterAutoConfiguration.java | AADAuthenticationFilterAutoConfiguration.azureADJwtTokenFilter | @Bean
@Scope(BeanDefinition.SCOPE_SINGLETON)
@ConditionalOnMissingBean(AADAuthenticationFilter.class)
public AADAuthenticationFilter azureADJwtTokenFilter() {
LOG.info("AzureADJwtTokenFilter Constructor.");
return new AADAuthenticationFilter(aadAuthProps, serviceEndpointsProps, getJWTResourc... | java | @Bean
@Scope(BeanDefinition.SCOPE_SINGLETON)
@ConditionalOnMissingBean(AADAuthenticationFilter.class)
public AADAuthenticationFilter azureADJwtTokenFilter() {
LOG.info("AzureADJwtTokenFilter Constructor.");
return new AADAuthenticationFilter(aadAuthProps, serviceEndpointsProps, getJWTResourc... | [
"@",
"Bean",
"@",
"Scope",
"(",
"BeanDefinition",
".",
"SCOPE_SINGLETON",
")",
"@",
"ConditionalOnMissingBean",
"(",
"AADAuthenticationFilter",
".",
"class",
")",
"public",
"AADAuthenticationFilter",
"azureADJwtTokenFilter",
"(",
")",
"{",
"LOG",
".",
"info",
"(",
... | Declare AADAuthenticationFilter bean.
@return AADAuthenticationFilter bean | [
"Declare",
"AADAuthenticationFilter",
"bean",
"."
] | 53d69d44587b483247a5108452145cd426fcf78c | https://github.com/Microsoft/azure-spring-boot/blob/53d69d44587b483247a5108452145cd426fcf78c/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/aad/AADAuthenticationFilterAutoConfiguration.java#L54-L60 | valid | AzureADJwtTokenFilter constructor. | Of course, here is the Java code you requested:
```java
@Bean
@Scope(BeanDefinition.SCOPE_SINGLETON)
@ConditionalOnMissingBean(AADAuthenticationFilter.class)
public AADAuthenticationFilter azureADJwtTokenFilter() {
LOG.info("AzureADJwtTokenFilter Constructor.");
return new AADAuthentication... |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/RecommendationsInner.java | RecommendationsInner.getRuleDetailsByWebAppAsync | public ServiceFuture<RecommendationRuleInner> getRuleDetailsByWebAppAsync(String resourceGroupName, String siteName, String name, final ServiceCallback<RecommendationRuleInner> serviceCallback) {
return ServiceFuture.fromResponse(getRuleDetailsByWebAppWithServiceResponseAsync(resourceGroupName, siteName, name),... | java | public ServiceFuture<RecommendationRuleInner> getRuleDetailsByWebAppAsync(String resourceGroupName, String siteName, String name, final ServiceCallback<RecommendationRuleInner> serviceCallback) {
return ServiceFuture.fromResponse(getRuleDetailsByWebAppWithServiceResponseAsync(resourceGroupName, siteName, name),... | [
"public",
"ServiceFuture",
"<",
"RecommendationRuleInner",
">",
"getRuleDetailsByWebAppAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"siteName",
",",
"String",
"name",
",",
"final",
"ServiceCallback",
"<",
"RecommendationRuleInner",
">",
"serviceCallback",
")... | Get a recommendation rule for an app.
Get a recommendation rule for an app.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Name of the app.
@param name Name of the recommendation.
@param serviceCallback the async ServiceCallback to handle successful and failed respon... | [
"Get",
"a",
"recommendation",
"rule",
"for",
"an",
"app",
".",
"Get",
"a",
"recommendation",
"rule",
"for",
"an",
"app",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/RecommendationsInner.java#L1225-L1227 | train | Gets the rule details for a CDN recommendation rule. | Of course, here is the Java code you requested:
```java
public ServiceFuture<RecommendationRuleInner> getRuleDetailsByWebAppAsync(String resourceGroupName, String siteName, String name, final ServiceCallback<RecommendationRuleInner> serviceCallback) {
return ServiceFuture.fromResponse(getRuleDetailsByWebAppWit... |
kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/HttpSmartProxyHandler.java | HttpSmartProxyHandler.handleResponse | @Override
public void handleResponse(final HttpProxyResponse response)
throws ProxyAuthException {
if (!isHandshakeComplete()
&& ("close".equalsIgnoreCase(StringUtilities
.getSingleValuedHeader(response.getHeaders(),
"Proxy-... | java | @Override
public void handleResponse(final HttpProxyResponse response)
throws ProxyAuthException {
if (!isHandshakeComplete()
&& ("close".equalsIgnoreCase(StringUtilities
.getSingleValuedHeader(response.getHeaders(),
"Proxy-... | [
"@",
"Override",
"public",
"void",
"handleResponse",
"(",
"final",
"HttpProxyResponse",
"response",
")",
"throws",
"ProxyAuthException",
"{",
"if",
"(",
"!",
"isHandshakeComplete",
"(",
")",
"&&",
"(",
"\"close\"",
".",
"equalsIgnoreCase",
"(",
"StringUtilities",
... | Handle a HTTP response from the proxy server.
@param response The proxy response. | [
"Handle",
"a",
"HTTP",
"response",
"from",
"the",
"proxy",
"server",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/HttpSmartProxyHandler.java#L193-L215 | train | Handle response. | Of course, here is the Java code you requested:
```java
@Override
public void handleResponse(final HttpProxyResponse response)
throws ProxyAuthException {
if (!isHandshakeComplete()
&& ("close".equalsIgnoreCase(StringUtilities
.getSingleValuedHeader(respo... |
mabe02/lanterna | src/main/java/com/googlecode/lanterna/terminal/ansi/StreamBasedTerminal.java | StreamBasedTerminal.putCharacter | @Override
public void putCharacter(char c) throws IOException {
if(TerminalTextUtils.isPrintableCharacter(c)) {
writeToTerminal(translateCharacter(c));
}
} | java | @Override
public void putCharacter(char c) throws IOException {
if(TerminalTextUtils.isPrintableCharacter(c)) {
writeToTerminal(translateCharacter(c));
}
} | [
"@",
"Override",
"public",
"void",
"putCharacter",
"(",
"char",
"c",
")",
"throws",
"IOException",
"{",
"if",
"(",
"TerminalTextUtils",
".",
"isPrintableCharacter",
"(",
"c",
")",
")",
"{",
"writeToTerminal",
"(",
"translateCharacter",
"(",
"c",
")",
")",
";... | {@inheritDoc}
The {@code StreamBasedTerminal} class will attempt to translate some unicode characters to VT100 if the encoding
attached to this {@code Terminal} isn't UTF-8. | [
"{",
"@inheritDoc",
"}"
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/terminal/ansi/StreamBasedTerminal.java#L89-L94 | train | Puts a character into the output stream. | Of course, here is the Java code you requested:
```java
@Override
public void putCharacter(char c) throws IOException {
if(TerminalTextUtils.isPrintableCharacter(c)) {
writeToTerminal(translateCharacter(c));
}
}
```
Hope this helps! |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.