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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
biojava/biojava | biojava-alignment/src/main/java/org/biojava/nbio/alignment/Alignments.java | Alignments.getAllPairsAlignments | public static <S extends Sequence<C>, C extends Compound> List<SequencePair<S, C>> getAllPairsAlignments(
List<S> sequences, PairwiseSequenceAlignerType type, GapPenalty gapPenalty,
SubstitutionMatrix<C> subMatrix) {
return runPairwiseAligners(getAllPairsAligners(sequences, type, gapPenalty, subMatrix));
} | java | public static <S extends Sequence<C>, C extends Compound> List<SequencePair<S, C>> getAllPairsAlignments(
List<S> sequences, PairwiseSequenceAlignerType type, GapPenalty gapPenalty,
SubstitutionMatrix<C> subMatrix) {
return runPairwiseAligners(getAllPairsAligners(sequences, type, gapPenalty, subMatrix));
} | [
"public",
"static",
"<",
"S",
"extends",
"Sequence",
"<",
"C",
">",
",",
"C",
"extends",
"Compound",
">",
"List",
"<",
"SequencePair",
"<",
"S",
",",
"C",
">",
">",
"getAllPairsAlignments",
"(",
"List",
"<",
"S",
">",
"sequences",
",",
"PairwiseSequenceA... | Factory method which computes a sequence alignment for all {@link Sequence} pairs in the given {@link List}.
This method runs the alignments in parallel by submitting all of the alignments to the shared thread pool of the
{@link ConcurrencyTools} utility.
@param <S> each {@link Sequence} of an alignment pair is of typ... | [
"Factory",
"method",
"which",
"computes",
"a",
"sequence",
"alignment",
"for",
"all",
"{",
"@link",
"Sequence",
"}",
"pairs",
"in",
"the",
"given",
"{",
"@link",
"List",
"}",
".",
"This",
"method",
"runs",
"the",
"alignments",
"in",
"parallel",
"by",
"subm... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/Alignments.java#L132-L136 | train | Get all pairs alignments from the given sequence using the given alignment type and substitution matrix. | Of course, here is the Java code you requested:
```java
public static <S extends Sequence<C>, C extends Compound> List<SequencePair<S, C>> getAllPairsAlignments(
List<S> sequences, PairwiseSequenceAlignerType type, GapPenalty gapPenalty,
SubstitutionMatrix<C> subMatrix) {
return runPairwiseAligners(getAllPairs... |
alkacon/opencms-core | src/org/opencms/ui/apps/user/CmsUserEditDialog.java | CmsUserEditDialog.iniStartView | void iniStartView(CmsUserSettings settings) {
IndexedContainer container = getStartViewContainer("caption");
if (container.size() > 0) {
m_startview.setEnabled(true);
m_startview.setContainerDataSource(container);
m_startview.setItemCaptionPropertyId("caption");
... | java | void iniStartView(CmsUserSettings settings) {
IndexedContainer container = getStartViewContainer("caption");
if (container.size() > 0) {
m_startview.setEnabled(true);
m_startview.setContainerDataSource(container);
m_startview.setItemCaptionPropertyId("caption");
... | [
"void",
"iniStartView",
"(",
"CmsUserSettings",
"settings",
")",
"{",
"IndexedContainer",
"container",
"=",
"getStartViewContainer",
"(",
"\"caption\"",
")",
";",
"if",
"(",
"container",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"m_startview",
".",
"setEnable... | Initializes the start view.<p>
@param settings user settings | [
"Initializes",
"the",
"start",
"view",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/user/CmsUserEditDialog.java#L990-L1008 | train | Inits the start view. | Of course, here is the Java code you requested:
```java
void iniStartView(CmsUserSettings settings) {
IndexedContainer container = getStartViewContainer("caption");
if (container.size() > 0) {
m_startview.setEnabled(true);
m_startview.setContainerDataSource(container);
... |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WBeanComponent.java | WBeanComponent.getData | @Override
public Object getData() {
BeanAndProviderBoundComponentModel model = getComponentModel();
Object data = model.getData();
String beanProperty = getBeanProperty();
if (beanProperty != null) {
Object sharedData = ((BeanAndProviderBoundComponentModel) getDefaultModel()).getData();
if (!isFlagSet(... | java | @Override
public Object getData() {
BeanAndProviderBoundComponentModel model = getComponentModel();
Object data = model.getData();
String beanProperty = getBeanProperty();
if (beanProperty != null) {
Object sharedData = ((BeanAndProviderBoundComponentModel) getDefaultModel()).getData();
if (!isFlagSet(... | [
"@",
"Override",
"public",
"Object",
"getData",
"(",
")",
"{",
"BeanAndProviderBoundComponentModel",
"model",
"=",
"getComponentModel",
"(",
")",
";",
"Object",
"data",
"=",
"model",
".",
"getData",
"(",
")",
";",
"String",
"beanProperty",
"=",
"getBeanProperty"... | Returns the data for this component. The following are searched in order:
<ul>
<li>a value set explicitly in the ui context using {@link #setData(Object)};</li>
<li>if a bean is available; the bean's value; or</li>
<li>the value set on the shared model.</li>
</ul>
@return the current value of this component for the gi... | [
"Returns",
"the",
"data",
"for",
"this",
"component",
".",
"The",
"following",
"are",
"searched",
"in",
"order",
":",
"<ul",
">",
"<li",
">",
"a",
"value",
"set",
"explicitly",
"in",
"the",
"ui",
"context",
"using",
"{",
"@link",
"#setData",
"(",
"Object... | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WBeanComponent.java#L246-L265 | train | Returns the data of the component. | Of course, here is the Java code you requested:
```java
@Override
public Object getData() {
BeanAndProviderBoundComponentModel model = getComponentModel();
Object data = model.getData();
String beanProperty = getBeanProperty();
if (beanProperty != null) {
Object sharedData = ((BeanAndProviderBoundComponen... |
atomix/copycat | server/src/main/java/io/atomix/copycat/server/state/AbstractAppender.java | AbstractAppender.handleAppendResponseFailure | protected void handleAppendResponseFailure(MemberState member, AppendRequest request, Throwable error) {
// Log the failed attempt to contact the member.
failAttempt(member, error);
} | java | protected void handleAppendResponseFailure(MemberState member, AppendRequest request, Throwable error) {
// Log the failed attempt to contact the member.
failAttempt(member, error);
} | [
"protected",
"void",
"handleAppendResponseFailure",
"(",
"MemberState",
"member",
",",
"AppendRequest",
"request",
",",
"Throwable",
"error",
")",
"{",
"// Log the failed attempt to contact the member.",
"failAttempt",
"(",
"member",
",",
"error",
")",
";",
"}"
] | Handles an append failure. | [
"Handles",
"an",
"append",
"failure",
"."
] | c90b88ccd5c63d6ea0b49fb77c25e2f3272a7b10 | https://github.com/atomix/copycat/blob/c90b88ccd5c63d6ea0b49fb77c25e2f3272a7b10/server/src/main/java/io/atomix/copycat/server/state/AbstractAppender.java#L233-L236 | train | Handle append response failure. | Of course, here is the Java code you requested:
```java
protected void handleAppendResponseFailure(MemberState member, AppendRequest request, Throwable error) {
// Log the failed attempt to contact the member.
failAttempt(member, error);
}
```
Hope this helps! |
aws/aws-sdk-java | aws-java-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/IndexFacesResult.java | IndexFacesResult.withFaceRecords | public IndexFacesResult withFaceRecords(FaceRecord... faceRecords) {
if (this.faceRecords == null) {
setFaceRecords(new java.util.ArrayList<FaceRecord>(faceRecords.length));
}
for (FaceRecord ele : faceRecords) {
this.faceRecords.add(ele);
}
return this;
... | java | public IndexFacesResult withFaceRecords(FaceRecord... faceRecords) {
if (this.faceRecords == null) {
setFaceRecords(new java.util.ArrayList<FaceRecord>(faceRecords.length));
}
for (FaceRecord ele : faceRecords) {
this.faceRecords.add(ele);
}
return this;
... | [
"public",
"IndexFacesResult",
"withFaceRecords",
"(",
"FaceRecord",
"...",
"faceRecords",
")",
"{",
"if",
"(",
"this",
".",
"faceRecords",
"==",
"null",
")",
"{",
"setFaceRecords",
"(",
"new",
"java",
".",
"util",
".",
"ArrayList",
"<",
"FaceRecord",
">",
"(... | <p>
An array of faces detected and added to the collection. For more information, see Searching Faces in a Collection
in the Amazon Rekognition Developer Guide.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setFaceRecords(java.util.Collection)} or {@link #withFaceRecord... | [
"<p",
">",
"An",
"array",
"of",
"faces",
"detected",
"and",
"added",
"to",
"the",
"collection",
".",
"For",
"more",
"information",
"see",
"Searching",
"Faces",
"in",
"a",
"Collection",
"in",
"the",
"Amazon",
"Rekognition",
"Developer",
"Guide",
".",
"<",
"... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/IndexFacesResult.java#L129-L137 | train | A list of face records. | Of course, here is the Java code you requested:
```java
public IndexFacesResult withFaceRecords(FaceRecord... faceRecords) {
if (this.faceRecords == null) {
setFaceRecords(new java.util.ArrayList<FaceRecord>(faceRecords.length));
}
for (FaceRecord ele : faceRecords) {
th... |
nextreports/nextreports-engine | src/ro/nextreports/engine/chart/JFreeChartExporter.java | JFreeChartExporter.addLineChartOverBar | private JFreeChart addLineChartOverBar(JFreeChart jfreechart, Object[] lineCharts, String lineLegend) throws QueryException {
// first we read data for bar series, so we have to go back at the start of the result set
try {
result.getResultSet().beforeFirst();
} catch (SQLException e) {
// TODO Auto-generate... | java | private JFreeChart addLineChartOverBar(JFreeChart jfreechart, Object[] lineCharts, String lineLegend) throws QueryException {
// first we read data for bar series, so we have to go back at the start of the result set
try {
result.getResultSet().beforeFirst();
} catch (SQLException e) {
// TODO Auto-generate... | [
"private",
"JFreeChart",
"addLineChartOverBar",
"(",
"JFreeChart",
"jfreechart",
",",
"Object",
"[",
"]",
"lineCharts",
",",
"String",
"lineLegend",
")",
"throws",
"QueryException",
"{",
"// first we read data for bar series, so we have to go back at the start of the result set",... | see http://www.java2s.com/Code/Java/Chart/JFreeChartOverlaidBarChartDemo.htm | [
"see",
"http",
":",
"//",
"www",
".",
"java2s",
".",
"com",
"/",
"Code",
"/",
"Java",
"/",
"Chart",
"/",
"JFreeChartOverlaidBarChartDemo",
".",
"htm"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/chart/JFreeChartExporter.java#L605-L662 | train | Add a line chart over the bar. | Of course, here is the Java code you requested:
```java
private JFreeChart addLineChartOverBar(JFreeChart jfreechart, Object[] lineCharts, String lineLegend) throws QueryException {
// first we read data for bar series, so we have to go back at the start of the result set
try {
result.getResultSet().beforeFirst... |
Azure/azure-storage-android | microsoft-azure-storage/src/com/microsoft/azure/storage/AccessCondition.java | AccessCondition.generateIfSequenceNumberLessThanCondition | public static AccessCondition generateIfSequenceNumberLessThanCondition(long sequenceNumber) {
AccessCondition retCondition = new AccessCondition();
retCondition.ifSequenceNumberLessThan = sequenceNumber;
return retCondition;
} | java | public static AccessCondition generateIfSequenceNumberLessThanCondition(long sequenceNumber) {
AccessCondition retCondition = new AccessCondition();
retCondition.ifSequenceNumberLessThan = sequenceNumber;
return retCondition;
} | [
"public",
"static",
"AccessCondition",
"generateIfSequenceNumberLessThanCondition",
"(",
"long",
"sequenceNumber",
")",
"{",
"AccessCondition",
"retCondition",
"=",
"new",
"AccessCondition",
"(",
")",
";",
"retCondition",
".",
"ifSequenceNumberLessThan",
"=",
"sequenceNumbe... | Returns an access condition such that an operation will be performed only if resource's current sequence
number is less than the specified value. This condition only applies to page blobs.
@param sequenceNumber
The value to compare to the current sequence number.
@return An <code>AccessCondition</code> object that re... | [
"Returns",
"an",
"access",
"condition",
"such",
"that",
"an",
"operation",
"will",
"be",
"performed",
"only",
"if",
"resource",
"s",
"current",
"sequence",
"number",
"is",
"less",
"than",
"the",
"specified",
"value",
".",
"This",
"condition",
"only",
"applies"... | 2c643c37c6b8c9081058add284c601a2393afc93 | https://github.com/Azure/azure-storage-android/blob/2c643c37c6b8c9081058add284c601a2393afc93/microsoft-azure-storage/src/com/microsoft/azure/storage/AccessCondition.java#L151-L155 | valid | Generate an AccessCondition object that will return true if the sequence number is less than the specified sequence number. | Of course, here is the Java code you requested:
```java
public static AccessCondition generateIfSequenceNumberLessThanCondition(long sequenceNumber) {
AccessCondition retCondition = new AccessCondition();
retCondition.ifSequenceNumberLessThan = sequenceNumber;
return retCondition;
}
```
Ho... |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfPKCS7.java | PdfPKCS7.getDigest | public static String getDigest(String oid) {
String ret = (String)digestNames.get(oid);
if (ret == null)
return oid;
else
return ret;
} | java | public static String getDigest(String oid) {
String ret = (String)digestNames.get(oid);
if (ret == null)
return oid;
else
return ret;
} | [
"public",
"static",
"String",
"getDigest",
"(",
"String",
"oid",
")",
"{",
"String",
"ret",
"=",
"(",
"String",
")",
"digestNames",
".",
"get",
"(",
"oid",
")",
";",
"if",
"(",
"ret",
"==",
"null",
")",
"return",
"oid",
";",
"else",
"return",
"ret",
... | Gets the digest name for a certain id
@param oid an id (for instance "1.2.840.113549.2.5")
@return a digest name (for instance "MD5")
@since 2.1.6 | [
"Gets",
"the",
"digest",
"name",
"for",
"a",
"certain",
"id"
] | 438fc1899367fd13dfdfa8dfdca9a3c1a7783b84 | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfPKCS7.java#L258-L264 | train | Get the digest name for the given oid. | Of course, here is the Java code you requested:
```java
public static String getDigest(String oid) {
String ret = (String)digestNames.get(oid);
if (ret == null)
return oid;
else
return ret;
}
```
Hope this helps! |
zalando-stups/fullstop | fullstop/src/main/java/org/zalando/stups/fullstop/config/OAuth2Configuration.java | OAuth2Configuration.configure | @Override
public void configure(final HttpSecurity http) throws Exception {
http.sessionManagement().sessionCreationPolicy(NEVER)
// configure form login
.and().formLogin().disable()
// configure logout
.logout().disable()
.authorizeReq... | java | @Override
public void configure(final HttpSecurity http) throws Exception {
http.sessionManagement().sessionCreationPolicy(NEVER)
// configure form login
.and().formLogin().disable()
// configure logout
.logout().disable()
.authorizeReq... | [
"@",
"Override",
"public",
"void",
"configure",
"(",
"final",
"HttpSecurity",
"http",
")",
"throws",
"Exception",
"{",
"http",
".",
"sessionManagement",
"(",
")",
".",
"sessionCreationPolicy",
"(",
"NEVER",
")",
"// configure form login",
".",
"and",
"(",
")",
... | Configure scopes for specific controller/httpmethods/roles here. | [
"Configure",
"scopes",
"for",
"specific",
"controller",
"/",
"httpmethods",
"/",
"roles",
"here",
"."
] | 42f3bab557380aab0114028b58d745e3000897e8 | https://github.com/zalando-stups/fullstop/blob/42f3bab557380aab0114028b58d745e3000897e8/fullstop/src/main/java/org/zalando/stups/fullstop/config/OAuth2Configuration.java#L37-L57 | test | Configure the application. | Of course, here is the Java code you requested:
```java
@Override
public void configure(final HttpSecurity http) throws Exception {
http.sessionManagement().sessionCreationPolicy(NEVER)
// configure form login
.and().formLogin().disable()
// configure logout
... |
GoogleCloudPlatform/app-maven-plugin | src/main/java/com/google/cloud/tools/maven/deploy/AppDeployer.java | AppDeployer.deploy | public void deploy() throws MojoExecutionException {
stager.stage();
DeployConfiguration config =
configBuilder.buildDeployConfiguration(ImmutableList.of(deployMojo.getStagingDirectory()));
try {
deployMojo.getAppEngineFactory().deployment().deploy(config);
} catch (AppEngineException ex... | java | public void deploy() throws MojoExecutionException {
stager.stage();
DeployConfiguration config =
configBuilder.buildDeployConfiguration(ImmutableList.of(deployMojo.getStagingDirectory()));
try {
deployMojo.getAppEngineFactory().deployment().deploy(config);
} catch (AppEngineException ex... | [
"public",
"void",
"deploy",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"stager",
".",
"stage",
"(",
")",
";",
"DeployConfiguration",
"config",
"=",
"configBuilder",
".",
"buildDeployConfiguration",
"(",
"ImmutableList",
".",
"of",
"(",
"deployMojo",
".",
... | Deploy a single application (and no project configuration). | [
"Deploy",
"a",
"single",
"application",
"(",
"and",
"no",
"project",
"configuration",
")",
"."
] | 1f31bb8e963ce189e9ed6b88923a1853533485ff | https://github.com/GoogleCloudPlatform/app-maven-plugin/blob/1f31bb8e963ce189e9ed6b88923a1853533485ff/src/main/java/com/google/cloud/tools/maven/deploy/AppDeployer.java#L50-L61 | train | Deploy the application. | Of course, here is the Java code you requested:
```java
public void deploy() throws MojoExecutionException {
stager.stage();
DeployConfiguration config =
configBuilder.buildDeployConfiguration(ImmutableList.of(deployMojo.getStagingDirectory()));
try {
deployMojo.getAppEngineFactory().deploy... |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java | OverlyConcreteParameter.visitCode | @Override
public void visitCode(final Code obj) {
try {
if (methodSignatureIsConstrained) {
return;
}
if (obj.getCode() == null) {
return;
}
Method m = getMethod();
if (m.isSynthetic()) {
... | java | @Override
public void visitCode(final Code obj) {
try {
if (methodSignatureIsConstrained) {
return;
}
if (obj.getCode() == null) {
return;
}
Method m = getMethod();
if (m.isSynthetic()) {
... | [
"@",
"Override",
"public",
"void",
"visitCode",
"(",
"final",
"Code",
"obj",
")",
"{",
"try",
"{",
"if",
"(",
"methodSignatureIsConstrained",
")",
"{",
"return",
";",
"}",
"if",
"(",
"obj",
".",
"getCode",
"(",
")",
"==",
"null",
")",
"{",
"return",
... | implements the visitor to collect information about the parameters of a this
method
@param obj the currently parsed code block | [
"implements",
"the",
"visitor",
"to",
"collect",
"information",
"about",
"the",
"parameters",
"of",
"a",
"this",
"method"
] | 3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8 | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java#L183-L225 | train | implements the visitor to look for method signature that is not constrained by the user. | Of course, here is the Java code you requested:
```java
@Override
public void visitCode(final Code obj) {
try {
if (methodSignatureIsConstrained) {
return;
}
if (obj.getCode() == null) {
return;
}
Method m = getMet... |
jmxtrans/embedded-jmxtrans | src/main/java/org/jmxtrans/embedded/Query.java | Query.addAttribute | @Nonnull
public Query addAttribute(@Nonnull String attributeName) {
return addAttribute(new QueryAttribute(attributeName, null, null));
} | java | @Nonnull
public Query addAttribute(@Nonnull String attributeName) {
return addAttribute(new QueryAttribute(attributeName, null, null));
} | [
"@",
"Nonnull",
"public",
"Query",
"addAttribute",
"(",
"@",
"Nonnull",
"String",
"attributeName",
")",
"{",
"return",
"addAttribute",
"(",
"new",
"QueryAttribute",
"(",
"attributeName",
",",
"null",
",",
"null",
")",
")",
";",
"}"
] | Create a basic {@link QueryAttribute}, add it to the list attributes of this query
and maintains the reverse relation (see {@link org.jmxtrans.embedded.QueryAttribute#getQuery()}).
@param attributeName attribute to add
@return this | [
"Create",
"a",
"basic",
"{",
"@link",
"QueryAttribute",
"}",
"add",
"it",
"to",
"the",
"list",
"attributes",
"of",
"this",
"query",
"and",
"maintains",
"the",
"reverse",
"relation",
"(",
"see",
"{",
"@link",
"org",
".",
"jmxtrans",
".",
"embedded",
".",
... | 17224389e7d8323284cabc2a5167fc03bed6d223 | https://github.com/jmxtrans/embedded-jmxtrans/blob/17224389e7d8323284cabc2a5167fc03bed6d223/src/main/java/org/jmxtrans/embedded/Query.java#L276-L279 | train | Add an attribute to the CRUD. | Of course, here is the Java code you requested:
```java
@Nonnull
public Query addAttribute(@Nonnull String attributeName) {
return addAttribute(new QueryAttribute(attributeName, null, null));
}
```
Hope this helps! |
apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/asm/translate/Translate.java | Translate.translateEdgeIds | public static <OLD, NEW, EV> DataSet<Edge<NEW, EV>> translateEdgeIds(DataSet<Edge<OLD, EV>> edges, TranslateFunction<OLD, NEW> translator) {
return translateEdgeIds(edges, translator, PARALLELISM_DEFAULT);
} | java | public static <OLD, NEW, EV> DataSet<Edge<NEW, EV>> translateEdgeIds(DataSet<Edge<OLD, EV>> edges, TranslateFunction<OLD, NEW> translator) {
return translateEdgeIds(edges, translator, PARALLELISM_DEFAULT);
} | [
"public",
"static",
"<",
"OLD",
",",
"NEW",
",",
"EV",
">",
"DataSet",
"<",
"Edge",
"<",
"NEW",
",",
"EV",
">",
">",
"translateEdgeIds",
"(",
"DataSet",
"<",
"Edge",
"<",
"OLD",
",",
"EV",
">",
">",
"edges",
",",
"TranslateFunction",
"<",
"OLD",
",... | Translate {@link Edge} IDs using the given {@link TranslateFunction}.
@param edges input edges
@param translator implements conversion from {@code OLD} to {@code NEW}
@param <OLD> old edge ID type
@param <NEW> new edge ID type
@param <EV> edge value type
@return translated edges | [
"Translate",
"{",
"@link",
"Edge",
"}",
"IDs",
"using",
"the",
"given",
"{",
"@link",
"TranslateFunction",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/asm/translate/Translate.java#L137-L139 | train | Translate edge ids using the given translator. | Of course, here is the Java code you requested:
```java
public static <OLD, NEW, EV> DataSet<Edge<NEW, EV>> translateEdgeIds(DataSet<Edge<OLD, EV>> edges, TranslateFunction<OLD, NEW> translator) {
return translateEdgeIds(edges, translator, PARALLELISM_DEFAULT);
}
```
Hope this helps! |
aws/aws-sdk-java | aws-java-sdk-inspector/src/main/java/com/amazonaws/services/inspector/model/DescribeResourceGroupsResult.java | DescribeResourceGroupsResult.withResourceGroups | public DescribeResourceGroupsResult withResourceGroups(ResourceGroup... resourceGroups) {
if (this.resourceGroups == null) {
setResourceGroups(new java.util.ArrayList<ResourceGroup>(resourceGroups.length));
}
for (ResourceGroup ele : resourceGroups) {
this.resourceGroups.... | java | public DescribeResourceGroupsResult withResourceGroups(ResourceGroup... resourceGroups) {
if (this.resourceGroups == null) {
setResourceGroups(new java.util.ArrayList<ResourceGroup>(resourceGroups.length));
}
for (ResourceGroup ele : resourceGroups) {
this.resourceGroups.... | [
"public",
"DescribeResourceGroupsResult",
"withResourceGroups",
"(",
"ResourceGroup",
"...",
"resourceGroups",
")",
"{",
"if",
"(",
"this",
".",
"resourceGroups",
"==",
"null",
")",
"{",
"setResourceGroups",
"(",
"new",
"java",
".",
"util",
".",
"ArrayList",
"<",
... | <p>
Information about a resource group.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setResourceGroups(java.util.Collection)} or {@link #withResourceGroups(java.util.Collection)} if you want
to override the existing values.
</p>
@param resourceGroups
Information about... | [
"<p",
">",
"Information",
"about",
"a",
"resource",
"group",
".",
"<",
"/",
"p",
">",
"<p",
">",
"<b",
">",
"NOTE",
":",
"<",
"/",
"b",
">",
"This",
"method",
"appends",
"the",
"values",
"to",
"the",
"existing",
"list",
"(",
"if",
"any",
")",
"."... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-inspector/src/main/java/com/amazonaws/services/inspector/model/DescribeResourceGroupsResult.java#L84-L92 | train | A list of resource groups. | Of course, here is the Java code you requested:
```java
public DescribeResourceGroupsResult withResourceGroups(ResourceGroup... resourceGroups) {
if (this.resourceGroups == null) {
setResourceGroups(new java.util.ArrayList<ResourceGroup>(resourceGroups.length));
}
for (ResourceGroup... |
joniles/mpxj | src/main/java/net/sf/mpxj/mspdi/MSPDITimephasedWorkNormaliser.java | MSPDITimephasedWorkNormaliser.splitDays | private void splitDays(ProjectCalendar calendar, LinkedList<TimephasedWork> list)
{
LinkedList<TimephasedWork> result = new LinkedList<TimephasedWork>();
for (TimephasedWork assignment : list)
{
while (assignment != null)
{
Date startDay = DateHelper.getDayStartDate(as... | java | private void splitDays(ProjectCalendar calendar, LinkedList<TimephasedWork> list)
{
LinkedList<TimephasedWork> result = new LinkedList<TimephasedWork>();
for (TimephasedWork assignment : list)
{
while (assignment != null)
{
Date startDay = DateHelper.getDayStartDate(as... | [
"private",
"void",
"splitDays",
"(",
"ProjectCalendar",
"calendar",
",",
"LinkedList",
"<",
"TimephasedWork",
">",
"list",
")",
"{",
"LinkedList",
"<",
"TimephasedWork",
">",
"result",
"=",
"new",
"LinkedList",
"<",
"TimephasedWork",
">",
"(",
")",
";",
"for",... | This method breaks down spans of time into individual days.
@param calendar current project calendar
@param list list of assignment data | [
"This",
"method",
"breaks",
"down",
"spans",
"of",
"time",
"into",
"individual",
"days",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/MSPDITimephasedWorkNormaliser.java#L81-L114 | train | Split days. | Of course, here is the Java code you requested:
```java
private void splitDays(ProjectCalendar calendar, LinkedList<TimephasedWork> list)
{
LinkedList<TimephasedWork> result = new LinkedList<TimephasedWork>();
for (TimephasedWork assignment : list)
{
while (assignment != null)
{
... |
reactor/reactor-netty | src/main/java/reactor/netty/udp/UdpClient.java | UdpClient.option | public final <T> UdpClient option(ChannelOption<T> key, T value) {
Objects.requireNonNull(key, "key");
Objects.requireNonNull(value, "value");
return bootstrap(b -> b.option(key, value));
} | java | public final <T> UdpClient option(ChannelOption<T> key, T value) {
Objects.requireNonNull(key, "key");
Objects.requireNonNull(value, "value");
return bootstrap(b -> b.option(key, value));
} | [
"public",
"final",
"<",
"T",
">",
"UdpClient",
"option",
"(",
"ChannelOption",
"<",
"T",
">",
"key",
",",
"T",
"value",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"key",
",",
"\"key\"",
")",
";",
"Objects",
".",
"requireNonNull",
"(",
"value",
",... | Set a {@link ChannelOption} value for low level connection settings like {@code SO_TIMEOUT}
or {@code SO_KEEPALIVE}. This will apply to each new channel from remote peer.
@param key the option key
@param value the option value
@param <T> the option type
@return new {@link UdpClient}
@see Bootstrap#option(ChannelOpti... | [
"Set",
"a",
"{",
"@link",
"ChannelOption",
"}",
"value",
"for",
"low",
"level",
"connection",
"settings",
"like",
"{",
"@code",
"SO_TIMEOUT",
"}",
"or",
"{",
"@code",
"SO_KEEPALIVE",
"}",
".",
"This",
"will",
"apply",
"to",
"each",
"new",
"channel",
"from"... | 4ed14316e1d7fca3cecd18d6caa5f2251e159e49 | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/udp/UdpClient.java#L286-L290 | train | Sets the specified option on this client. | Of course, here is the Java code you requested:
```java
public final <T> UdpClient option(ChannelOption<T> key, T value) {
Objects.requireNonNull(key, "key");
Objects.requireNonNull(value, "value");
return bootstrap(b -> b.option(key, value));
}
```
Hope this helps! |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FileSystem.java | FileSystem.getFileStatus | private FileStatus[] getFileStatus(Path[] paths) throws IOException {
if (paths == null) {
return null;
}
ArrayList<FileStatus> results = new ArrayList<FileStatus>(paths.length);
for (int i = 0; i < paths.length; i++) {
try {
results.add(getFileStatus(paths[i]));
} catch (FileN... | java | private FileStatus[] getFileStatus(Path[] paths) throws IOException {
if (paths == null) {
return null;
}
ArrayList<FileStatus> results = new ArrayList<FileStatus>(paths.length);
for (int i = 0; i < paths.length; i++) {
try {
results.add(getFileStatus(paths[i]));
} catch (FileN... | [
"private",
"FileStatus",
"[",
"]",
"getFileStatus",
"(",
"Path",
"[",
"]",
"paths",
")",
"throws",
"IOException",
"{",
"if",
"(",
"paths",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"ArrayList",
"<",
"FileStatus",
">",
"results",
"=",
"new",
"... | Return a list of file status objects that corresponds to the list of paths
excluding those non-existent paths.
@param paths
the list of paths we want information from
@return a list of FileStatus objects
@throws IOException
see specific implementation | [
"Return",
"a",
"list",
"of",
"file",
"status",
"objects",
"that",
"corresponds",
"to",
"the",
"list",
"of",
"paths",
"excluding",
"those",
"non",
"-",
"existent",
"paths",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FileSystem.java#L1906-L1918 | train | Get the FileStatus array from the array of paths. | Of course, here is the Java code you requested:
```java
private FileStatus[] getFileStatus(Path[] paths) throws IOException {
if (paths == null) {
return null;
}
ArrayList<FileStatus> results = new ArrayList<FileStatus>(paths.length);
for (int i = 0; i < paths.length; i++) {
try {
r... |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/client/rest/internal/RESTMBeanServerConnection.java | RESTMBeanServerConnection.invoke | @Override
public Object invoke(ObjectName name, String operationName, Object[] params,
String[] signature) throws InstanceNotFoundException, MBeanException, ReflectionException, IOException {
final String sourceMethod = "invoke";
try {
//Look for routing MBean
... | java | @Override
public Object invoke(ObjectName name, String operationName, Object[] params,
String[] signature) throws InstanceNotFoundException, MBeanException, ReflectionException, IOException {
final String sourceMethod = "invoke";
try {
//Look for routing MBean
... | [
"@",
"Override",
"public",
"Object",
"invoke",
"(",
"ObjectName",
"name",
",",
"String",
"operationName",
",",
"Object",
"[",
"]",
"params",
",",
"String",
"[",
"]",
"signature",
")",
"throws",
"InstanceNotFoundException",
",",
"MBeanException",
",",
"Reflection... | {@inheritDoc} | [
"{"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/client/rest/internal/RESTMBeanServerConnection.java#L1075-L1205 | train | Override the invoke method to handle the invocation of the MBean. | Of course, here is the Java code you requested:
```java
@Override
public Object invoke(ObjectName name, String operationName, Object[] params,
String[] signature) throws InstanceNotFoundException, MBeanException, ReflectionException, IOException {
final String sourceMethod = "invok... |
ReactiveX/RxJava | src/main/java/io/reactivex/parallel/ParallelFlowable.java | ParallelFlowable.fromArray | @CheckReturnValue
@NonNull
public static <T> ParallelFlowable<T> fromArray(@NonNull Publisher<T>... publishers) {
if (publishers.length == 0) {
throw new IllegalArgumentException("Zero publishers not supported");
}
return RxJavaPlugins.onAssembly(new ParallelFromArray<T>(publ... | java | @CheckReturnValue
@NonNull
public static <T> ParallelFlowable<T> fromArray(@NonNull Publisher<T>... publishers) {
if (publishers.length == 0) {
throw new IllegalArgumentException("Zero publishers not supported");
}
return RxJavaPlugins.onAssembly(new ParallelFromArray<T>(publ... | [
"@",
"CheckReturnValue",
"@",
"NonNull",
"public",
"static",
"<",
"T",
">",
"ParallelFlowable",
"<",
"T",
">",
"fromArray",
"(",
"@",
"NonNull",
"Publisher",
"<",
"T",
">",
"...",
"publishers",
")",
"{",
"if",
"(",
"publishers",
".",
"length",
"==",
"0",... | Wraps multiple Publishers into a ParallelFlowable which runs them
in parallel and unordered.
@param <T> the value type
@param publishers the array of publishers
@return the new ParallelFlowable instance | [
"Wraps",
"multiple",
"Publishers",
"into",
"a",
"ParallelFlowable",
"which",
"runs",
"them",
"in",
"parallel",
"and",
"unordered",
"."
] | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/parallel/ParallelFlowable.java#L755-L762 | test | Creates a parallel flowable from an array of publishers. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@NonNull
public static <T> ParallelFlowable<T> fromArray(@NonNull Publisher<T>... publishers) {
if (publishers.length == 0) {
throw new IllegalArgumentException("Zero publishers not supported");
}
retu... |
Waikato/moa | moa/src/main/java/moa/gui/visualization/ParamGraphCanvas.java | ParamGraphCanvas.setGraph | public void setGraph(MeasureCollection[] measures, MeasureCollection[] measureStds,
double[] variedParamValues, Color[] colors) {
this.measures = measures;
this.variedParamValues = variedParamValues;
((GraphScatter) this.plotPanel).setGraph(measures, measureStds,
vari... | java | public void setGraph(MeasureCollection[] measures, MeasureCollection[] measureStds,
double[] variedParamValues, Color[] colors) {
this.measures = measures;
this.variedParamValues = variedParamValues;
((GraphScatter) this.plotPanel).setGraph(measures, measureStds,
vari... | [
"public",
"void",
"setGraph",
"(",
"MeasureCollection",
"[",
"]",
"measures",
",",
"MeasureCollection",
"[",
"]",
"measureStds",
",",
"double",
"[",
"]",
"variedParamValues",
",",
"Color",
"[",
"]",
"colors",
")",
"{",
"this",
".",
"measures",
"=",
"measures... | Sets the scatter graph.
@param measures
information about the curves
@param measureStds
standard deviation for the measures
@param variedParamValues
values of the varied parameter
@param colors
color encoding for the param array | [
"Sets",
"the",
"scatter",
"graph",
"."
] | 395982e5100bfe75a3a4d26115462ce2cc74cbb0 | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/gui/visualization/ParamGraphCanvas.java#L62-L69 | train | Set the graph. | Of course, here is the Java code you requested:
```java
public void setGraph(MeasureCollection[] measures, MeasureCollection[] measureStds,
double[] variedParamValues, Color[] colors) {
this.measures = measures;
this.variedParamValues = variedParamValues;
((GraphScatter) this.plotPa... |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/validation/SheetBindingErrors.java | SheetBindingErrors.getActualFieldType | public Class<?> getActualFieldType(final String field) {
final Object fieldValue = getFieldValue(field);
return fieldValue == null ? null : fieldValue.getClass();
} | java | public Class<?> getActualFieldType(final String field) {
final Object fieldValue = getFieldValue(field);
return fieldValue == null ? null : fieldValue.getClass();
} | [
"public",
"Class",
"<",
"?",
">",
"getActualFieldType",
"(",
"final",
"String",
"field",
")",
"{",
"final",
"Object",
"fieldValue",
"=",
"getFieldValue",
"(",
"field",
")",
";",
"return",
"fieldValue",
"==",
"null",
"?",
"null",
":",
"fieldValue",
".",
"ge... | 指定したパスのフィールドのクラスタイプを取得する。
<p>インスタンスを元に取得するため、サブクラスの可能性がある。</p>
@since 2.0
@param field フィールド名
@return クラスタイプ。ただし、オブジェクトの値がnullの場合は、クラスタイプもnullとなる。 | [
"指定したパスのフィールドのクラスタイプを取得する。",
"<p",
">",
"インスタンスを元に取得するため、サブクラスの可能性がある。<",
"/",
"p",
">"
] | a0c6b25c622e5f3a50b199ef685d2ee46ad5483c | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/validation/SheetBindingErrors.java#L196-L201 | train | Gets the actual field type. | Of course, here is the Java code you requested:
```java
public Class<?> getActualFieldType(final String field) {
final Object fieldValue = getFieldValue(field);
return fieldValue == null ? null : fieldValue.getClass();
}
```
Hope this helps! |
moparisthebest/beehive | beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ImplPersistenceDelegate.java | ImplPersistenceDelegate.instantiate | protected Expression instantiate(Object oldInstance, Encoder out)
{
//
// An implementation instance is actually constructed at decode time by calling
// ControlBean.ensureControl on the parent bean. This will create a new impl
// instance and run the impl initializer on it.
... | java | protected Expression instantiate(Object oldInstance, Encoder out)
{
//
// An implementation instance is actually constructed at decode time by calling
// ControlBean.ensureControl on the parent bean. This will create a new impl
// instance and run the impl initializer on it.
... | [
"protected",
"Expression",
"instantiate",
"(",
"Object",
"oldInstance",
",",
"Encoder",
"out",
")",
"{",
"//",
"// An implementation instance is actually constructed at decode time by calling",
"// ControlBean.ensureControl on the parent bean. This will create a new impl",
"// instance ... | PersistenceDelegate.instantiate() | [
"PersistenceDelegate",
".",
"instantiate",
"()"
] | 4246a0cc40ce3c05f1a02c2da2653ac622703d77 | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ImplPersistenceDelegate.java#L46-L54 | train | This method is called by the XMLDecoder to create an implementation instance of the CRA. | Of course, here is the Java code you requested:
```java
protected Expression instantiate(Object oldInstance, Encoder out)
{
//
// An implementation instance is actually constructed at decode time by calling
// ControlBean.ensureControl on the parent bean. This will create a new impl
... |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/CompressorHttp2ConnectionEncoder.java | CompressorHttp2ConnectionEncoder.newContentCompressor | protected EmbeddedChannel newContentCompressor(ChannelHandlerContext ctx, CharSequence contentEncoding)
throws Http2Exception {
if (GZIP.contentEqualsIgnoreCase(contentEncoding) || X_GZIP.contentEqualsIgnoreCase(contentEncoding)) {
return newCompressionChannel(ctx, ZlibWrapper.GZIP);
... | java | protected EmbeddedChannel newContentCompressor(ChannelHandlerContext ctx, CharSequence contentEncoding)
throws Http2Exception {
if (GZIP.contentEqualsIgnoreCase(contentEncoding) || X_GZIP.contentEqualsIgnoreCase(contentEncoding)) {
return newCompressionChannel(ctx, ZlibWrapper.GZIP);
... | [
"protected",
"EmbeddedChannel",
"newContentCompressor",
"(",
"ChannelHandlerContext",
"ctx",
",",
"CharSequence",
"contentEncoding",
")",
"throws",
"Http2Exception",
"{",
"if",
"(",
"GZIP",
".",
"contentEqualsIgnoreCase",
"(",
"contentEncoding",
")",
"||",
"X_GZIP",
"."... | Returns a new {@link EmbeddedChannel} that encodes the HTTP2 message content encoded in the specified
{@code contentEncoding}.
@param ctx the context.
@param contentEncoding the value of the {@code content-encoding} header
@return a new {@link ByteToMessageDecoder} if the specified encoding is supported. {@code null} ... | [
"Returns",
"a",
"new",
"{",
"@link",
"EmbeddedChannel",
"}",
"that",
"encodes",
"the",
"HTTP2",
"message",
"content",
"encoded",
"in",
"the",
"specified",
"{",
"@code",
"contentEncoding",
"}",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/CompressorHttp2ConnectionEncoder.java#L193-L203 | train | Create an EmbeddedChannel based on the content encoding. | Of course, here is the Java code you requested:
```java
protected EmbeddedChannel newContentCompressor(ChannelHandlerContext ctx, CharSequence contentEncoding)
throws Http2Exception {
if (GZIP.contentEqualsIgnoreCase(contentEncoding) || X_GZIP.contentEqualsIgnoreCase(contentEncoding)) {
... |
iig-uni-freiburg/SEWOL | src/de/uni/freiburg/iig/telematik/sewol/accesscontrol/rbac/lattice/graphic/RoleGraphMouse.java | RoleGraphMouse.loadPlugins | @Override
protected void loadPlugins() {
pickingPlugin = new PickingGraphMousePlugin<String,String>();
scalingPlugin = new ScalingGraphMousePlugin(new CrossoverScalingControl(), 0, in, out);
editingPlugin = new RoleGraphEditingPlugin();
add(scalingPlugin);
setMode(Mode.EDITING);
} | java | @Override
protected void loadPlugins() {
pickingPlugin = new PickingGraphMousePlugin<String,String>();
scalingPlugin = new ScalingGraphMousePlugin(new CrossoverScalingControl(), 0, in, out);
editingPlugin = new RoleGraphEditingPlugin();
add(scalingPlugin);
setMode(Mode.EDITING);
} | [
"@",
"Override",
"protected",
"void",
"loadPlugins",
"(",
")",
"{",
"pickingPlugin",
"=",
"new",
"PickingGraphMousePlugin",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"scalingPlugin",
"=",
"new",
"ScalingGraphMousePlugin",
"(",
"new",
"CrossoverScalingContr... | create the plugins, and load the plugins for TRANSFORMING mode | [
"create",
"the",
"plugins",
"and",
"load",
"the",
"plugins",
"for",
"TRANSFORMING",
"mode"
] | e791cb07a6e62ecf837d760d58a25f32fbf6bbca | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/accesscontrol/rbac/lattice/graphic/RoleGraphMouse.java#L55-L62 | train | Load the plugins. | Of course, here is the Java code you requested:
```java
@Override
protected void loadPlugins() {
pickingPlugin = new PickingGraphMousePlugin<String,String>();
scalingPlugin = new ScalingGraphMousePlugin(new CrossoverScalingControl(), 0, in, out);
editingPlugin = new RoleGraphEditingPlugin();
add(scalingPlu... |
stagemonitor/stagemonitor | stagemonitor-core/src/main/java/org/stagemonitor/core/grafana/GrafanaClient.java | GrafanaClient.sendGrafanaDashboardAsync | public void sendGrafanaDashboardAsync(final String classPathLocation) {
if (!corePlugin.isReportToElasticsearch()) {
return;
}
try {
final ObjectNode dashboard = getGrafanaDashboard(classPathLocation);
Map<String, Object> body = new HashMap<String, Object>();
body.put("dashboard", dashboard);
body... | java | public void sendGrafanaDashboardAsync(final String classPathLocation) {
if (!corePlugin.isReportToElasticsearch()) {
return;
}
try {
final ObjectNode dashboard = getGrafanaDashboard(classPathLocation);
Map<String, Object> body = new HashMap<String, Object>();
body.put("dashboard", dashboard);
body... | [
"public",
"void",
"sendGrafanaDashboardAsync",
"(",
"final",
"String",
"classPathLocation",
")",
"{",
"if",
"(",
"!",
"corePlugin",
".",
"isReportToElasticsearch",
"(",
")",
")",
"{",
"return",
";",
"}",
"try",
"{",
"final",
"ObjectNode",
"dashboard",
"=",
"ge... | Saves a dashboard to Grafana
<p>
If the Grafana url or the API Key is not configured, this method does nothing.
@param classPathLocation The location of the dashboard | [
"Saves",
"a",
"dashboard",
"to",
"Grafana",
"<p",
">",
"If",
"the",
"Grafana",
"url",
"or",
"the",
"API",
"Key",
"is",
"not",
"configured",
"this",
"method",
"does",
"nothing",
"."
] | 7a1bf6848906f816aa465983f602ea1f1e8f2b7b | https://github.com/stagemonitor/stagemonitor/blob/7a1bf6848906f816aa465983f602ea1f1e8f2b7b/stagemonitor-core/src/main/java/org/stagemonitor/core/grafana/GrafanaClient.java#L76-L90 | train | Send a Grafana dashboard to Elasticsearch asynchronously. | Of course, here is the Java code you requested:
```java
public void sendGrafanaDashboardAsync(final String classPathLocation) {
if (!corePlugin.isReportToElasticsearch()) {
return;
}
try {
final ObjectNode dashboard = getGrafanaDashboard(classPathLocation);
Map<String, Object> body = new HashMap<String... |
mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/scalebar/MapScaleBar.java | MapScaleBar.draw | public void draw(GraphicContext graphicContext) {
if (!this.visible) {
return;
}
if (this.mapViewDimension.getDimension() == null) {
return;
}
if (this.isRedrawNecessary()) {
redraw(this.mapScaleCanvas);
this.redrawNeeded = false;... | java | public void draw(GraphicContext graphicContext) {
if (!this.visible) {
return;
}
if (this.mapViewDimension.getDimension() == null) {
return;
}
if (this.isRedrawNecessary()) {
redraw(this.mapScaleCanvas);
this.redrawNeeded = false;... | [
"public",
"void",
"draw",
"(",
"GraphicContext",
"graphicContext",
")",
"{",
"if",
"(",
"!",
"this",
".",
"visible",
")",
"{",
"return",
";",
"}",
"if",
"(",
"this",
".",
"mapViewDimension",
".",
"getDimension",
"(",
")",
"==",
"null",
")",
"{",
"retur... | Called from {@link MapView}
@param graphicContext The graphicContext to use to draw the MapScaleBar | [
"Called",
"from",
"{",
"@link",
"MapView",
"}"
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/scalebar/MapScaleBar.java#L241-L259 | train | Draw the image. | Of course, here is the Java code you requested:
```java
public void draw(GraphicContext graphicContext) {
if (!this.visible) {
return;
}
if (this.mapViewDimension.getDimension() == null) {
return;
}
if (this.isRedrawNecessary()) {
redraw(thi... |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.serviceName_pca_pcaServiceName_sessions_sessionId_files_GET | public ArrayList<String> serviceName_pca_pcaServiceName_sessions_sessionId_files_GET(String serviceName, String pcaServiceName, String sessionId, String name) throws IOException {
String qPath = "/cloud/{serviceName}/pca/{pcaServiceName}/sessions/{sessionId}/files";
StringBuilder sb = path(qPath, serviceName, pcaSe... | java | public ArrayList<String> serviceName_pca_pcaServiceName_sessions_sessionId_files_GET(String serviceName, String pcaServiceName, String sessionId, String name) throws IOException {
String qPath = "/cloud/{serviceName}/pca/{pcaServiceName}/sessions/{sessionId}/files";
StringBuilder sb = path(qPath, serviceName, pcaSe... | [
"public",
"ArrayList",
"<",
"String",
">",
"serviceName_pca_pcaServiceName_sessions_sessionId_files_GET",
"(",
"String",
"serviceName",
",",
"String",
"pcaServiceName",
",",
"String",
"sessionId",
",",
"String",
"name",
")",
"throws",
"IOException",
"{",
"String",
"qPat... | cloud archives files in session
REST: GET /cloud/{serviceName}/pca/{pcaServiceName}/sessions/{sessionId}/files
@param name [required] Filter the value of name property (like)
@param serviceName [required] The internal name of your public cloud passport
@param pcaServiceName [required] The internal name of your PCA off... | [
"cloud",
"archives",
"files",
"in",
"session"
] | 6d531a40e56e09701943e334c25f90f640c55701 | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L2532-L2538 | train | List files associated with this session | Of course, here is the Java code you requested:
```java
public ArrayList<String> serviceName_pca_pcaServiceName_sessions_sessionId_files_GET(String serviceName, String pcaServiceName, String sessionId, String name) throws IOException {
String qPath = "/cloud/{serviceName}/pca/{pcaServiceName}/sessions/{sessionId}/fi... |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/word2vec/wordstore/VocabConstructor.java | VocabConstructor.buildMergedVocabulary | public VocabCache<T> buildMergedVocabulary(@NonNull VocabCache<T> vocabCache, boolean fetchLabels) {
if (cache == null)
cache = new AbstractCache.Builder<T>().build();
for (int t = 0; t < vocabCache.numWords(); t++) {
String label = vocabCache.wordAtIndex(t);
if (labe... | java | public VocabCache<T> buildMergedVocabulary(@NonNull VocabCache<T> vocabCache, boolean fetchLabels) {
if (cache == null)
cache = new AbstractCache.Builder<T>().build();
for (int t = 0; t < vocabCache.numWords(); t++) {
String label = vocabCache.wordAtIndex(t);
if (labe... | [
"public",
"VocabCache",
"<",
"T",
">",
"buildMergedVocabulary",
"(",
"@",
"NonNull",
"VocabCache",
"<",
"T",
">",
"vocabCache",
",",
"boolean",
"fetchLabels",
")",
"{",
"if",
"(",
"cache",
"==",
"null",
")",
"cache",
"=",
"new",
"AbstractCache",
".",
"Buil... | This method transfers existing vocabulary into current one
Please note: this method expects source vocabulary has Huffman tree indexes applied
@param vocabCache
@return | [
"This",
"method",
"transfers",
"existing",
"vocabulary",
"into",
"current",
"one"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/word2vec/wordstore/VocabConstructor.java#L116-L178 | train | Build a merged vocabulary from the source vocabulary cache. | Of course, here is the Java code you requested:
```java
public VocabCache<T> buildMergedVocabulary(@NonNull VocabCache<T> vocabCache, boolean fetchLabels) {
if (cache == null)
cache = new AbstractCache.Builder<T>().build();
for (int t = 0; t < vocabCache.numWords(); t++) {
Strin... |
SonarSource/sonarqube | sonar-plugin-api/src/main/java/org/sonar/api/utils/UriReader.java | UriReader.description | public String description(URI uri) {
SchemeProcessor reader = searchForSupportedProcessor(uri);
return reader.description(uri);
} | java | public String description(URI uri) {
SchemeProcessor reader = searchForSupportedProcessor(uri);
return reader.description(uri);
} | [
"public",
"String",
"description",
"(",
"URI",
"uri",
")",
"{",
"SchemeProcessor",
"reader",
"=",
"searchForSupportedProcessor",
"(",
"uri",
")",
";",
"return",
"reader",
".",
"description",
"(",
"uri",
")",
";",
"}"
] | Returns a detailed description of the given uri. For example HTTP URIs are completed
with the configured HTTP proxy. | [
"Returns",
"a",
"detailed",
"description",
"of",
"the",
"given",
"uri",
".",
"For",
"example",
"HTTP",
"URIs",
"are",
"completed",
"with",
"the",
"configured",
"HTTP",
"proxy",
"."
] | 2fffa4c2f79ae3714844d7742796e82822b6a98a | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-plugin-api/src/main/java/org/sonar/api/utils/UriReader.java#L77-L81 | train | Returns the description of the given URI. | Of course, here is the Java code you requested:
```java
public String description(URI uri) {
SchemeProcessor reader = searchForSupportedProcessor(uri);
return reader.description(uri);
}
```
Hope this helps! |
rzwitserloot/lombok | src/core/lombok/javac/handlers/JavacHandlerUtil.java | JavacHandlerUtil.generateNullCheck | public static JCStatement generateNullCheck(JavacTreeMaker maker, JavacNode variable, JCVariableDecl varDecl, JavacNode source) {
NullCheckExceptionType exceptionType = source.getAst().readConfiguration(ConfigurationKeys.NON_NULL_EXCEPTION_TYPE);
if (exceptionType == null) exceptionType = NullCheckExceptionType.NUL... | java | public static JCStatement generateNullCheck(JavacTreeMaker maker, JavacNode variable, JCVariableDecl varDecl, JavacNode source) {
NullCheckExceptionType exceptionType = source.getAst().readConfiguration(ConfigurationKeys.NON_NULL_EXCEPTION_TYPE);
if (exceptionType == null) exceptionType = NullCheckExceptionType.NUL... | [
"public",
"static",
"JCStatement",
"generateNullCheck",
"(",
"JavacTreeMaker",
"maker",
",",
"JavacNode",
"variable",
",",
"JCVariableDecl",
"varDecl",
",",
"JavacNode",
"source",
")",
"{",
"NullCheckExceptionType",
"exceptionType",
"=",
"source",
".",
"getAst",
"(",
... | Generates a new statement that checks if the given variable is null, and if so, throws a configured exception with the
variable name as message.
This is a special case method reserved for use when the provided declaration differs from the
variable's declaration, i.e. in a constructor or setter where the local paramete... | [
"Generates",
"a",
"new",
"statement",
"that",
"checks",
"if",
"the",
"given",
"variable",
"is",
"null",
"and",
"if",
"so",
"throws",
"a",
"configured",
"exception",
"with",
"the",
"variable",
"name",
"as",
"message",
"."
] | 75601240760bd81ff95fcde7a1b8185769ce64e8 | https://github.com/rzwitserloot/lombok/blob/75601240760bd81ff95fcde7a1b8185769ce64e8/src/core/lombok/javac/handlers/JavacHandlerUtil.java#L1483-L1500 | train | Generate a null check statement. | Of course, here is the Java code you requested:
```java
public static JCStatement generateNullCheck(JavacTreeMaker maker, JavacNode variable, JCVariableDecl varDecl, JavacNode source) {
NullCheckExceptionType exceptionType = source.getAst().readConfiguration(ConfigurationKeys.NON_NULL_EXCEPTION_TYPE);
if (exceptio... |
citrusframework/citrus | modules/citrus-vertx/src/main/java/com/consol/citrus/vertx/factory/AbstractVertxInstanceFactory.java | AbstractVertxInstanceFactory.createVertx | protected Vertx createVertx(VertxEndpointConfiguration endpointConfiguration) {
final Vertx[] vertx = new Vertx[1];
final Future loading = new FutureFactoryImpl().future();
Handler<AsyncResult<Vertx>> asyncLoadingHandler = new Handler<AsyncResult<Vertx>>() {
@Override
pu... | java | protected Vertx createVertx(VertxEndpointConfiguration endpointConfiguration) {
final Vertx[] vertx = new Vertx[1];
final Future loading = new FutureFactoryImpl().future();
Handler<AsyncResult<Vertx>> asyncLoadingHandler = new Handler<AsyncResult<Vertx>>() {
@Override
pu... | [
"protected",
"Vertx",
"createVertx",
"(",
"VertxEndpointConfiguration",
"endpointConfiguration",
")",
"{",
"final",
"Vertx",
"[",
"]",
"vertx",
"=",
"new",
"Vertx",
"[",
"1",
"]",
";",
"final",
"Future",
"loading",
"=",
"new",
"FutureFactoryImpl",
"(",
")",
".... | Creates new Vert.x instance with default factory. Subclasses may overwrite this
method in order to provide special Vert.x instance.
@return | [
"Creates",
"new",
"Vert",
".",
"x",
"instance",
"with",
"default",
"factory",
".",
"Subclasses",
"may",
"overwrite",
"this",
"method",
"in",
"order",
"to",
"provide",
"special",
"Vert",
".",
"x",
"instance",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-vertx/src/main/java/com/consol/citrus/vertx/factory/AbstractVertxInstanceFactory.java#L47-L89 | train | Create a new Vert. x instance. | Of course, here is the Java code you requested:
```java
protected Vertx createVertx(VertxEndpointConfiguration endpointConfiguration) {
final Vertx[] vertx = new Vertx[1];
final Future loading = new FutureFactoryImpl().future();
Handler<AsyncResult<Vertx>> asyncLoadingHandler = new Handler<Asy... |
Red5/red5-server-common | src/main/java/org/red5/server/stream/StreamService.java | StreamService.closeStream | public void closeStream(IConnection conn, Number streamId) {
log.info("closeStream stream id: {} connection: {}", streamId, conn.getSessionId());
if (conn instanceof IStreamCapableConnection) {
IStreamCapableConnection scConn = (IStreamCapableConnection) conn;
IClientStream ... | java | public void closeStream(IConnection conn, Number streamId) {
log.info("closeStream stream id: {} connection: {}", streamId, conn.getSessionId());
if (conn instanceof IStreamCapableConnection) {
IStreamCapableConnection scConn = (IStreamCapableConnection) conn;
IClientStream ... | [
"public",
"void",
"closeStream",
"(",
"IConnection",
"conn",
",",
"Number",
"streamId",
")",
"{",
"log",
".",
"info",
"(",
"\"closeStream stream id: {} connection: {}\"",
",",
"streamId",
",",
"conn",
".",
"getSessionId",
"(",
")",
")",
";",
"if",
"(",
"conn"... | Close stream. This method can close both IClientBroadcastStream (coming from Flash Player to Red5) and ISubscriberStream (from Red5
to Flash Player). Corresponding application handlers (streamSubscriberClose, etc.) are called as if close was initiated by Flash
Player.
It is recommended to remember stream id in applica... | [
"Close",
"stream",
".",
"This",
"method",
"can",
"close",
"both",
"IClientBroadcastStream",
"(",
"coming",
"from",
"Flash",
"Player",
"to",
"Red5",
")",
"and",
"ISubscriberStream",
"(",
"from",
"Red5",
"to",
"Flash",
"Player",
")",
".",
"Corresponding",
"appli... | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/StreamService.java#L183-L209 | train | Close a stream | Of course, here is the Java code you requested:
```java
public void closeStream(IConnection conn, Number streamId) {
log.info("closeStream stream id: {} connection: {}", streamId, conn.getSessionId());
if (conn instanceof IStreamCapableConnection) {
IStreamCapableConnection scConn = (IS... |
wildfly/wildfly | iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/ir/RepositoryImpl.java | RepositoryImpl.lookup_id | public Contained lookup_id(java.lang.String search_id) {
LocalContained c = _lookup_id(search_id);
if (c == null)
return null;
return ContainedHelper.narrow(c.getReference());
} | java | public Contained lookup_id(java.lang.String search_id) {
LocalContained c = _lookup_id(search_id);
if (c == null)
return null;
return ContainedHelper.narrow(c.getReference());
} | [
"public",
"Contained",
"lookup_id",
"(",
"java",
".",
"lang",
".",
"String",
"search_id",
")",
"{",
"LocalContained",
"c",
"=",
"_lookup_id",
"(",
"search_id",
")",
";",
"if",
"(",
"c",
"==",
"null",
")",
"return",
"null",
";",
"return",
"ContainedHelper",... | Repository implementation ------------------------------------- | [
"Repository",
"implementation",
"-------------------------------------"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/ir/RepositoryImpl.java#L101-L108 | test | This method is used to lookup a single ID in the cache. | Of course, here is the Java code you requested:
```java
public Contained lookup_id(java.lang.String search_id) {
LocalContained c = _lookup_id(search_id);
if (c == null)
return null;
return ContainedHelper.narrow(c.getReference());
}
```
Hope this helps! |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/EventSubscriptionManager.java | EventSubscriptionManager.findConditionalStartEventSubscription | @SuppressWarnings("unchecked")
public List<EventSubscriptionEntity> findConditionalStartEventSubscription() {
ListQueryParameterObject parameter = new ListQueryParameterObject();
configurParameterObject(parameter);
return getDbEntityManager().selectList("selectConditionalStartEventSubscription", paramete... | java | @SuppressWarnings("unchecked")
public List<EventSubscriptionEntity> findConditionalStartEventSubscription() {
ListQueryParameterObject parameter = new ListQueryParameterObject();
configurParameterObject(parameter);
return getDbEntityManager().selectList("selectConditionalStartEventSubscription", paramete... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"List",
"<",
"EventSubscriptionEntity",
">",
"findConditionalStartEventSubscription",
"(",
")",
"{",
"ListQueryParameterObject",
"parameter",
"=",
"new",
"ListQueryParameterObject",
"(",
")",
";",
"configurPara... | @return the conditional start event subscriptions (from any tenant) | [
"@return",
"the",
"conditional",
"start",
"event",
"subscriptions",
"(",
"from",
"any",
"tenant",
")"
] | 1a464fc887ef3760e53d6f91b9e5b871a0d77cc0 | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/EventSubscriptionManager.java#L305-L311 | train | Find all event subscriptions that are conditional to start | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public List<EventSubscriptionEntity> findConditionalStartEventSubscription() {
ListQueryParameterObject parameter = new ListQueryParameterObject();
configurParameterObject(parameter);
return getDbEntityManager().selec... |
alkacon/opencms-core | src-modules/org/opencms/workplace/commons/CmsLock.java | CmsLock.buildReport | public String buildReport() throws JspException, ServletException, IOException {
List<String> lockedResources;
if (Boolean.valueOf(getParamShowownlocks()).booleanValue()) {
lockedResources = getLockedResources();
} else {
lockedResources = new ArrayList<String>(getBlocki... | java | public String buildReport() throws JspException, ServletException, IOException {
List<String> lockedResources;
if (Boolean.valueOf(getParamShowownlocks()).booleanValue()) {
lockedResources = getLockedResources();
} else {
lockedResources = new ArrayList<String>(getBlocki... | [
"public",
"String",
"buildReport",
"(",
")",
"throws",
"JspException",
",",
"ServletException",
",",
"IOException",
"{",
"List",
"<",
"String",
">",
"lockedResources",
";",
"if",
"(",
"Boolean",
".",
"valueOf",
"(",
"getParamShowownlocks",
"(",
")",
")",
".",
... | Returns the report of all locked subresources.<p>
@return the report of all locked subresources
@throws JspException if dialog actions fail
@throws IOException in case of errros forwarding to the required result page
@throws ServletException in case of errros forwarding to the required result page | [
"Returns",
"the",
"report",
"of",
"all",
"locked",
"subresources",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsLock.java#L517-L559 | train | Build the report for the XML. | Of course, here is the Java code you requested:
```java
public String buildReport() throws JspException, ServletException, IOException {
List<String> lockedResources;
if (Boolean.valueOf(getParamShowownlocks()).booleanValue()) {
lockedResources = getLockedResources();
} else {
... |
aws/aws-sdk-java | aws-java-sdk-workspaces/src/main/java/com/amazonaws/services/workspaces/AmazonWorkspacesClient.java | AmazonWorkspacesClient.stopWorkspaces | @Override
public StopWorkspacesResult stopWorkspaces(StopWorkspacesRequest request) {
request = beforeClientExecution(request);
return executeStopWorkspaces(request);
} | java | @Override
public StopWorkspacesResult stopWorkspaces(StopWorkspacesRequest request) {
request = beforeClientExecution(request);
return executeStopWorkspaces(request);
} | [
"@",
"Override",
"public",
"StopWorkspacesResult",
"stopWorkspaces",
"(",
"StopWorkspacesRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeStopWorkspaces",
"(",
"request",
")",
";",
"}"
] | <p>
Stops the specified WorkSpaces.
</p>
<p>
You cannot stop a WorkSpace unless it has a running mode of <code>AutoStop</code> and a state of
<code>AVAILABLE</code>, <code>IMPAIRED</code>, <code>UNHEALTHY</code>, or <code>ERROR</code>.
</p>
@param stopWorkspacesRequest
@return Result of the StopWorkspaces operation re... | [
"<p",
">",
"Stops",
"the",
"specified",
"WorkSpaces",
".",
"<",
"/",
"p",
">",
"<p",
">",
"You",
"cannot",
"stop",
"a",
"WorkSpace",
"unless",
"it",
"has",
"a",
"running",
"mode",
"of",
"<code",
">",
"AutoStop<",
"/",
"code",
">",
"and",
"a",
"state"... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-workspaces/src/main/java/com/amazonaws/services/workspaces/AmazonWorkspacesClient.java#L2100-L2104 | train | Stops a set of virtual nodes. | Of course, here is the Java code you requested:
```java
@Override
public StopWorkspacesResult stopWorkspaces(StopWorkspacesRequest request) {
request = beforeClientExecution(request);
return executeStopWorkspaces(request);
}
```
Hope this helps! |
Hack23/cia | service.api/src/main/java/com/hack23/cia/service/api/action/user/SetGoogleAuthenticatorCredentialResponse.java | SetGoogleAuthenticatorCredentialResponse.setGoogleAuthScratchCodes | public void setGoogleAuthScratchCodes(final List<Integer> googleAuthScratchCodes) {
if (googleAuthScratchCodes != null) {
this.googleAuthScratchCodes = googleAuthScratchCodes.stream().collect(Collectors.toList());
}
} | java | public void setGoogleAuthScratchCodes(final List<Integer> googleAuthScratchCodes) {
if (googleAuthScratchCodes != null) {
this.googleAuthScratchCodes = googleAuthScratchCodes.stream().collect(Collectors.toList());
}
} | [
"public",
"void",
"setGoogleAuthScratchCodes",
"(",
"final",
"List",
"<",
"Integer",
">",
"googleAuthScratchCodes",
")",
"{",
"if",
"(",
"googleAuthScratchCodes",
"!=",
"null",
")",
"{",
"this",
".",
"googleAuthScratchCodes",
"=",
"googleAuthScratchCodes",
".",
"str... | Sets the google auth scratch codes.
@param googleAuthScratchCodes
the new google auth scratch codes | [
"Sets",
"the",
"google",
"auth",
"scratch",
"codes",
"."
] | 223312ca0eec74888a57a060de5b164f95a7785f | https://github.com/Hack23/cia/blob/223312ca0eec74888a57a060de5b164f95a7785f/service.api/src/main/java/com/hack23/cia/service/api/action/user/SetGoogleAuthenticatorCredentialResponse.java#L110-L114 | valid | Sets the Google auth scratch codes. | Of course, here is the Java code you requested:
```java
public void setGoogleAuthScratchCodes(final List<Integer> googleAuthScratchCodes) {
if (googleAuthScratchCodes != null) {
this.googleAuthScratchCodes = googleAuthScratchCodes.stream().collect(Collectors.toList());
}
}
```
Hope this helps! |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/DummyFileObjectStore.java | DummyFileObjectStore.tokens | public Set tokens() {
if (tokenSet == null) {
tokenSet = new AbstractSetView() {
public long size() {
return 0;
}
public Iterator iterator() {
return new Iterator() {
public boolean hasN... | java | public Set tokens() {
if (tokenSet == null) {
tokenSet = new AbstractSetView() {
public long size() {
return 0;
}
public Iterator iterator() {
return new Iterator() {
public boolean hasN... | [
"public",
"Set",
"tokens",
"(",
")",
"{",
"if",
"(",
"tokenSet",
"==",
"null",
")",
"{",
"tokenSet",
"=",
"new",
"AbstractSetView",
"(",
")",
"{",
"public",
"long",
"size",
"(",
")",
"{",
"return",
"0",
";",
"}",
"public",
"Iterator",
"iterator",
"("... | /*
(non-Javadoc)
@see com.ibm.ws.objectManager.ObjectStore#tokens() | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/DummyFileObjectStore.java#L135-L178 | train | Returns a Set of all tokens in this Session. | Of course, here is the Java code you requested:
```java
public Set tokens() {
if (tokenSet == null) {
tokenSet = new AbstractSetView() {
public long size() {
return 0;
}
public Iterator iterator() {
return new ... |
haifengl/smile | math/src/main/java/smile/math/matrix/PowerIteration.java | PowerIteration.eigen | public static double eigen(Matrix A, double[] v, double p, double tol) {
return eigen(A, v, p, tol, Math.max(20, 2 * A.nrows()));
} | java | public static double eigen(Matrix A, double[] v, double p, double tol) {
return eigen(A, v, p, tol, Math.max(20, 2 * A.nrows()));
} | [
"public",
"static",
"double",
"eigen",
"(",
"Matrix",
"A",
",",
"double",
"[",
"]",
"v",
",",
"double",
"p",
",",
"double",
"tol",
")",
"{",
"return",
"eigen",
"(",
"A",
",",
"v",
",",
"p",
",",
"tol",
",",
"Math",
".",
"max",
"(",
"20",
",",
... | Returns the largest eigen pair of matrix with the power iteration
under the assumptions A has an eigenvalue that is strictly greater
in magnitude than its other eigenvalues and the starting
vector has a nonzero component in the direction of an eigenvector
associated with the dominant eigenvalue.
@param A the matrix sup... | [
"Returns",
"the",
"largest",
"eigen",
"pair",
"of",
"matrix",
"with",
"the",
"power",
"iteration",
"under",
"the",
"assumptions",
"A",
"has",
"an",
"eigenvalue",
"that",
"is",
"strictly",
"greater",
"in",
"magnitude",
"than",
"its",
"other",
"eigenvalues",
"an... | e27e43e90fbaacce3f99d30120cf9dd6a764c33d | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/math/src/main/java/smile/math/matrix/PowerIteration.java#L103-L105 | train | Compute the eigenvalue of A using the given parameters. | Of course, here is the Java code you requested:
```java
public static double eigen(Matrix A, double[] v, double p, double tol) {
return eigen(A, v, p, tol, Math.max(20, 2 * A.nrows()));
}
```
Hope this helps! |
square/dagger | core/src/main/java/dagger/internal/Keys.java | Keys.get | private static String get(Type type, Annotation annotation) {
type = boxIfPrimitive(type);
if (annotation == null && type instanceof Class && !((Class<?>) type).isArray()) {
return ((Class<?>) type).getName();
}
StringBuilder result = new StringBuilder();
if (annotation != null) {
result... | java | private static String get(Type type, Annotation annotation) {
type = boxIfPrimitive(type);
if (annotation == null && type instanceof Class && !((Class<?>) type).isArray()) {
return ((Class<?>) type).getName();
}
StringBuilder result = new StringBuilder();
if (annotation != null) {
result... | [
"private",
"static",
"String",
"get",
"(",
"Type",
"type",
",",
"Annotation",
"annotation",
")",
"{",
"type",
"=",
"boxIfPrimitive",
"(",
"type",
")",
";",
"if",
"(",
"annotation",
"==",
"null",
"&&",
"type",
"instanceof",
"Class",
"&&",
"!",
"(",
"(",
... | Returns a key for {@code type} annotated by {@code annotation}. | [
"Returns",
"a",
"key",
"for",
"{"
] | 572cdd2fe97fc3c148fb3d8e1b2ce7beb4dcbcde | https://github.com/square/dagger/blob/572cdd2fe97fc3c148fb3d8e1b2ce7beb4dcbcde/core/src/main/java/dagger/internal/Keys.java#L71-L82 | train | Get the name of the type. | Of course, here is the Java code you requested:
```java
private static String get(Type type, Annotation annotation) {
type = boxIfPrimitive(type);
if (annotation == null && type instanceof Class && !((Class<?>) type).isArray()) {
return ((Class<?>) type).getName();
}
StringBuilder result = new St... |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.serviceName_database_POST | public OvhTask serviceName_database_POST(String serviceName, OvhDatabaseCapabilitiesTypeEnum capabilitie, String password, OvhExtraSqlQuotaEnum quota, OvhDatabaseTypeEnum type, String user, OvhVersionEnum version) throws IOException {
String qPath = "/hosting/web/{serviceName}/database";
StringBuilder sb = path(qPa... | java | public OvhTask serviceName_database_POST(String serviceName, OvhDatabaseCapabilitiesTypeEnum capabilitie, String password, OvhExtraSqlQuotaEnum quota, OvhDatabaseTypeEnum type, String user, OvhVersionEnum version) throws IOException {
String qPath = "/hosting/web/{serviceName}/database";
StringBuilder sb = path(qPa... | [
"public",
"OvhTask",
"serviceName_database_POST",
"(",
"String",
"serviceName",
",",
"OvhDatabaseCapabilitiesTypeEnum",
"capabilitie",
",",
"String",
"password",
",",
"OvhExtraSqlQuotaEnum",
"quota",
",",
"OvhDatabaseTypeEnum",
"type",
",",
"String",
"user",
",",
"OvhVers... | Install new database
REST: POST /hosting/web/{serviceName}/database
@param type [required] Type you want for your database
@param password [required] Database password
@param user [required] Database user name. Must begin with your hosting login and must be in lower case
@param quota [required] Quota assign to your da... | [
"Install",
"new",
"database"
] | 6d531a40e56e09701943e334c25f90f640c55701 | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L1110-L1122 | train | Create a new database | Of course, here is the Java code you requested:
```java
public OvhTask serviceName_database_POST(String serviceName, OvhDatabaseCapabilitiesTypeEnum capabilitie, String password, OvhExtraSqlQuotaEnum quota, OvhDatabaseTypeEnum type, String user, OvhVersionEnum version) throws IOException {
String qPath = "/hosting/w... |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/Model.java | Model.addScope | protected static void addScope(String name, String criteria) {
ModelDelegate.addScope(modelClass().getName(), name, criteria);
} | java | protected static void addScope(String name, String criteria) {
ModelDelegate.addScope(modelClass().getName(), name, criteria);
} | [
"protected",
"static",
"void",
"addScope",
"(",
"String",
"name",
",",
"String",
"criteria",
")",
"{",
"ModelDelegate",
".",
"addScope",
"(",
"modelClass",
"(",
")",
".",
"getName",
"(",
")",
",",
"name",
",",
"criteria",
")",
";",
"}"
] | Use in a static block of a model definotion to add a scope.
@param name name of scope
@param criteria SQL criteria for the scope filter | [
"Use",
"in",
"a",
"static",
"block",
"of",
"a",
"model",
"definotion",
"to",
"add",
"a",
"scope",
"."
] | ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/Model.java#L1970-L1972 | train | Add a scope to the application. | Of course, here is the Java code you requested:
```java
protected static void addScope(String name, String criteria) {
ModelDelegate.addScope(modelClass().getName(), name, criteria);
}
```
Hope this helps! |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/slider2/Slider2Core.java | Slider2Core.setStep | public void setStep(java.lang.Object _step) {
getStateHelper().put(PropertyKeys.step, _step);
} | java | public void setStep(java.lang.Object _step) {
getStateHelper().put(PropertyKeys.step, _step);
} | [
"public",
"void",
"setStep",
"(",
"java",
".",
"lang",
".",
"Object",
"_step",
")",
"{",
"getStateHelper",
"(",
")",
".",
"put",
"(",
"PropertyKeys",
".",
"step",
",",
"_step",
")",
";",
"}"
] | Increment step <P>
Usually this method is called internally by the JSF engine. | [
"Increment",
"step",
"<P",
">",
"Usually",
"this",
"method",
"is",
"called",
"internally",
"by",
"the",
"JSF",
"engine",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/slider2/Slider2Core.java#L441-L443 | train | Sets the step value. | Of course, here is the Java code you requested:
```java
public void setStep(java.lang.Object _step) {
getStateHelper().put(PropertyKeys.step, _step);
}
```
Hope this helps! |
gallandarakhneorg/afc | advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d1/dfx/Tuple1dfx.java | Tuple1dfx.set | public void set(Segment1D<?, ?> segment, double curviline, double shift) {
assert segment != null : AssertMessages.notNullParameter(0);
segmentProperty().set(new WeakReference<>(segment));
xProperty().set(curviline);
yProperty().set(shift);
} | java | public void set(Segment1D<?, ?> segment, double curviline, double shift) {
assert segment != null : AssertMessages.notNullParameter(0);
segmentProperty().set(new WeakReference<>(segment));
xProperty().set(curviline);
yProperty().set(shift);
} | [
"public",
"void",
"set",
"(",
"Segment1D",
"<",
"?",
",",
"?",
">",
"segment",
",",
"double",
"curviline",
",",
"double",
"shift",
")",
"{",
"assert",
"segment",
"!=",
"null",
":",
"AssertMessages",
".",
"notNullParameter",
"(",
"0",
")",
";",
"segmentPr... | Change the attributes of the tuple.
@param segment the segment.
@param curviline the curviline coordinate.
@param shift the shift distance. | [
"Change",
"the",
"attributes",
"of",
"the",
"tuple",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d1/dfx/Tuple1dfx.java#L268-L273 | train | Sets the segment. | Of course, here is the Java code you requested:
```java
public void set(Segment1D<?, ?> segment, double curviline, double shift) {
assert segment != null : AssertMessages.notNullParameter(0);
segmentProperty().set(new WeakReference<>(segment));
xProperty().set(curviline);
yProperty().set(shift);
}
```
Hope t... |
algolia/algoliasearch-client-android | algoliasearch/src/main/java/com/algolia/search/saas/Index.java | Index.searchDisjunctiveFacetingAsync | public Request searchDisjunctiveFacetingAsync(@NonNull Query query, @NonNull final Collection<String> disjunctiveFacets, @NonNull final Map<String, ? extends Collection<String>> refinements, @NonNull final CompletionHandler completionHandler) {
return searchDisjunctiveFacetingAsync(query, disjunctiveFacets, ref... | java | public Request searchDisjunctiveFacetingAsync(@NonNull Query query, @NonNull final Collection<String> disjunctiveFacets, @NonNull final Map<String, ? extends Collection<String>> refinements, @NonNull final CompletionHandler completionHandler) {
return searchDisjunctiveFacetingAsync(query, disjunctiveFacets, ref... | [
"public",
"Request",
"searchDisjunctiveFacetingAsync",
"(",
"@",
"NonNull",
"Query",
"query",
",",
"@",
"NonNull",
"final",
"Collection",
"<",
"String",
">",
"disjunctiveFacets",
",",
"@",
"NonNull",
"final",
"Map",
"<",
"String",
",",
"?",
"extends",
"Collectio... | Perform a search with disjunctive facets, generating as many queries as number of disjunctive facets (helper).
@param query The query.
@param disjunctiveFacets List of disjunctive facets.
@param refinements The current refinements, mapping facet names to a list of values.
@param completionHandler The... | [
"Perform",
"a",
"search",
"with",
"disjunctive",
"facets",
"generating",
"as",
"many",
"queries",
"as",
"number",
"of",
"disjunctive",
"facets",
"(",
"helper",
")",
"."
] | 3293ba6e6116a4f6c1face2cc606bc047d6d4a3c | https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/main/java/com/algolia/search/saas/Index.java#L229-L231 | test | Search for disjunctive facets in asynchronous fashion. | Of course, here is the Java code you requested:
```java
public Request searchDisjunctiveFacetingAsync(@NonNull Query query, @NonNull final Collection<String> disjunctiveFacets, @NonNull final Map<String, ? extends Collection<String>> refinements, @NonNull final CompletionHandler completionHandler) {
return sea... |
TestFX/Monocle | src/main/java/com/sun/glass/ui/monocle/X11WarpingCursor.java | X11WarpingCursor.setLocation | @Override
void setLocation(int x, int y) {
if (x != nextX || y != nextY) {
nextX = x;
nextY = y;
MonocleWindowManager.getInstance().repaintAll();
}
} | java | @Override
void setLocation(int x, int y) {
if (x != nextX || y != nextY) {
nextX = x;
nextY = y;
MonocleWindowManager.getInstance().repaintAll();
}
} | [
"@",
"Override",
"void",
"setLocation",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"if",
"(",
"x",
"!=",
"nextX",
"||",
"y",
"!=",
"nextY",
")",
"{",
"nextX",
"=",
"x",
";",
"nextY",
"=",
"y",
";",
"MonocleWindowManager",
".",
"getInstance",
"(",
... | Update the next coordinates for the cursor. The actual move will occur
on the next buffer swap
@param x the new X location on the screen
@param y the new Y location on the screen | [
"Update",
"the",
"next",
"coordinates",
"for",
"the",
"cursor",
".",
"The",
"actual",
"move",
"will",
"occur",
"on",
"the",
"next",
"buffer",
"swap"
] | 267ccba8889cab244bf8c562dbaa0345a612874c | https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/X11WarpingCursor.java#L41-L48 | train | Set the location of the surrogate. | Of course, here is the Java code you requested:
```java
@Override
void setLocation(int x, int y) {
if (x != nextX || y != nextY) {
nextX = x;
nextY = y;
MonocleWindowManager.getInstance().repaintAll();
}
}
```
Hope this helps! |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/util/CmsDomUtil.java | CmsDomUtil.createIFrameElement | public static com.google.gwt.dom.client.Element createIFrameElement(String name) {
return getDOMImpl().createIFrameElement(Document.get(), name);
} | java | public static com.google.gwt.dom.client.Element createIFrameElement(String name) {
return getDOMImpl().createIFrameElement(Document.get(), name);
} | [
"public",
"static",
"com",
".",
"google",
".",
"gwt",
".",
"dom",
".",
"client",
".",
"Element",
"createIFrameElement",
"(",
"String",
"name",
")",
"{",
"return",
"getDOMImpl",
"(",
")",
".",
"createIFrameElement",
"(",
"Document",
".",
"get",
"(",
")",
... | Creates an iFrame element with the given name attribute.<p>
@param name the name attribute value
@return the iFrame element | [
"Creates",
"an",
"iFrame",
"element",
"with",
"the",
"given",
"name",
"attribute",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/CmsDomUtil.java#L746-L749 | train | Create an IFrame element. | Of course, here is the Java code you requested:
```java
public static com.google.gwt.dom.client.Element createIFrameElement(String name) {
return getDOMImpl().createIFrameElement(Document.get(), name);
}
```
Hope this helps! |
playframework/playframework | core/play-guice/src/main/java/play/inject/guice/GuiceBuilder.java | GuiceBuilder.bindings | public final Self bindings(play.api.inject.Binding<?>... bindings) {
return bindings(Guiceable.bindings(bindings));
} | java | public final Self bindings(play.api.inject.Binding<?>... bindings) {
return bindings(Guiceable.bindings(bindings));
} | [
"public",
"final",
"Self",
"bindings",
"(",
"play",
".",
"api",
".",
"inject",
".",
"Binding",
"<",
"?",
">",
"...",
"bindings",
")",
"{",
"return",
"bindings",
"(",
"Guiceable",
".",
"bindings",
"(",
"bindings",
")",
")",
";",
"}"
] | Add Play bindings.
@param bindings the set of play bindings to apply
@return a copy of this builder configured with the provided bindings | [
"Add",
"Play",
"bindings",
"."
] | 3c46dca803d24e715d85de678c59dcfac9525a00 | https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play-guice/src/main/java/play/inject/guice/GuiceBuilder.java#L142-L144 | test | Set the bindings of this GuiceElement. | Of course, here is the Java code you requested:
```java
public final Self bindings(play.api.inject.Binding<?>... bindings) {
return bindings(Guiceable.bindings(bindings));
}
```
Hope this helps! |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java | FSNamesystem.merge | public void merge(String parity, String source, String codecId, int[] checksums)
throws IOException {
if(FSNamesystem.LOG.isDebugEnabled()) {
FSNamesystem.LOG.debug("merge " + parity + " to " + source);
}
if (isInSafeMode()) {
throw new SafeModeException("merge: cannot merge " + parity + " ... | java | public void merge(String parity, String source, String codecId, int[] checksums)
throws IOException {
if(FSNamesystem.LOG.isDebugEnabled()) {
FSNamesystem.LOG.debug("merge " + parity + " to " + source);
}
if (isInSafeMode()) {
throw new SafeModeException("merge: cannot merge " + parity + " ... | [
"public",
"void",
"merge",
"(",
"String",
"parity",
",",
"String",
"source",
",",
"String",
"codecId",
",",
"int",
"[",
"]",
"checksums",
")",
"throws",
"IOException",
"{",
"if",
"(",
"FSNamesystem",
".",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")",
"{",... | Merge parity file into source file to convert source file's storage format
from INodeRegularStorage into INodeRaidStorage.
checksums will be added to each block of the source file
return true if merge succeeds | [
"Merge",
"parity",
"file",
"into",
"source",
"file",
"to",
"convert",
"source",
"file",
"s",
"storage",
"format",
"from",
"INodeRegularStorage",
"into",
"INodeRaidStorage",
".",
"checksums",
"will",
"be",
"added",
"to",
"each",
"block",
"of",
"the",
"source",
... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java#L1605-L1722 | train | Merge two files into one file. | Of course, here is the Java code you requested:
```java
public void merge(String parity, String source, String codecId, int[] checksums)
throws IOException {
if(FSNamesystem.LOG.isDebugEnabled()) {
FSNamesystem.LOG.debug("merge " + parity + " to " + source);
}
if (isInSafeMode()) {
throw n... |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearRotationMulti.java | SelfCalibrationLinearRotationMulti.extractCalibration | void extractCalibration( Homography2D_F64 Hinv , CameraPinhole c ) {
CommonOps_DDF3.multTransA(Hinv,W0,tmp);
CommonOps_DDF3.mult(tmp,Hinv,Wi);
convertW(Wi,c);
} | java | void extractCalibration( Homography2D_F64 Hinv , CameraPinhole c ) {
CommonOps_DDF3.multTransA(Hinv,W0,tmp);
CommonOps_DDF3.mult(tmp,Hinv,Wi);
convertW(Wi,c);
} | [
"void",
"extractCalibration",
"(",
"Homography2D_F64",
"Hinv",
",",
"CameraPinhole",
"c",
")",
"{",
"CommonOps_DDF3",
".",
"multTransA",
"(",
"Hinv",
",",
"W0",
",",
"tmp",
")",
";",
"CommonOps_DDF3",
".",
"mult",
"(",
"tmp",
",",
"Hinv",
",",
"Wi",
")",
... | Extracts calibration for the non-reference frames
w = H^-T*w*H^-1 | [
"Extracts",
"calibration",
"for",
"the",
"non",
"-",
"reference",
"frames"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearRotationMulti.java#L265-L270 | train | Extracts calibration from the homography. | Of course, here is the Java code you requested:
```java
void extractCalibration( Homography2D_F64 Hinv , CameraPinhole c ) {
CommonOps_DDF3.multTransA(Hinv,W0,tmp);
CommonOps_DDF3.mult(tmp,Hinv,Wi);
convertW(Wi,c);
}
```
Hope this helps! |
dbflute-session/jetty-boot | src/main/java/org/dbflute/jetty/JettyBoot.java | JettyBoot.browseOnDesktopIfNeeds | protected void browseOnDesktopIfNeeds(final URI uri) {
if (!browseOnDesktop) {
return;
}
final java.awt.Desktop desktop = java.awt.Desktop.getDesktop();
try {
desktop.browse(uri);
} catch (IOException e) {
throw new IllegalStateException("Faile... | java | protected void browseOnDesktopIfNeeds(final URI uri) {
if (!browseOnDesktop) {
return;
}
final java.awt.Desktop desktop = java.awt.Desktop.getDesktop();
try {
desktop.browse(uri);
} catch (IOException e) {
throw new IllegalStateException("Faile... | [
"protected",
"void",
"browseOnDesktopIfNeeds",
"(",
"final",
"URI",
"uri",
")",
"{",
"if",
"(",
"!",
"browseOnDesktop",
")",
"{",
"return",
";",
"}",
"final",
"java",
".",
"awt",
".",
"Desktop",
"desktop",
"=",
"java",
".",
"awt",
".",
"Desktop",
".",
... | ------ | [
"------"
] | a433e16bfaceeec69ae7b839a6efca6c9a10ca1e | https://github.com/dbflute-session/jetty-boot/blob/a433e16bfaceeec69ae7b839a6efca6c9a10ca1e/src/main/java/org/dbflute/jetty/JettyBoot.java#L672-L682 | train | Browse on desktop if needed. | Of course, here is the Java code you requested:
```java
protected void browseOnDesktopIfNeeds(final URI uri) {
if (!browseOnDesktop) {
return;
}
final java.awt.Desktop desktop = java.awt.Desktop.getDesktop();
try {
desktop.browse(uri);
} catch (IOExceptio... |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/ArrayUtils.java | ArrayUtils.equalContents | public static boolean equalContents(int[][] xs, int[][] ys) {
if(xs ==null)
return ys == null;
if(ys == null)
return false;
if(xs.length != ys.length)
return false;
for(int i = xs.length-1; i >= 0; i--) {
if(! equalContents(xs[i],ys[i]))
return false;
}
... | java | public static boolean equalContents(int[][] xs, int[][] ys) {
if(xs ==null)
return ys == null;
if(ys == null)
return false;
if(xs.length != ys.length)
return false;
for(int i = xs.length-1; i >= 0; i--) {
if(! equalContents(xs[i],ys[i]))
return false;
}
... | [
"public",
"static",
"boolean",
"equalContents",
"(",
"int",
"[",
"]",
"[",
"]",
"xs",
",",
"int",
"[",
"]",
"[",
"]",
"ys",
")",
"{",
"if",
"(",
"xs",
"==",
"null",
")",
"return",
"ys",
"==",
"null",
";",
"if",
"(",
"ys",
"==",
"null",
")",
"... | Tests two int[][] arrays for having equal contents.
@return true iff for each i, <code>equalContents(xs[i],ys[i])</code> is true | [
"Tests",
"two",
"int",
"[]",
"[]",
"arrays",
"for",
"having",
"equal",
"contents",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/ArrayUtils.java#L490-L502 | train | Returns true if the two arrays are the same. | Of course, here is the Java code you requested:
```java
public static boolean equalContents(int[][] xs, int[][] ys) {
if(xs ==null)
return ys == null;
if(ys == null)
return false;
if(xs.length != ys.length)
return false;
for(int i = xs.length-1; i >= 0; i--) {
if(! equal... |
apiman/apiman | manager/api/hawkular/src/main/java/io/apiman/manager/api/hawkular/HawkularMetricsAccessor.java | HawkularMetricsAccessor.bucketSizeFromInterval | private static BucketSizeType bucketSizeFromInterval(HistogramIntervalType interval) {
BucketSizeType bucketSize;
switch (interval) {
case minute:
bucketSize = BucketSizeType.Minute;
break;
case hour:
bucketSize = BucketSizeType.Hour;
break... | java | private static BucketSizeType bucketSizeFromInterval(HistogramIntervalType interval) {
BucketSizeType bucketSize;
switch (interval) {
case minute:
bucketSize = BucketSizeType.Minute;
break;
case hour:
bucketSize = BucketSizeType.Hour;
break... | [
"private",
"static",
"BucketSizeType",
"bucketSizeFromInterval",
"(",
"HistogramIntervalType",
"interval",
")",
"{",
"BucketSizeType",
"bucketSize",
";",
"switch",
"(",
"interval",
")",
"{",
"case",
"minute",
":",
"bucketSize",
"=",
"BucketSizeType",
".",
"Minute",
... | Converts an interval into a bucket size.
@param interval | [
"Converts",
"an",
"interval",
"into",
"a",
"bucket",
"size",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/hawkular/src/main/java/io/apiman/manager/api/hawkular/HawkularMetricsAccessor.java#L313-L336 | train | Get the bucket size from the histogram interval type. | Of course, here is the Java code you requested:
```java
private static BucketSizeType bucketSizeFromInterval(HistogramIntervalType interval) {
BucketSizeType bucketSize;
switch (interval) {
case minute:
bucketSize = BucketSizeType.Minute;
break;
case hour:
... |
lucee/Lucee | core/src/main/java/lucee/runtime/security/ScriptProtect.java | ScriptProtect.translate | public static String translate(String str) {
if (str == null) return "";
// TODO do-while machen
int index, last = 0, endIndex;
StringBuilder sb = null;
String tagName;
while ((index = str.indexOf('<', last)) != -1) {
// read tagname
int len = str.length();
char c;
for (endIndex = index + 1; e... | java | public static String translate(String str) {
if (str == null) return "";
// TODO do-while machen
int index, last = 0, endIndex;
StringBuilder sb = null;
String tagName;
while ((index = str.indexOf('<', last)) != -1) {
// read tagname
int len = str.length();
char c;
for (endIndex = index + 1; e... | [
"public",
"static",
"String",
"translate",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"return",
"\"\"",
";",
"// TODO do-while machen",
"int",
"index",
",",
"last",
"=",
"0",
",",
"endIndex",
";",
"StringBuilder",
"sb",
"=",
"nu... | translate string to script-protected form
@param str
@return translated String | [
"translate",
"string",
"to",
"script",
"-",
"protected",
"form"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/security/ScriptProtect.java#L58-L95 | train | Translate a String to a XML - compatible format. | Of course, here is the Java code you requested:
```java
public static String translate(String str) {
if (str == null) return "";
// TODO do-while machen
int index, last = 0, endIndex;
StringBuilder sb = null;
String tagName;
while ((index = str.indexOf('<', last)) != -1) {
// read tagname
int len = str... |
microg/android_external_UnifiedNlpApi | unifiednlp-api/src/main/java/org/microg/nlp/api/CellBackendHelper.java | CellBackendHelper.onClose | @Override
public synchronized void onClose() {
super.onClose();
if (phoneStateListener != null)
telephonyManager.listen(phoneStateListener, PhoneStateListener.LISTEN_NONE);
} | java | @Override
public synchronized void onClose() {
super.onClose();
if (phoneStateListener != null)
telephonyManager.listen(phoneStateListener, PhoneStateListener.LISTEN_NONE);
} | [
"@",
"Override",
"public",
"synchronized",
"void",
"onClose",
"(",
")",
"{",
"super",
".",
"onClose",
"(",
")",
";",
"if",
"(",
"phoneStateListener",
"!=",
"null",
")",
"telephonyManager",
".",
"listen",
"(",
"phoneStateListener",
",",
"PhoneStateListener",
".... | Call this in {@link org.microg.nlp.api.LocationBackendService#onClose()}. | [
"Call",
"this",
"in",
"{"
] | 59b6741166571bfcaf64e5feec7469190c7852aa | https://github.com/microg/android_external_UnifiedNlpApi/blob/59b6741166571bfcaf64e5feec7469190c7852aa/unifiednlp-api/src/main/java/org/microg/nlp/api/CellBackendHelper.java#L382-L387 | train | This method is called when the application closes. | Of course, here is the Java code you requested:
```java
@Override
public synchronized void onClose() {
super.onClose();
if (phoneStateListener != null)
telephonyManager.listen(phoneStateListener, PhoneStateListener.LISTEN_NONE);
}
```
Hope this helps! |
lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/log/Logger.java | Logger.error | public void error(String message) {
if (getLevel() > Level.ERROR.ordinal()) return;
logMessage(Level.ERROR, message, null);
} | java | public void error(String message) {
if (getLevel() > Level.ERROR.ordinal()) return;
logMessage(Level.ERROR, message, null);
} | [
"public",
"void",
"error",
"(",
"String",
"message",
")",
"{",
"if",
"(",
"getLevel",
"(",
")",
">",
"Level",
".",
"ERROR",
".",
"ordinal",
"(",
")",
")",
"return",
";",
"logMessage",
"(",
"Level",
".",
"ERROR",
",",
"message",
",",
"null",
")",
";... | Log. | [
"Log",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/log/Logger.java#L136-L139 | train | Logs a message at the ERROR level. | Of course, here is the Java code you requested:
```java
public void error(String message) {
if (getLevel() > Level.ERROR.ordinal()) return;
logMessage(Level.ERROR, message, null);
}
```
Hope this helps! |
jamesagnew/hapi-fhir | hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/subscriber/BaseResourceMessage.java | BaseResourceMessage.getAttribute | public Optional<String> getAttribute(String theKey) {
Validate.notBlank(theKey);
if (myAttributes == null) {
return Optional.empty();
}
return Optional.ofNullable(myAttributes.get(theKey));
} | java | public Optional<String> getAttribute(String theKey) {
Validate.notBlank(theKey);
if (myAttributes == null) {
return Optional.empty();
}
return Optional.ofNullable(myAttributes.get(theKey));
} | [
"public",
"Optional",
"<",
"String",
">",
"getAttribute",
"(",
"String",
"theKey",
")",
"{",
"Validate",
".",
"notBlank",
"(",
"theKey",
")",
";",
"if",
"(",
"myAttributes",
"==",
"null",
")",
"{",
"return",
"Optional",
".",
"empty",
"(",
")",
";",
"}"... | Returns an attribute stored in this message.
<p>
Attributes are just a spot for user data of any kind to be
added to the message for pasing along the subscription processing
pipeline (typically by interceptors). Values will be carried from the beginning to the end.
</p>
<p>
Note that messages are designed to be passed ... | [
"Returns",
"an",
"attribute",
"stored",
"in",
"this",
"message",
".",
"<p",
">",
"Attributes",
"are",
"just",
"a",
"spot",
"for",
"user",
"data",
"of",
"any",
"kind",
"to",
"be",
"added",
"to",
"the",
"message",
"for",
"pasing",
"along",
"the",
"subscrip... | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/subscriber/BaseResourceMessage.java#L53-L59 | train | Get the value of the specified attribute | Of course, here is the Java code you requested:
```java
public Optional<String> getAttribute(String theKey) {
Validate.notBlank(theKey);
if (myAttributes == null) {
return Optional.empty();
}
return Optional.ofNullable(myAttributes.get(theKey));
}
```
Hope this helps! |
jenkinsci/jenkins | core/src/main/java/hudson/model/FingerprintCleanupThread.java | FingerprintCleanupThread.check | private boolean check(File fingerprintFile, TaskListener listener) {
try {
Fingerprint fp = loadFingerprint(fingerprintFile);
if (fp == null || !fp.isAlive()) {
listener.getLogger().println("deleting obsolete " + fingerprintFile);
fingerprintFile.delete();... | java | private boolean check(File fingerprintFile, TaskListener listener) {
try {
Fingerprint fp = loadFingerprint(fingerprintFile);
if (fp == null || !fp.isAlive()) {
listener.getLogger().println("deleting obsolete " + fingerprintFile);
fingerprintFile.delete();... | [
"private",
"boolean",
"check",
"(",
"File",
"fingerprintFile",
",",
"TaskListener",
"listener",
")",
"{",
"try",
"{",
"Fingerprint",
"fp",
"=",
"loadFingerprint",
"(",
"fingerprintFile",
")",
";",
"if",
"(",
"fp",
"==",
"null",
"||",
"!",
"fp",
".",
"isAli... | Examines the file and returns true if a file was deleted. | [
"Examines",
"the",
"file",
"and",
"returns",
"true",
"if",
"a",
"file",
"was",
"deleted",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/FingerprintCleanupThread.java#L107-L124 | train | Check the fingerprint file for obsolete or not alive fingerprints. | Of course, here is the Java code you requested:
```java
private boolean check(File fingerprintFile, TaskListener listener) {
try {
Fingerprint fp = loadFingerprint(fingerprintFile);
if (fp == null || !fp.isAlive()) {
listener.getLogger().println("deleting obsolete " + fi... |
michael-rapp/AndroidMaterialDialog | library/src/main/java/de/mrapp/android/dialog/animation/DialogAnimation.java | DialogAnimation.setAlpha | protected final void setAlpha(final float alpha) {
Condition.INSTANCE.ensureAtLeast(alpha, 0, "The alpha must be at least 0");
Condition.INSTANCE.ensureAtMaximum(alpha, 1, "The alpha must be at maximum 1");
this.alpha = alpha;
} | java | protected final void setAlpha(final float alpha) {
Condition.INSTANCE.ensureAtLeast(alpha, 0, "The alpha must be at least 0");
Condition.INSTANCE.ensureAtMaximum(alpha, 1, "The alpha must be at maximum 1");
this.alpha = alpha;
} | [
"protected",
"final",
"void",
"setAlpha",
"(",
"final",
"float",
"alpha",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureAtLeast",
"(",
"alpha",
",",
"0",
",",
"\"The alpha must be at least 0\"",
")",
";",
"Condition",
".",
"INSTANCE",
".",
"ensureAtMaximum... | Sets the alpha, which should be used by the animation.
@param alpha
The alpha, which should be set, as a {@link Float} value. The alpha must be at least
0 and at maximum 1 | [
"Sets",
"the",
"alpha",
"which",
"should",
"be",
"used",
"by",
"the",
"animation",
"."
] | 8990eed72ee5f5a9720836ee708f71ac0d43053b | https://github.com/michael-rapp/AndroidMaterialDialog/blob/8990eed72ee5f5a9720836ee708f71ac0d43053b/library/src/main/java/de/mrapp/android/dialog/animation/DialogAnimation.java#L178-L182 | train | Sets the alpha value. | Of course, here is the Java code you requested:
```java
protected final void setAlpha(final float alpha) {
Condition.INSTANCE.ensureAtLeast(alpha, 0, "The alpha must be at least 0");
Condition.INSTANCE.ensureAtMaximum(alpha, 1, "The alpha must be at maximum 1");
this.alpha = alpha;
}
```
H... |
querydsl/querydsl | querydsl-spatial/src/main/java/com/querydsl/spatial/jts/JTSPolygonExpression.java | JTSPolygonExpression.interiorRingN | public JTSLineStringExpression<LineString> interiorRingN(int idx) {
return JTSGeometryExpressions.lineStringOperation(SpatialOps.INTERIOR_RINGN, mixin, ConstantImpl.create(idx));
} | java | public JTSLineStringExpression<LineString> interiorRingN(int idx) {
return JTSGeometryExpressions.lineStringOperation(SpatialOps.INTERIOR_RINGN, mixin, ConstantImpl.create(idx));
} | [
"public",
"JTSLineStringExpression",
"<",
"LineString",
">",
"interiorRingN",
"(",
"int",
"idx",
")",
"{",
"return",
"JTSGeometryExpressions",
".",
"lineStringOperation",
"(",
"SpatialOps",
".",
"INTERIOR_RINGN",
",",
"mixin",
",",
"ConstantImpl",
".",
"create",
"("... | Returns the N th interior ring for this Polygon as a LineString.
@param idx one based index
@return interior ring at index | [
"Returns",
"the",
"N",
"th",
"interior",
"ring",
"for",
"this",
"Polygon",
"as",
"a",
"LineString",
"."
] | 2bf234caf78549813a1e0f44d9c30ecc5ef734e3 | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-spatial/src/main/java/com/querydsl/spatial/jts/JTSPolygonExpression.java#L79-L81 | train | Create a new interior ring expression | Of course, here is the Java code you requested:
```java
public JTSLineStringExpression<LineString> interiorRingN(int idx) {
return JTSGeometryExpressions.lineStringOperation(SpatialOps.INTERIOR_RINGN, mixin, ConstantImpl.create(idx));
}
```
Hope this helps! |
JOML-CI/JOML | src/org/joml/Intersectionf.java | Intersectionf.computeLowestRoot | private static float computeLowestRoot(float a, float b, float c, float maxR) {
float determinant = b * b - 4.0f * a * c;
if (determinant < 0.0f)
return Float.POSITIVE_INFINITY;
float sqrtD = (float) Math.sqrt(determinant);
float r1 = (-b - sqrtD) / (2.0f * a);
float ... | java | private static float computeLowestRoot(float a, float b, float c, float maxR) {
float determinant = b * b - 4.0f * a * c;
if (determinant < 0.0f)
return Float.POSITIVE_INFINITY;
float sqrtD = (float) Math.sqrt(determinant);
float r1 = (-b - sqrtD) / (2.0f * a);
float ... | [
"private",
"static",
"float",
"computeLowestRoot",
"(",
"float",
"a",
",",
"float",
"b",
",",
"float",
"c",
",",
"float",
"maxR",
")",
"{",
"float",
"determinant",
"=",
"b",
"*",
"b",
"-",
"4.0f",
"*",
"a",
"*",
"c",
";",
"if",
"(",
"determinant",
... | Compute the lowest root for <code>t</code> in the quadratic equation <code>a*t*t + b*t + c = 0</code>.
<p>
This is a helper method for {@link #intersectSweptSphereTriangle}
@param a
the quadratic factor
@param b
the linear factor
@param c
the constant
@param maxR
the maximum expected root
@return the lowest of the two... | [
"Compute",
"the",
"lowest",
"root",
"for",
"<code",
">",
"t<",
"/",
"code",
">",
"in",
"the",
"quadratic",
"equation",
"<code",
">",
"a",
"*",
"t",
"*",
"t",
"+",
"b",
"*",
"t",
"+",
"c",
"=",
"0<",
"/",
"code",
">",
".",
"<p",
">",
"This",
"... | ce2652fc236b42bda3875c591f8e6645048a678f | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectionf.java#L1959-L1978 | train | Compute the lowest root of two logarithmic terms. | Of course, here is the Java code you requested:
```java
private static float computeLowestRoot(float a, float b, float c, float maxR) {
float determinant = b * b - 4.0f * a * c;
if (determinant < 0.0f)
return Float.POSITIVE_INFINITY;
float sqrtD = (float) Math.sqrt(determinant);
... |
opensourceBIM/BIMserver | PluginBase/generated/org/bimserver/models/geometry/impl/GeometryPackageImpl.java | GeometryPackageImpl.getGeometryData | public EClass getGeometryData() {
if (geometryDataEClass == null) {
geometryDataEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(GeometryPackage.eNS_URI).getEClassifiers().get(4);
}
return geometryDataEClass;
} | java | public EClass getGeometryData() {
if (geometryDataEClass == null) {
geometryDataEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(GeometryPackage.eNS_URI).getEClassifiers().get(4);
}
return geometryDataEClass;
} | [
"public",
"EClass",
"getGeometryData",
"(",
")",
"{",
"if",
"(",
"geometryDataEClass",
"==",
"null",
")",
"{",
"geometryDataEClass",
"=",
"(",
"EClass",
")",
"EPackage",
".",
"Registry",
".",
"INSTANCE",
".",
"getEPackage",
"(",
"GeometryPackage",
".",
"eNS_UR... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 116803c3047d1b32217366757cee1bb3880fda63 | https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/geometry/impl/GeometryPackageImpl.java#L461-L466 | train | Get the geometry dataEClass | Of course, here is the Java code you requested:
```java
public EClass getGeometryData() {
if (geometryDataEClass == null) {
geometryDataEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(GeometryPackage.eNS_URI).getEClassifiers().get(4);
}
return geometryDataEClass;
}
```
Hope this helps! |
alkacon/opencms-core | src/org/opencms/workplace/explorer/CmsResourceUtil.java | CmsResourceUtil.getFullPath | public String getFullPath() {
String path = m_resource.getRootPath();
if ((m_siteMode != SITE_MODE_ROOT) && (m_cms != null)) {
String site = getSite();
if (path.startsWith(site)) {
path = path.substring(site.length());
}
}
return path;... | java | public String getFullPath() {
String path = m_resource.getRootPath();
if ((m_siteMode != SITE_MODE_ROOT) && (m_cms != null)) {
String site = getSite();
if (path.startsWith(site)) {
path = path.substring(site.length());
}
}
return path;... | [
"public",
"String",
"getFullPath",
"(",
")",
"{",
"String",
"path",
"=",
"m_resource",
".",
"getRootPath",
"(",
")",
";",
"if",
"(",
"(",
"m_siteMode",
"!=",
"SITE_MODE_ROOT",
")",
"&&",
"(",
"m_cms",
"!=",
"null",
")",
")",
"{",
"String",
"site",
"=",... | Returns the path of the current resource, taking into account just the site mode.<p>
@return the full path | [
"Returns",
"the",
"path",
"of",
"the",
"current",
"resource",
"taking",
"into",
"account",
"just",
"the",
"site",
"mode",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/explorer/CmsResourceUtil.java#L418-L428 | train | Get the full path of the resource. | Of course, here is the Java code you requested:
```java
public String getFullPath() {
String path = m_resource.getRootPath();
if ((m_siteMode != SITE_MODE_ROOT) && (m_cms != null)) {
String site = getSite();
if (path.startsWith(site)) {
path = path.substring(sit... |
mpetazzoni/ttorrent | ttorrent-client/src/main/java/com/turn/ttorrent/client/peer/SharingPeer.java | SharingPeer.send | public void send(PeerMessage message) throws IllegalStateException {
logger.trace("Sending msg {} to {}", message.getType(), this);
if (this.isConnected()) {
ByteBuffer data = message.getData();
data.rewind();
connectionManager.offerWrite(new WriteTask(socketChannel, data, new WriteListener() ... | java | public void send(PeerMessage message) throws IllegalStateException {
logger.trace("Sending msg {} to {}", message.getType(), this);
if (this.isConnected()) {
ByteBuffer data = message.getData();
data.rewind();
connectionManager.offerWrite(new WriteTask(socketChannel, data, new WriteListener() ... | [
"public",
"void",
"send",
"(",
"PeerMessage",
"message",
")",
"throws",
"IllegalStateException",
"{",
"logger",
".",
"trace",
"(",
"\"Sending msg {} to {}\"",
",",
"message",
".",
"getType",
"(",
")",
",",
"this",
")",
";",
"if",
"(",
"this",
".",
"isConnect... | Send a message to the peer.
<p/>
<p>
Delivery of the message can only happen if the peer is connected.
</p>
@param message The message to send to the remote peer through our peer
exchange. | [
"Send",
"a",
"message",
"to",
"the",
"peer",
".",
"<p",
"/",
">",
"<p",
">",
"Delivery",
"of",
"the",
"message",
"can",
"only",
"happen",
"if",
"the",
"peer",
"is",
"connected",
".",
"<",
"/",
"p",
">"
] | ecd0e6caf853b63393c4ab63cfd8f20114f73f70 | https://github.com/mpetazzoni/ttorrent/blob/ecd0e6caf853b63393c4ab63cfd8f20114f73f70/ttorrent-client/src/main/java/com/turn/ttorrent/client/peer/SharingPeer.java#L328-L355 | train | Sends a message to the peer. | Of course, here is the Java code you requested:
```java
public void send(PeerMessage message) throws IllegalStateException {
logger.trace("Sending msg {} to {}", message.getType(), this);
if (this.isConnected()) {
ByteBuffer data = message.getData();
data.rewind();
connectionManager.offerWrit... |
mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/NamespaceChangeStreamListener.java | NamespaceChangeStreamListener.stop | public void stop() {
if (runnerThread == null) {
return;
}
runnerThread.interrupt();
nsLock.writeLock().lock();
try {
if (runnerThread == null) {
return;
}
this.cancel();
this.close();
while (runnerThread.isAlive()) {
runnerThread.interrupt();
... | java | public void stop() {
if (runnerThread == null) {
return;
}
runnerThread.interrupt();
nsLock.writeLock().lock();
try {
if (runnerThread == null) {
return;
}
this.cancel();
this.close();
while (runnerThread.isAlive()) {
runnerThread.interrupt();
... | [
"public",
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"runnerThread",
"==",
"null",
")",
"{",
"return",
";",
"}",
"runnerThread",
".",
"interrupt",
"(",
")",
";",
"nsLock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"... | Stops the background stream thread. | [
"Stops",
"the",
"background",
"stream",
"thread",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/NamespaceChangeStreamListener.java#L109-L140 | train | Stop the runner thread. | Of course, here is the Java code you requested:
```java
public void stop() {
if (runnerThread == null) {
return;
}
runnerThread.interrupt();
nsLock.writeLock().lock();
try {
if (runnerThread == null) {
return;
}
this.cancel();
this.close();
while (run... |
neo4j-contrib/neo4j-apoc-procedures | src/main/java/apoc/generate/relationship/ErdosRenyiRelationshipGenerator.java | ErdosRenyiRelationshipGenerator.doGenerateEdgesWithOmitList | private List<Pair<Integer, Integer>> doGenerateEdgesWithOmitList() {
final int numberOfNodes = getConfiguration().getNumberOfNodes();
final int numberOfEdges = getConfiguration().getNumberOfEdges();
final long maxEdges = numberOfNodes * (numberOfNodes - 1) / 2;
final List<Pair<Integer, ... | java | private List<Pair<Integer, Integer>> doGenerateEdgesWithOmitList() {
final int numberOfNodes = getConfiguration().getNumberOfNodes();
final int numberOfEdges = getConfiguration().getNumberOfEdges();
final long maxEdges = numberOfNodes * (numberOfNodes - 1) / 2;
final List<Pair<Integer, ... | [
"private",
"List",
"<",
"Pair",
"<",
"Integer",
",",
"Integer",
">",
">",
"doGenerateEdgesWithOmitList",
"(",
")",
"{",
"final",
"int",
"numberOfNodes",
"=",
"getConfiguration",
"(",
")",
".",
"getNumberOfNodes",
"(",
")",
";",
"final",
"int",
"numberOfEdges",... | Improved implementation of Erdos-Renyi generator based on bijection from
edge labels to edge realisations. Works very well for large number of nodes,
but is slow with increasing number of edges. Best for denser networks, with
a clear giant component.
@return edge list | [
"Improved",
"implementation",
"of",
"Erdos",
"-",
"Renyi",
"generator",
"based",
"on",
"bijection",
"from",
"edge",
"labels",
"to",
"edge",
"realisations",
".",
"Works",
"very",
"well",
"for",
"large",
"number",
"of",
"nodes",
"but",
"is",
"slow",
"with",
"i... | e8386975d1c512c0e4388a1a61f5496121c04f86 | https://github.com/neo4j-contrib/neo4j-apoc-procedures/blob/e8386975d1c512c0e4388a1a61f5496121c04f86/src/main/java/apoc/generate/relationship/ErdosRenyiRelationshipGenerator.java#L87-L99 | train | Generate edges with omit list. | Of course, here is the Java code you requested:
```java
private List<Pair<Integer, Integer>> doGenerateEdgesWithOmitList() {
final int numberOfNodes = getConfiguration().getNumberOfNodes();
final int numberOfEdges = getConfiguration().getNumberOfEdges();
final long maxEdges = numberOfNodes * (n... |
micrometer-metrics/micrometer | implementations/micrometer-registry-signalfx/src/main/java/io/micrometer/signalfx/SignalFxNamingConvention.java | SignalFxNamingConvention.tagKey | @Override
public String tagKey(String key) {
String conventionKey = delegate.tagKey(key);
conventionKey = START_UNDERSCORE_PATTERN.matcher(conventionKey).replaceAll(""); // 2
conventionKey = SF_PATTERN.matcher(conventionKey).replaceAll(""); // 2
if (!START_LETTERS_PATTERN.matcher(c... | java | @Override
public String tagKey(String key) {
String conventionKey = delegate.tagKey(key);
conventionKey = START_UNDERSCORE_PATTERN.matcher(conventionKey).replaceAll(""); // 2
conventionKey = SF_PATTERN.matcher(conventionKey).replaceAll(""); // 2
if (!START_LETTERS_PATTERN.matcher(c... | [
"@",
"Override",
"public",
"String",
"tagKey",
"(",
"String",
"key",
")",
"{",
"String",
"conventionKey",
"=",
"delegate",
".",
"tagKey",
"(",
"key",
")",
";",
"conventionKey",
"=",
"START_UNDERSCORE_PATTERN",
".",
"matcher",
"(",
"conventionKey",
")",
".",
... | ^[a-zA-Z][a-zA-Z0-9_-]*$ | [
"^",
"[",
"a",
"-",
"zA",
"-",
"Z",
"]",
"[",
"a",
"-",
"zA",
"-",
"Z0",
"-",
"9_",
"-",
"]",
"*",
"$"
] | 127fa3265325cc894f368312ed8890b76a055d88 | https://github.com/micrometer-metrics/micrometer/blob/127fa3265325cc894f368312ed8890b76a055d88/implementations/micrometer-registry-signalfx/src/main/java/io/micrometer/signalfx/SignalFxNamingConvention.java#L62-L73 | train | Override tagKey to return a tag key. | Of course, here is the Java code you requested:
```java
@Override
public String tagKey(String key) {
String conventionKey = delegate.tagKey(key);
conventionKey = START_UNDERSCORE_PATTERN.matcher(conventionKey).replaceAll(""); // 2
conventionKey = SF_PATTERN.matcher(conventionKey).replaceAl... |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbPeople.java | TmdbPeople.getPersonCombinedCredits | public PersonCreditList<CreditBasic> getPersonCombinedCredits(int personId, String language) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, personId);
parameters.add(Param.LANGUAGE, language);
URL url = new ApiUrl(apiKey, MethodBase.... | java | public PersonCreditList<CreditBasic> getPersonCombinedCredits(int personId, String language) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, personId);
parameters.add(Param.LANGUAGE, language);
URL url = new ApiUrl(apiKey, MethodBase.... | [
"public",
"PersonCreditList",
"<",
"CreditBasic",
">",
"getPersonCombinedCredits",
"(",
"int",
"personId",
",",
"String",
"language",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",
";",
"parameters",
"... | Get the combined (movie and TV) credits for a specific person id.
To get the expanded details for each TV record, call the /credit method
with the provided credit_id.
This will provide details about which episode and/or season the credit is
for.
@param personId
@param language
@return
@throws MovieDbException | [
"Get",
"the",
"combined",
"(",
"movie",
"and",
"TV",
")",
"credits",
"for",
"a",
"specific",
"person",
"id",
"."
] | bf132d7c7271734e13b58ba3bc92bba46f220118 | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbPeople.java#L169-L186 | train | Get the person combined credits. | Of course, here is the Java code you requested:
```java
public PersonCreditList<CreditBasic> getPersonCombinedCredits(int personId, String language) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, personId);
parameters.add(Param.LANGUAGE, lan... |
Jasig/uPortal | uPortal-web/src/main/java/org/apereo/portal/portlet/container/services/PortletCookieServiceImpl.java | PortletCookieServiceImpl.removeExpiredPortletCookies | protected void removeExpiredPortletCookies(HttpServletRequest request) {
Map<String, SessionOnlyPortletCookieImpl> sessionOnlyCookies =
getSessionOnlyPortletCookieMap(request);
for (Entry<String, SessionOnlyPortletCookieImpl> entry : sessionOnlyCookies.entrySet()) {
String ke... | java | protected void removeExpiredPortletCookies(HttpServletRequest request) {
Map<String, SessionOnlyPortletCookieImpl> sessionOnlyCookies =
getSessionOnlyPortletCookieMap(request);
for (Entry<String, SessionOnlyPortletCookieImpl> entry : sessionOnlyCookies.entrySet()) {
String ke... | [
"protected",
"void",
"removeExpiredPortletCookies",
"(",
"HttpServletRequest",
"request",
")",
"{",
"Map",
"<",
"String",
",",
"SessionOnlyPortletCookieImpl",
">",
"sessionOnlyCookies",
"=",
"getSessionOnlyPortletCookieMap",
"(",
"request",
")",
";",
"for",
"(",
"Entry"... | Remove expired session only portlet cookies.
@param request | [
"Remove",
"expired",
"session",
"only",
"portlet",
"cookies",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-web/src/main/java/org/apereo/portal/portlet/container/services/PortletCookieServiceImpl.java#L207-L217 | train | Removes Session Only Portlet Cookies from the request. | Of course, here is the Java code you requested:
```java
protected void removeExpiredPortletCookies(HttpServletRequest request) {
Map<String, SessionOnlyPortletCookieImpl> sessionOnlyCookies =
getSessionOnlyPortletCookieMap(request);
for (Entry<String, SessionOnlyPortletCookieImpl> entry... |
jbundle/jbundle | base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HBasePanel.java | HBasePanel.printHtmlLogo | public void printHtmlLogo(PrintWriter out, ResourceBundle reg)
throws DBException
{
char chMenubar = HBasePanel.getFirstToUpper(this.getProperty(DBParams.LOGOS), 'H');
if (chMenubar == 'H') if (((BasePanel)this.getScreenField()).isMainMenu())
chMenubar = 'Y';
if (chMenuba... | java | public void printHtmlLogo(PrintWriter out, ResourceBundle reg)
throws DBException
{
char chMenubar = HBasePanel.getFirstToUpper(this.getProperty(DBParams.LOGOS), 'H');
if (chMenubar == 'H') if (((BasePanel)this.getScreenField()).isMainMenu())
chMenubar = 'Y';
if (chMenuba... | [
"public",
"void",
"printHtmlLogo",
"(",
"PrintWriter",
"out",
",",
"ResourceBundle",
"reg",
")",
"throws",
"DBException",
"{",
"char",
"chMenubar",
"=",
"HBasePanel",
".",
"getFirstToUpper",
"(",
"this",
".",
"getProperty",
"(",
"DBParams",
".",
"LOGOS",
")",
... | Print the top nav menu.
@param out The html out stream.
@param reg The resources object.
@exception DBException File exception. | [
"Print",
"the",
"top",
"nav",
"menu",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HBasePanel.java#L267-L288 | train | PrintHtmlLogo Method. | Of course, here is the Java code you requested:
```java
public void printHtmlLogo(PrintWriter out, ResourceBundle reg)
throws DBException
{
char chMenubar = HBasePanel.getFirstToUpper(this.getProperty(DBParams.LOGOS), 'H');
if (chMenubar == 'H') if (((BasePanel)this.getScreenField()).isMain... |
deib-polimi/SPF2 | sPFApp/src/main/java/it/polimi/spf/app/fragments/groupinfo/ClientsRecyclerViewAdapter.java | ClientsRecyclerViewAdapter.onBindViewHolder | @Override
public void onBindViewHolder(ViewHolder viewHolder, final int position) {
final DeviceGuiElement device = ClientsGuiList.get().getClients().get(position);
viewHolder.identifierTextView.setText(device.getIdentifier());
viewHolder.logo.setImageDrawable(new IconicsDrawable(context)
... | java | @Override
public void onBindViewHolder(ViewHolder viewHolder, final int position) {
final DeviceGuiElement device = ClientsGuiList.get().getClients().get(position);
viewHolder.identifierTextView.setText(device.getIdentifier());
viewHolder.logo.setImageDrawable(new IconicsDrawable(context)
... | [
"@",
"Override",
"public",
"void",
"onBindViewHolder",
"(",
"ViewHolder",
"viewHolder",
",",
"final",
"int",
"position",
")",
"{",
"final",
"DeviceGuiElement",
"device",
"=",
"ClientsGuiList",
".",
"get",
"(",
")",
".",
"getClients",
"(",
")",
".",
"get",
"(... | Replace the contents of a view (invoked by the layout manager) | [
"Replace",
"the",
"contents",
"of",
"a",
"view",
"(",
"invoked",
"by",
"the",
"layout",
"manager",
")"
] | c5a856ab29116a671fe9bef7035f3efb605dc2a1 | https://github.com/deib-polimi/SPF2/blob/c5a856ab29116a671fe9bef7035f3efb605dc2a1/sPFApp/src/main/java/it/polimi/spf/app/fragments/groupinfo/ClientsRecyclerViewAdapter.java#L80-L96 | valid | Bind view holder to a specific position of the view. | Of course, here is the Java code you requested:
```java
@Override
public void onBindViewHolder(ViewHolder viewHolder, final int position) {
final DeviceGuiElement device = ClientsGuiList.get().getClients().get(position);
viewHolder.identifierTextView.setText(device.getIdentifier());
viewHo... |
Unidata/thredds | dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4DSP.java | Nc4DSP.note | void
note(Notes note)
{
assert (this.allnotes != null);
int gid = note.gid;
int id = note.id;
NoteSort sort = note.getSort();
Map<Long, Notes> sortnotes = this.allnotes.get(sort);
assert sortnotes != null;
switch (sort) {
case TYPE:
... | java | void
note(Notes note)
{
assert (this.allnotes != null);
int gid = note.gid;
int id = note.id;
NoteSort sort = note.getSort();
Map<Long, Notes> sortnotes = this.allnotes.get(sort);
assert sortnotes != null;
switch (sort) {
case TYPE:
... | [
"void",
"note",
"(",
"Notes",
"note",
")",
"{",
"assert",
"(",
"this",
".",
"allnotes",
"!=",
"null",
")",
";",
"int",
"gid",
"=",
"note",
".",
"gid",
";",
"int",
"id",
"=",
"note",
".",
"id",
";",
"NoteSort",
"sort",
"=",
"note",
".",
"getSort",... | /*package | [
"/",
"*",
"package"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4DSP.java#L143-L165 | test | Add a node to the CRS table. | Of course, here is the Java code you requested:
```java
void
note(Notes note)
{
assert (this.allnotes != null);
int gid = note.gid;
int id = note.id;
NoteSort sort = note.getSort();
Map<Long, Notes> sortnotes = this.allnotes.get(sort);
assert sortnotes != null;
... |
gallandarakhneorg/afc | advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d3/ifx/RectangularPrism3ifx.java | RectangularPrism3ifx.depthProperty | @Pure
public IntegerProperty depthProperty() {
if (this.depth == null) {
this.depth = new ReadOnlyIntegerWrapper(this, MathFXAttributeNames.DEPTH);
this.depth.bind(Bindings.subtract(maxZProperty(), minZProperty()));
}
return this.depth;
} | java | @Pure
public IntegerProperty depthProperty() {
if (this.depth == null) {
this.depth = new ReadOnlyIntegerWrapper(this, MathFXAttributeNames.DEPTH);
this.depth.bind(Bindings.subtract(maxZProperty(), minZProperty()));
}
return this.depth;
} | [
"@",
"Pure",
"public",
"IntegerProperty",
"depthProperty",
"(",
")",
"{",
"if",
"(",
"this",
".",
"depth",
"==",
"null",
")",
"{",
"this",
".",
"depth",
"=",
"new",
"ReadOnlyIntegerWrapper",
"(",
"this",
",",
"MathFXAttributeNames",
".",
"DEPTH",
")",
";",... | Replies the property that is the depth of the box.
@return the depth property. | [
"Replies",
"the",
"property",
"that",
"is",
"the",
"depth",
"of",
"the",
"box",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d3/ifx/RectangularPrism3ifx.java#L397-L404 | train | Replies the depth property. | Of course, here is the Java code you requested:
```java
@Pure
public IntegerProperty depthProperty() {
if (this.depth == null) {
this.depth = new ReadOnlyIntegerWrapper(this, MathFXAttributeNames.DEPTH);
this.depth.bind(Bindings.subtract(maxZProperty(), minZProperty()));
}
return this.depth;
}
```
Hope ... |
lucee/Lucee | core/src/main/java/lucee/transformer/interpreter/op/OpDouble.java | OpDouble.toExprDouble | public static ExprDouble toExprDouble(Expression left, Expression right, int operation) {
return new OpDouble(left, right, operation);
} | java | public static ExprDouble toExprDouble(Expression left, Expression right, int operation) {
return new OpDouble(left, right, operation);
} | [
"public",
"static",
"ExprDouble",
"toExprDouble",
"(",
"Expression",
"left",
",",
"Expression",
"right",
",",
"int",
"operation",
")",
"{",
"return",
"new",
"OpDouble",
"(",
"left",
",",
"right",
",",
"operation",
")",
";",
"}"
] | Create a String expression from a Expression
@param left
@param right
@param operation
@return String expression
@throws TemplateException | [
"Create",
"a",
"String",
"expression",
"from",
"a",
"Expression"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/interpreter/op/OpDouble.java#L48-L50 | train | Create a Double expression from the given expressions. | Of course, here is the Java code you requested:
```java
public static ExprDouble toExprDouble(Expression left, Expression right, int operation) {
return new OpDouble(left, right, operation);
}
```
Hope this helps! |
RuedigerMoeller/kontraktor | modules/kontraktor-http/src/main/java/org/nustaq/kontraktor/remoting/http/undertow/HttpPublisher.java | HttpPublisher.toWS | public WebSocketPublisher toWS() {
return new WebSocketPublisher()
.coding(coding)
.facade(facade)
.hostName(hostName)
.port(port)
.urlPath(urlPath);
} | java | public WebSocketPublisher toWS() {
return new WebSocketPublisher()
.coding(coding)
.facade(facade)
.hostName(hostName)
.port(port)
.urlPath(urlPath);
} | [
"public",
"WebSocketPublisher",
"toWS",
"(",
")",
"{",
"return",
"new",
"WebSocketPublisher",
"(",
")",
".",
"coding",
"(",
"coding",
")",
".",
"facade",
"(",
"facade",
")",
".",
"hostName",
"(",
"hostName",
")",
".",
"port",
"(",
"port",
")",
".",
"ur... | enables sharing of common settings if publishing also as websocket service
@return | [
"enables",
"sharing",
"of",
"common",
"settings",
"if",
"publishing",
"also",
"as",
"websocket",
"service"
] | d5f3817f9476f3786187b8ef00400b7a4f25a404 | https://github.com/RuedigerMoeller/kontraktor/blob/d5f3817f9476f3786187b8ef00400b7a4f25a404/modules/kontraktor-http/src/main/java/org/nustaq/kontraktor/remoting/http/undertow/HttpPublisher.java#L89-L96 | train | Create a new instance of the class. | Of course, here is the Java code you requested:
```java
public WebSocketPublisher toWS() {
return new WebSocketPublisher()
.coding(coding)
.facade(facade)
.hostName(hostName)
.port(port)
.urlPath(urlPath);
}
```
Hope this helps! |
opensourceBIM/BIMserver | PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/IfcLightIntensityDistributionImpl.java | IfcLightIntensityDistributionImpl.getDistributionData | @SuppressWarnings("unchecked")
public EList<IfcLightDistributionData> getDistributionData() {
return (EList<IfcLightDistributionData>) eGet(
Ifc2x3tc1Package.Literals.IFC_LIGHT_INTENSITY_DISTRIBUTION__DISTRIBUTION_DATA, true);
} | java | @SuppressWarnings("unchecked")
public EList<IfcLightDistributionData> getDistributionData() {
return (EList<IfcLightDistributionData>) eGet(
Ifc2x3tc1Package.Literals.IFC_LIGHT_INTENSITY_DISTRIBUTION__DISTRIBUTION_DATA, true);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"EList",
"<",
"IfcLightDistributionData",
">",
"getDistributionData",
"(",
")",
"{",
"return",
"(",
"EList",
"<",
"IfcLightDistributionData",
">",
")",
"eGet",
"(",
"Ifc2x3tc1Package",
".",
"Literals",
... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 116803c3047d1b32217366757cee1bb3880fda63 | https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/IfcLightIntensityDistributionImpl.java#L113-L117 | train | Gets the Reference to the list of DistributionData elements in this IfcLightIntent. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public EList<IfcLightDistributionData> getDistributionData() {
return (EList<IfcLightDistributionData>) eGet(
Ifc2x3tc1Package.Literals.IFC_LIGHT_INTENSITY_DISTRIBUTION__DISTRIBUTION_DATA, true);
}
```
Hope this helps! |
mygreen/excel-cellformatter | src/main/java/com/github/mygreen/cellformatter/lang/MSColor.java | MSColor.valueOfKnownColor | public static MSColor valueOfKnownColor(final String name) {
for(MSColor color : KNOWN_COLORS) {
if(color.name.equalsIgnoreCase(name)) {
return color;
} else if(color.getLocaleName() != null && color.getLocaleName().equalsIgnoreCase(name)) ... | java | public static MSColor valueOfKnownColor(final String name) {
for(MSColor color : KNOWN_COLORS) {
if(color.name.equalsIgnoreCase(name)) {
return color;
} else if(color.getLocaleName() != null && color.getLocaleName().equalsIgnoreCase(name)) ... | [
"public",
"static",
"MSColor",
"valueOfKnownColor",
"(",
"final",
"String",
"name",
")",
"{",
"for",
"(",
"MSColor",
"color",
":",
"KNOWN_COLORS",
")",
"{",
"if",
"(",
"color",
".",
"name",
".",
"equalsIgnoreCase",
"(",
"name",
")",
")",
"{",
"return",
"... | 既知の名前付きの色かどうか。
@param name
@return 不明な場合は、nullを返す。 | [
"既知の名前付きの色かどうか。"
] | e802af273d49889500591e03799c9262cbf29185 | https://github.com/mygreen/excel-cellformatter/blob/e802af273d49889500591e03799c9262cbf29185/src/main/java/com/github/mygreen/cellformatter/lang/MSColor.java#L138-L153 | train | Gets the MSColor object for a given name. | Of course, here is the Java code you requested:
```java
public static MSColor valueOfKnownColor(final String name) {
for(MSColor color : KNOWN_COLORS) {
if(color.name.equalsIgnoreCase(name)) {
return color;
} else if(color.getLocaleName() ... |
aws/aws-sdk-java | aws-java-sdk-clouddirectory/src/main/java/com/amazonaws/services/clouddirectory/model/transform/AddFacetToObjectRequestMarshaller.java | AddFacetToObjectRequestMarshaller.marshall | public void marshall(AddFacetToObjectRequest addFacetToObjectRequest, ProtocolMarshaller protocolMarshaller) {
if (addFacetToObjectRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(addFacetTo... | java | public void marshall(AddFacetToObjectRequest addFacetToObjectRequest, ProtocolMarshaller protocolMarshaller) {
if (addFacetToObjectRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(addFacetTo... | [
"public",
"void",
"marshall",
"(",
"AddFacetToObjectRequest",
"addFacetToObjectRequest",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"addFacetToObjectRequest",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Invalid argument... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-clouddirectory/src/main/java/com/amazonaws/services/clouddirectory/model/transform/AddFacetToObjectRequestMarshaller.java#L49-L63 | train | marshalls the given AddFacetToObjectRequest to the given protocolMarshaller. | Of course, here is the Java code you requested:
```java
public void marshall(AddFacetToObjectRequest addFacetToObjectRequest, ProtocolMarshaller protocolMarshaller) {
if (addFacetToObjectRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
... |
undertow-io/undertow | core/src/main/java/io/undertow/server/protocol/framed/AbstractFramedStreamSinkChannel.java | AbstractFramedStreamSinkChannel.send | public boolean send(PooledByteBuffer pooled) throws IOException {
if(isWritesShutdown()) {
throw UndertowMessages.MESSAGES.channelIsClosed();
}
boolean result = sendInternal(pooled);
if(result) {
flush();
}
return result;
} | java | public boolean send(PooledByteBuffer pooled) throws IOException {
if(isWritesShutdown()) {
throw UndertowMessages.MESSAGES.channelIsClosed();
}
boolean result = sendInternal(pooled);
if(result) {
flush();
}
return result;
} | [
"public",
"boolean",
"send",
"(",
"PooledByteBuffer",
"pooled",
")",
"throws",
"IOException",
"{",
"if",
"(",
"isWritesShutdown",
"(",
")",
")",
"{",
"throw",
"UndertowMessages",
".",
"MESSAGES",
".",
"channelIsClosed",
"(",
")",
";",
"}",
"boolean",
"result",... | Send a buffer to this channel.
@param pooled Pooled ByteBuffer to send. The buffer should have data available. This channel will free the buffer
after sending data
@return true if the buffer was accepted; false if the channel needs to first be flushed
@throws IOException if this channel is closed | [
"Send",
"a",
"buffer",
"to",
"this",
"channel",
"."
] | 87de0b856a7a4ba8faf5b659537b9af07b763263 | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/protocol/framed/AbstractFramedStreamSinkChannel.java#L422-L431 | train | Sends a message to the underlying channel. | Of course, here is the Java code you requested:
```java
public boolean send(PooledByteBuffer pooled) throws IOException {
if(isWritesShutdown()) {
throw UndertowMessages.MESSAGES.channelIsClosed();
}
boolean result = sendInternal(pooled);
if(result) {
flush();
... |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/context/DomHelper.java | DomHelper.parse | private String parse(Matrix matrix) {
String transform = "";
if (matrix != null) {
double dx = matrix.getDx();
double dy = matrix.getDy();
if (matrix.getXx() != 0 && matrix.getYy() != 0 && matrix.getXx() != 1 && matrix.getYy() != 1) {
transform += "scale(" + matrix.getXx() + ", " + matrix.getYy() + ")"... | java | private String parse(Matrix matrix) {
String transform = "";
if (matrix != null) {
double dx = matrix.getDx();
double dy = matrix.getDy();
if (matrix.getXx() != 0 && matrix.getYy() != 0 && matrix.getXx() != 1 && matrix.getYy() != 1) {
transform += "scale(" + matrix.getXx() + ", " + matrix.getYy() + ")"... | [
"private",
"String",
"parse",
"(",
"Matrix",
"matrix",
")",
"{",
"String",
"transform",
"=",
"\"\"",
";",
"if",
"(",
"matrix",
"!=",
"null",
")",
"{",
"double",
"dx",
"=",
"matrix",
".",
"getDx",
"(",
")",
";",
"double",
"dy",
"=",
"matrix",
".",
"... | Parse a matrix object into a string, suitable for the SVG 'transform' attribute.
@param matrix
The matrix to parse.
@return The transform string. | [
"Parse",
"a",
"matrix",
"object",
"into",
"a",
"string",
"suitable",
"for",
"the",
"SVG",
"transform",
"attribute",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/DomHelper.java#L527-L542 | train | Parse the matrix to get the transform string | Of course, here is the Java code you requested:
```java
private String parse(Matrix matrix) {
String transform = "";
if (matrix != null) {
double dx = matrix.getDx();
double dy = matrix.getDy();
if (matrix.getXx() != 0 && matrix.getYy() != 0 && matrix.getXx() != 1 && matrix.getYy() != 1) {
transform +... |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyEncoder.java | KeyEncoder.encodeDesc | public static void encodeDesc(Boolean value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_LOW;
} else {
dst[dstOffset] = value.booleanValue() ? (byte)127 : (byte)128;
}
} | java | public static void encodeDesc(Boolean value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_LOW;
} else {
dst[dstOffset] = value.booleanValue() ? (byte)127 : (byte)128;
}
} | [
"public",
"static",
"void",
"encodeDesc",
"(",
"Boolean",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"dst",
"[",
"dstOffset",
"]",
"=",
"NULL_BYTE_LOW",
";",
"}",
"else",
"{",... | Encodes the given Boolean object into exactly 1 byte for descending
order.
@param value optional Boolean value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array | [
"Encodes",
"the",
"given",
"Boolean",
"object",
"into",
"exactly",
"1",
"byte",
"for",
"descending",
"order",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L221-L227 | train | Encodes the given Boolean object into exactly 1 byte in descending order. | Of course, here is the Java code you requested:
```java
public static void encodeDesc(Boolean value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_LOW;
} else {
dst[dstOffset] = value.booleanValue() ? (byte)127 : (byte)128;
}
}
``... |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionVertex.java | ExecutionVertex.updateExecutionStateAsynchronously | public void updateExecutionStateAsynchronously(final ExecutionState newExecutionState,
final String optionalMessage) {
final Runnable command = new Runnable() {
/**
* {@inheritDoc}
*/
@Override
public void run() {
updateExecutionState(newExecutionState, optionalMessage);
}
};
this.e... | java | public void updateExecutionStateAsynchronously(final ExecutionState newExecutionState,
final String optionalMessage) {
final Runnable command = new Runnable() {
/**
* {@inheritDoc}
*/
@Override
public void run() {
updateExecutionState(newExecutionState, optionalMessage);
}
};
this.e... | [
"public",
"void",
"updateExecutionStateAsynchronously",
"(",
"final",
"ExecutionState",
"newExecutionState",
",",
"final",
"String",
"optionalMessage",
")",
"{",
"final",
"Runnable",
"command",
"=",
"new",
"Runnable",
"(",
")",
"{",
"/**\n\t\t\t * {@inheritDoc}\n\t\t\t */... | Updates the vertex's current execution state through the job's executor service.
@param newExecutionState
the new execution state
@param optionalMessage
an optional message related to the state change | [
"Updates",
"the",
"vertex",
"s",
"current",
"execution",
"state",
"through",
"the",
"job",
"s",
"executor",
"service",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionVertex.java#L305-L321 | train | Update the execution state asynchronously. | Of course, here is the Java code you requested:
```java
public void updateExecutionStateAsynchronously(final ExecutionState newExecutionState,
final String optionalMessage) {
final Runnable command = new Runnable() {
/**
* {@inheritDoc}
*/
@Override
public void run() {
updateExecutionState... |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/librarycache/LibraryCacheManager.java | LibraryCacheManager.registerInternal | private void registerInternal(final JobID id, final Path[] clientPaths) throws IOException {
final String[] cacheNames = new String[clientPaths.length];
for (int i = 0; i < clientPaths.length; ++i) {
final LibraryTranslationKey key = new LibraryTranslationKey(id, clientPaths[i]);
cacheNames[i] = this.client... | java | private void registerInternal(final JobID id, final Path[] clientPaths) throws IOException {
final String[] cacheNames = new String[clientPaths.length];
for (int i = 0; i < clientPaths.length; ++i) {
final LibraryTranslationKey key = new LibraryTranslationKey(id, clientPaths[i]);
cacheNames[i] = this.client... | [
"private",
"void",
"registerInternal",
"(",
"final",
"JobID",
"id",
",",
"final",
"Path",
"[",
"]",
"clientPaths",
")",
"throws",
"IOException",
"{",
"final",
"String",
"[",
"]",
"cacheNames",
"=",
"new",
"String",
"[",
"clientPaths",
".",
"length",
"]",
"... | Registers a job ID with a set of library paths that are required to run the job. The library paths are given in
terms
of client paths, so the method first translates the client paths into the corresponding internal cache names. For
every registered
job the library cache manager creates a class loader that is used to in... | [
"Registers",
"a",
"job",
"ID",
"with",
"a",
"set",
"of",
"library",
"paths",
"that",
"are",
"required",
"to",
"run",
"the",
"job",
".",
"The",
"library",
"paths",
"are",
"given",
"in",
"terms",
"of",
"client",
"paths",
"so",
"the",
"method",
"first",
"... | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/librarycache/LibraryCacheManager.java#L246-L260 | train | Register as regular
registerInternal. | Of course, here is the Java code you requested:
```java
private void registerInternal(final JobID id, final Path[] clientPaths) throws IOException {
final String[] cacheNames = new String[clientPaths.length];
for (int i = 0; i < clientPaths.length; ++i) {
final LibraryTranslationKey key = new LibraryTranslati... |
Yubico/yubico-java-client | jaas/src/main/java/com/yubico/jaas/MultiValuePasswordCallback.java | MultiValuePasswordCallback.clearPassword | public void clearPassword() {
for (char pw[] : this.secrets) {
for (int i = 0; i < pw.length; i++) {
pw[i] = 0;
}
}
/* Now discard the list. */
this.secrets = new ArrayList<char []>();
} | java | public void clearPassword() {
for (char pw[] : this.secrets) {
for (int i = 0; i < pw.length; i++) {
pw[i] = 0;
}
}
/* Now discard the list. */
this.secrets = new ArrayList<char []>();
} | [
"public",
"void",
"clearPassword",
"(",
")",
"{",
"for",
"(",
"char",
"pw",
"[",
"]",
":",
"this",
".",
"secrets",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"pw",
".",
"length",
";",
"i",
"++",
")",
"{",
"pw",
"[",
"i",
"]"... | Tries to clear all the passwords from memory. | [
"Tries",
"to",
"clear",
"all",
"the",
"passwords",
"from",
"memory",
"."
] | 263b09c6ab0ee54b0dc7d70516989abab981796f | https://github.com/Yubico/yubico-java-client/blob/263b09c6ab0ee54b0dc7d70516989abab981796f/jaas/src/main/java/com/yubico/jaas/MultiValuePasswordCallback.java#L71-L80 | test | Clear the password. | Of course, here is the Java code you requested:
```java
public void clearPassword() {
for (char pw[] : this.secrets) {
for (int i = 0; i < pw.length; i++) {
pw[i] = 0;
}
}
/* Now discard the list. */
this.secrets = new ArrayList<char []>();
}
```
Hope this helps! |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/utils/WidgetUtil.java | WidgetUtil.getPremadeWidgetHtml | public static String getPremadeWidgetHtml(String guildId, WidgetTheme theme, int width, int height)
{
Checks.notNull(guildId, "GuildId");
Checks.notNull(theme, "WidgetTheme");
Checks.notNegative(width, "Width");
Checks.notNegative(height, "Height");
return String.format(WIDGE... | java | public static String getPremadeWidgetHtml(String guildId, WidgetTheme theme, int width, int height)
{
Checks.notNull(guildId, "GuildId");
Checks.notNull(theme, "WidgetTheme");
Checks.notNegative(width, "Width");
Checks.notNegative(height, "Height");
return String.format(WIDGE... | [
"public",
"static",
"String",
"getPremadeWidgetHtml",
"(",
"String",
"guildId",
",",
"WidgetTheme",
"theme",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"Checks",
".",
"notNull",
"(",
"guildId",
",",
"\"GuildId\"",
")",
";",
"Checks",
".",
"notNull"... | Gets the pre-made HTML Widget for the specified guild using the specified
settings. The widget will only display correctly if the guild in question
has the Widget enabled. Additionally, this method can be used independently
of being on the guild in question.
@param guildId
the guild ID
@param theme
the theme, light ... | [
"Gets",
"the",
"pre",
"-",
"made",
"HTML",
"Widget",
"for",
"the",
"specified",
"guild",
"using",
"the",
"specified",
"settings",
".",
"The",
"widget",
"will",
"only",
"display",
"correctly",
"if",
"the",
"guild",
"in",
"question",
"has",
"the",
"Widget",
... | 8ecbbe354d03f6bf448411bba573d0d4c268b560 | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/utils/WidgetUtil.java#L129-L136 | train | Gets pre - made widget HTML for a guild. | Of course, here is the Java code you requested:
```java
public static String getPremadeWidgetHtml(String guildId, WidgetTheme theme, int width, int height)
{
Checks.notNull(guildId, "GuildId");
Checks.notNull(theme, "WidgetTheme");
Checks.notNegative(width, "Width");
Checks.notNegat... |
PawelAdamski/HttpClientMock | src/main/java/com/github/paweladamski/httpclientmock/HttpClientResponseBuilder.java | HttpClientResponseBuilder.withCookie | public HttpClientResponseBuilder withCookie(String cookieName, String cookieValue) {
Action lastAction = newRule.getLastAction();
CookieAction cookieAction = new CookieAction(lastAction, cookieName, cookieValue);
newRule.overrideLastAction(cookieAction);
return this;
} | java | public HttpClientResponseBuilder withCookie(String cookieName, String cookieValue) {
Action lastAction = newRule.getLastAction();
CookieAction cookieAction = new CookieAction(lastAction, cookieName, cookieValue);
newRule.overrideLastAction(cookieAction);
return this;
} | [
"public",
"HttpClientResponseBuilder",
"withCookie",
"(",
"String",
"cookieName",
",",
"String",
"cookieValue",
")",
"{",
"Action",
"lastAction",
"=",
"newRule",
".",
"getLastAction",
"(",
")",
";",
"CookieAction",
"cookieAction",
"=",
"new",
"CookieAction",
"(",
... | Sets response cookie
@param cookieName cookie name
@param cookieValue cookie value
@return response builder | [
"Sets",
"response",
"cookie"
] | 0205498434bbc0c78c187a51181cac9b266a28fb | https://github.com/PawelAdamski/HttpClientMock/blob/0205498434bbc0c78c187a51181cac9b266a28fb/src/main/java/com/github/paweladamski/httpclientmock/HttpClientResponseBuilder.java#L54-L59 | train | Sets a cookie to be used in the response. | Of course, here is the Java code you requested:
```java
public HttpClientResponseBuilder withCookie(String cookieName, String cookieValue) {
Action lastAction = newRule.getLastAction();
CookieAction cookieAction = new CookieAction(lastAction, cookieName, cookieValue);
newRule.overrideLastAction... |
cdk/cdk | display/renderextra/src/main/java/org/openscience/cdk/renderer/generators/AtomNumberGenerator.java | AtomNumberGenerator.generate | @Override
public IRenderingElement generate(IAtomContainer container, RendererModel model) {
ElementGroup numbers = new ElementGroup();
if (!model.getParameter(WillDrawAtomNumbers.class).getValue()) return numbers;
Vector2d offset = new Vector2d(this.offset.getValue().x, -this.offset.getVal... | java | @Override
public IRenderingElement generate(IAtomContainer container, RendererModel model) {
ElementGroup numbers = new ElementGroup();
if (!model.getParameter(WillDrawAtomNumbers.class).getValue()) return numbers;
Vector2d offset = new Vector2d(this.offset.getValue().x, -this.offset.getVal... | [
"@",
"Override",
"public",
"IRenderingElement",
"generate",
"(",
"IAtomContainer",
"container",
",",
"RendererModel",
"model",
")",
"{",
"ElementGroup",
"numbers",
"=",
"new",
"ElementGroup",
"(",
")",
";",
"if",
"(",
"!",
"model",
".",
"getParameter",
"(",
"W... | {@inheritDoc} | [
"{"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderextra/src/main/java/org/openscience/cdk/renderer/generators/AtomNumberGenerator.java#L119-L136 | train | Generate the CRS element. | Of course, here is the Java code you requested:
```java
@Override
public IRenderingElement generate(IAtomContainer container, RendererModel model) {
ElementGroup numbers = new ElementGroup();
if (!model.getParameter(WillDrawAtomNumbers.class).getValue()) return numbers;
Vector2d offset = n... |
maven-nar/nar-maven-plugin | src/main/java/com/github/maven_nar/AbstractDependencyMojo.java | AbstractDependencyMojo.depLevelOrderList | private List<DependencyNode> depLevelOrderList(DependencyNode rootNode)
{
// Create list to store aggregate list of all nodes in tree
List <DependencyNode> aggDepNodeList = new LinkedList<DependencyNode> ();
// Create list that stores current breadth
List <DependencyNode> nodeChildList = rootNod... | java | private List<DependencyNode> depLevelOrderList(DependencyNode rootNode)
{
// Create list to store aggregate list of all nodes in tree
List <DependencyNode> aggDepNodeList = new LinkedList<DependencyNode> ();
// Create list that stores current breadth
List <DependencyNode> nodeChildList = rootNod... | [
"private",
"List",
"<",
"DependencyNode",
">",
"depLevelOrderList",
"(",
"DependencyNode",
"rootNode",
")",
"{",
"// Create list to store aggregate list of all nodes in tree",
"List",
"<",
"DependencyNode",
">",
"aggDepNodeList",
"=",
"new",
"LinkedList",
"<",
"DependencyNo... | Get List of Nodes of Dependency tree serialised by traversing nodes
in Level-Order way (also called BFS algorithm)
@param rootNode root node of the project Dependency tree
@return the dependency tree string of comma separated list
of groupId:artifactId | [
"Get",
"List",
"of",
"Nodes",
"of",
"Dependency",
"tree",
"serialised",
"by",
"traversing",
"nodes",
"in",
"Level",
"-",
"Order",
"way",
"(",
"also",
"called",
"BFS",
"algorithm",
")"
] | 3c622e2024296b4203431bbae3bde290a01dac00 | https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/AbstractDependencyMojo.java#L347-L362 | train | This method is used to get the list of all dependencies in the tree. | Of course, here is the Java code you requested:
```java
private List<DependencyNode> depLevelOrderList(DependencyNode rootNode)
{
// Create list to store aggregate list of all nodes in tree
List <DependencyNode> aggDepNodeList = new LinkedList<DependencyNode> ();
// Create list that stores current ... |
gturri/aXMLRPC | src/main/java/de/timroes/axmlrpc/AuthenticationManager.java | AuthenticationManager.setAuthentication | public void setAuthentication(HttpURLConnection http) {
if(user == null || pass == null
|| user.length() <= 0 || pass.length() <= 0) {
return;
}
String base64login = Base64.encode(user + ":" + pass);
http.addRequestProperty("Authorization", "Basic " + base64login);
} | java | public void setAuthentication(HttpURLConnection http) {
if(user == null || pass == null
|| user.length() <= 0 || pass.length() <= 0) {
return;
}
String base64login = Base64.encode(user + ":" + pass);
http.addRequestProperty("Authorization", "Basic " + base64login);
} | [
"public",
"void",
"setAuthentication",
"(",
"HttpURLConnection",
"http",
")",
"{",
"if",
"(",
"user",
"==",
"null",
"||",
"pass",
"==",
"null",
"||",
"user",
".",
"length",
"(",
")",
"<=",
"0",
"||",
"pass",
".",
"length",
"(",
")",
"<=",
"0",
")",
... | Set the authentication at the HttpURLConnection.
@param http The HttpURLConnection to set authentication. | [
"Set",
"the",
"authentication",
"at",
"the",
"HttpURLConnection",
"."
] | 8ca6f95f7eb3a28efaef3569d53adddeb32b6bda | https://github.com/gturri/aXMLRPC/blob/8ca6f95f7eb3a28efaef3569d53adddeb32b6bda/src/main/java/de/timroes/axmlrpc/AuthenticationManager.java#L42-L53 | train | Sets the authentication header for the given HTTP connection. | Of course, here is the Java code you requested:
```java
public void setAuthentication(HttpURLConnection http) {
if(user == null || pass == null
|| user.length() <= 0 || pass.length() <= 0) {
return;
}
String base64login = Base64.encode(user + ":" + pass);
http.addRequestProperty("Authorization", "... |
Alluxio/alluxio | shell/src/main/java/alluxio/cli/fs/FileSystemShellUtils.java | FileSystemShellUtils.getIntArg | public static int getIntArg(CommandLine cl, Option option, int defaultValue) {
int arg = defaultValue;
if (cl.hasOption(option.getLongOpt())) {
String argOption = cl.getOptionValue(option.getLongOpt());
arg = Integer.parseInt(argOption);
}
return arg;
} | java | public static int getIntArg(CommandLine cl, Option option, int defaultValue) {
int arg = defaultValue;
if (cl.hasOption(option.getLongOpt())) {
String argOption = cl.getOptionValue(option.getLongOpt());
arg = Integer.parseInt(argOption);
}
return arg;
} | [
"public",
"static",
"int",
"getIntArg",
"(",
"CommandLine",
"cl",
",",
"Option",
"option",
",",
"int",
"defaultValue",
")",
"{",
"int",
"arg",
"=",
"defaultValue",
";",
"if",
"(",
"cl",
".",
"hasOption",
"(",
"option",
".",
"getLongOpt",
"(",
")",
")",
... | Gets the value of an option from the command line.
@param cl command line object
@param option the option to check for in the command line
@param defaultValue default value for the option
@return argument from command line or default if not present | [
"Gets",
"the",
"value",
"of",
"an",
"option",
"from",
"the",
"command",
"line",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/FileSystemShellUtils.java#L231-L238 | train | Get the value of an option as an int | Of course, here is the Java code you requested:
```java
public static int getIntArg(CommandLine cl, Option option, int defaultValue) {
int arg = defaultValue;
if (cl.hasOption(option.getLongOpt())) {
String argOption = cl.getOptionValue(option.getLongOpt());
arg = Integer.parseInt(argOption);
}... |
imsweb/seerapi-client-java | src/main/java/com/imsweb/seerapi/client/publishable/PublishableSearch.java | PublishableSearch.paramMap | public Map<String, String> paramMap() {
Map<String, String> params = new HashMap<>();
if (getQuery() != null)
params.put("q", getQuery());
if (getMode() != null)
params.put("mode", getMode().toString());
if (getStatus() != null)
params.put("status", g... | java | public Map<String, String> paramMap() {
Map<String, String> params = new HashMap<>();
if (getQuery() != null)
params.put("q", getQuery());
if (getMode() != null)
params.put("mode", getMode().toString());
if (getStatus() != null)
params.put("status", g... | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"paramMap",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"params",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"if",
"(",
"getQuery",
"(",
")",
"!=",
"null",
")",
"params",
".",
"put... | Return a map of parameters to be used in the API calls
@return a Map of parameters | [
"Return",
"a",
"map",
"of",
"parameters",
"to",
"be",
"used",
"in",
"the",
"API",
"calls"
] | 04f509961c3a5ece7b232ecb8d8cb8f89d810a85 | https://github.com/imsweb/seerapi-client-java/blob/04f509961c3a5ece7b232ecb8d8cb8f89d810a85/src/main/java/com/imsweb/seerapi/client/publishable/PublishableSearch.java#L138-L167 | train | Returns a map of parameters to be used in the CRASSA request. | Of course, here is the Java code you requested:
```java
public Map<String, String> paramMap() {
Map<String, String> params = new HashMap<>();
if (getQuery() != null)
params.put("q", getQuery());
if (getMode() != null)
params.put("mode", getMode().toString());
if... |
pressgang-ccms/PressGangCCMSContentSpec | src/main/java/org/jboss/pressgang/ccms/contentspec/utils/ContentSpecUtilities.java | ContentSpecUtilities.getFixedURLs | public static Set<String> getFixedURLs(final ContentSpec contentSpec) {
final Set<String> fixedUrls = new HashSet<String>();
for (final Node childNode : contentSpec.getNodes()) {
if (childNode instanceof SpecNode) {
final SpecNode specNode = ((SpecNode) childNode);
... | java | public static Set<String> getFixedURLs(final ContentSpec contentSpec) {
final Set<String> fixedUrls = new HashSet<String>();
for (final Node childNode : contentSpec.getNodes()) {
if (childNode instanceof SpecNode) {
final SpecNode specNode = ((SpecNode) childNode);
... | [
"public",
"static",
"Set",
"<",
"String",
">",
"getFixedURLs",
"(",
"final",
"ContentSpec",
"contentSpec",
")",
"{",
"final",
"Set",
"<",
"String",
">",
"fixedUrls",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"final",
"Node",
... | Gets all the fixed urls from a content specification
@param contentSpec A content spec to get the fixed urls for
@return A set of fixed urls used in the content spec. | [
"Gets",
"all",
"the",
"fixed",
"urls",
"from",
"a",
"content",
"specification"
] | 2bc02e2971e4522b47a130fb7ae5a0f5ad377df1 | https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/utils/ContentSpecUtilities.java#L646-L665 | train | Get the fixed URLs for a Content Specification. | Of course, here is the Java code you requested:
```java
public static Set<String> getFixedURLs(final ContentSpec contentSpec) {
final Set<String> fixedUrls = new HashSet<String>();
for (final Node childNode : contentSpec.getNodes()) {
if (childNode instanceof SpecNode) {
fi... |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/ComponentAPI.java | ComponentAPI.clear_quota | public static BaseResult clear_quota(String component_access_token, String component_appid) {
String json = String.format("{\"component_appid\":\"%s\"}", component_appid);
HttpUriRequest httpUriRequest = RequestBuilder.post()
.setHeader(jsonHeader)
.setUri(BASE_URI + ... | java | public static BaseResult clear_quota(String component_access_token, String component_appid) {
String json = String.format("{\"component_appid\":\"%s\"}", component_appid);
HttpUriRequest httpUriRequest = RequestBuilder.post()
.setHeader(jsonHeader)
.setUri(BASE_URI + ... | [
"public",
"static",
"BaseResult",
"clear_quota",
"(",
"String",
"component_access_token",
",",
"String",
"component_appid",
")",
"{",
"String",
"json",
"=",
"String",
".",
"format",
"(",
"\"{\\\"component_appid\\\":\\\"%s\\\"}\"",
",",
"component_appid",
")",
";",
"Ht... | 第三方平台对其所有API调用次数清零
@param component_access_token 调用接口凭据
@param component_appid 第三方平台APPID
@return result
@since 2.8.2 | [
"第三方平台对其所有API调用次数清零"
] | c64255292d41463bdb671938feaabf42a335d82c | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/ComponentAPI.java#L273-L282 | train | Clear quota for a component | Of course, here is the Java code you requested:
```java
public static BaseResult clear_quota(String component_access_token, String component_appid) {
String json = String.format("{\"component_appid\":\"%s\"}", component_appid);
HttpUriRequest httpUriRequest = RequestBuilder.post()
.s... |
aws/aws-sdk-java | aws-java-sdk-codedeploy/src/main/java/com/amazonaws/services/codedeploy/AmazonCodeDeployAsyncClient.java | AmazonCodeDeployAsyncClient.updateApplicationAsync | @Override
public java.util.concurrent.Future<UpdateApplicationResult> updateApplicationAsync(
com.amazonaws.handlers.AsyncHandler<UpdateApplicationRequest, UpdateApplicationResult> asyncHandler) {
return updateApplicationAsync(new UpdateApplicationRequest(), asyncHandler);
} | java | @Override
public java.util.concurrent.Future<UpdateApplicationResult> updateApplicationAsync(
com.amazonaws.handlers.AsyncHandler<UpdateApplicationRequest, UpdateApplicationResult> asyncHandler) {
return updateApplicationAsync(new UpdateApplicationRequest(), asyncHandler);
} | [
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"UpdateApplicationResult",
">",
"updateApplicationAsync",
"(",
"com",
".",
"amazonaws",
".",
"handlers",
".",
"AsyncHandler",
"<",
"UpdateApplicationRequest",
",",
"UpdateApplicat... | Simplified method form for invoking the UpdateApplication operation with an AsyncHandler.
@see #updateApplicationAsync(UpdateApplicationRequest, com.amazonaws.handlers.AsyncHandler) | [
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"UpdateApplication",
"operation",
"with",
"an",
"AsyncHandler",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-codedeploy/src/main/java/com/amazonaws/services/codedeploy/AmazonCodeDeployAsyncClient.java#L1914-L1919 | train | Simplified method form for invoking the UpdateApplication operation with an AsyncHandler. | Of course, here is the Java code you requested:
```java
@Override
public java.util.concurrent.Future<UpdateApplicationResult> updateApplicationAsync(
com.amazonaws.handlers.AsyncHandler<UpdateApplicationRequest, UpdateApplicationResult> asyncHandler) {
return updateApplicationAsync(new UpdateA... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/NetcdfFile.java | NetcdfFile.findAttribute | public Attribute findAttribute(String fullNameEscaped) {
if (fullNameEscaped == null || fullNameEscaped.length() == 0) {
return null;
}
int posAtt = fullNameEscaped.indexOf('@');
if (posAtt < 0 || posAtt >= fullNameEscaped.length() - 1)
return null;
if (posAtt == 0) {
return findG... | java | public Attribute findAttribute(String fullNameEscaped) {
if (fullNameEscaped == null || fullNameEscaped.length() == 0) {
return null;
}
int posAtt = fullNameEscaped.indexOf('@');
if (posAtt < 0 || posAtt >= fullNameEscaped.length() - 1)
return null;
if (posAtt == 0) {
return findG... | [
"public",
"Attribute",
"findAttribute",
"(",
"String",
"fullNameEscaped",
")",
"{",
"if",
"(",
"fullNameEscaped",
"==",
"null",
"||",
"fullNameEscaped",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"int",
"posAtt",
"=",
"fullNa... | Find an attribute, with the specified (escaped full) name.
It may possibly be nested in multiple groups and/or structures.
An embedded "." is interpreted as structure.member.
An embedded "/" is interpreted as group/group or group/variable.
An embedded "@" is interpreted as variable@attribute
If the name actually has a ... | [
"Find",
"an",
"attribute",
"with",
"the",
"specified",
"(",
"escaped",
"full",
")",
"name",
".",
"It",
"may",
"possibly",
"be",
"nested",
"in",
"multiple",
"groups",
"and",
"/",
"or",
"structures",
".",
"An",
"embedded",
".",
"is",
"interpreted",
"as",
"... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/NetcdfFile.java#L1272-L1320 | test | Find an attribute in the file. | Of course, here is the Java code you requested:
```java
public Attribute findAttribute(String fullNameEscaped) {
if (fullNameEscaped == null || fullNameEscaped.length() == 0) {
return null;
}
int posAtt = fullNameEscaped.indexOf('@');
if (posAtt < 0 || posAtt >= fullNameEscaped.length() - 1)
... |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/factory/GeoPackageCoreImpl.java | GeoPackageCoreImpl.createDataColumnsTable | @Override
public boolean createDataColumnsTable() {
verifyWritable();
boolean created = false;
DataColumnsDao dao = getDataColumnsDao();
try {
if (!dao.isTableExists()) {
created = tableCreator.createDataColumns() > 0;
}
} catch (SQLException e) {
throw new GeoPackageException("Failed to check ... | java | @Override
public boolean createDataColumnsTable() {
verifyWritable();
boolean created = false;
DataColumnsDao dao = getDataColumnsDao();
try {
if (!dao.isTableExists()) {
created = tableCreator.createDataColumns() > 0;
}
} catch (SQLException e) {
throw new GeoPackageException("Failed to check ... | [
"@",
"Override",
"public",
"boolean",
"createDataColumnsTable",
"(",
")",
"{",
"verifyWritable",
"(",
")",
";",
"boolean",
"created",
"=",
"false",
";",
"DataColumnsDao",
"dao",
"=",
"getDataColumnsDao",
"(",
")",
";",
"try",
"{",
"if",
"(",
"!",
"dao",
".... | {@inheritDoc} | [
"{"
] | 6431c3b041a45b7f3802904ea4156b4082a72daa | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/factory/GeoPackageCoreImpl.java#L921-L937 | train | Create the Data Columns table | Of course, here is the Java code you requested:
```java
@Override
public boolean createDataColumnsTable() {
verifyWritable();
boolean created = false;
DataColumnsDao dao = getDataColumnsDao();
try {
if (!dao.isTableExists()) {
created = tableCreator.createDataColumns() > 0;
}
} catch (SQLExceptio... |
line/armeria | core/src/main/java/com/linecorp/armeria/common/util/TextFormatter.java | TextFormatter.elapsedAndSize | public static StringBuilder elapsedAndSize(long startTimeNanos, long endTimeNanos, long size) {
final StringBuilder buf = new StringBuilder(16);
appendElapsedAndSize(buf, startTimeNanos, endTimeNanos, size);
return buf;
} | java | public static StringBuilder elapsedAndSize(long startTimeNanos, long endTimeNanos, long size) {
final StringBuilder buf = new StringBuilder(16);
appendElapsedAndSize(buf, startTimeNanos, endTimeNanos, size);
return buf;
} | [
"public",
"static",
"StringBuilder",
"elapsedAndSize",
"(",
"long",
"startTimeNanos",
",",
"long",
"endTimeNanos",
",",
"long",
"size",
")",
"{",
"final",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
"16",
")",
";",
"appendElapsedAndSize",
"(",
"buf... | Similar to {@link #appendElapsedAndSize(StringBuilder, long, long, long)} except that this method
creates a new {@link StringBuilder}. | [
"Similar",
"to",
"{"
] | 67d29e019fd35a35f89c45cc8f9119ff9b12b44d | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/common/util/TextFormatter.java#L113-L117 | train | Create a StringBuilder that contains the time elapsed and size of a record set. | Of course, here is the Java code you requested:
```java
public static StringBuilder elapsedAndSize(long startTimeNanos, long endTimeNanos, long size) {
final StringBuilder buf = new StringBuilder(16);
appendElapsedAndSize(buf, startTimeNanos, endTimeNanos, size);
return buf;
}
```
Hope thi... |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java | AbstractExecutableMemberWriter.addTypeParameters | protected void addTypeParameters(ExecutableMemberDoc member, Content htmltree) {
Content typeParameters = getTypeParameters(member);
if (!typeParameters.isEmpty()) {
htmltree.addContent(typeParameters);
htmltree.addContent(writer.getSpace());
}
} | java | protected void addTypeParameters(ExecutableMemberDoc member, Content htmltree) {
Content typeParameters = getTypeParameters(member);
if (!typeParameters.isEmpty()) {
htmltree.addContent(typeParameters);
htmltree.addContent(writer.getSpace());
}
} | [
"protected",
"void",
"addTypeParameters",
"(",
"ExecutableMemberDoc",
"member",
",",
"Content",
"htmltree",
")",
"{",
"Content",
"typeParameters",
"=",
"getTypeParameters",
"(",
"member",
")",
";",
"if",
"(",
"!",
"typeParameters",
".",
"isEmpty",
"(",
")",
")",... | Add the type parameters for the executable member.
@param member the member to write type parameters for.
@param htmltree the content tree to which the parameters will be added. | [
"Add",
"the",
"type",
"parameters",
"for",
"the",
"executable",
"member",
"."
] | a53d069bbdb2c60232ed3811c19b65e41c3e60e0 | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java#L63-L69 | train | Add the type parameters. | Of course, here is the Java code you requested:
```java
protected void addTypeParameters(ExecutableMemberDoc member, Content htmltree) {
Content typeParameters = getTypeParameters(member);
if (!typeParameters.isEmpty()) {
htmltree.addContent(typeParameters);
htmltree.addContent(... |
prolificinteractive/material-calendarview | library/src/main/java/com/prolificinteractive/materialcalendarview/DayView.java | DayView.setDayFormatter | public void setDayFormatter(DayFormatter formatter) {
this.contentDescriptionFormatter = contentDescriptionFormatter == this.formatter ?
formatter : contentDescriptionFormatter;
this.formatter = formatter == null ? DayFormatter.DEFAULT : formatter;
CharSequence current... | java | public void setDayFormatter(DayFormatter formatter) {
this.contentDescriptionFormatter = contentDescriptionFormatter == this.formatter ?
formatter : contentDescriptionFormatter;
this.formatter = formatter == null ? DayFormatter.DEFAULT : formatter;
CharSequence current... | [
"public",
"void",
"setDayFormatter",
"(",
"DayFormatter",
"formatter",
")",
"{",
"this",
".",
"contentDescriptionFormatter",
"=",
"contentDescriptionFormatter",
"==",
"this",
".",
"formatter",
"?",
"formatter",
":",
"contentDescriptionFormatter",
";",
"this",
".",
"fo... | Set the new label formatter and reformat the current label. This preserves current spans.
@param formatter new label formatter | [
"Set",
"the",
"new",
"label",
"formatter",
"and",
"reformat",
"the",
"current",
"label",
".",
"This",
"preserves",
"current",
"spans",
"."
] | 04fae8175fd034d0a7131f8cb253cae883a88aa2 | https://github.com/prolificinteractive/material-calendarview/blob/04fae8175fd034d0a7131f8cb253cae883a88aa2/library/src/main/java/com/prolificinteractive/materialcalendarview/DayView.java#L77-L93 | train | Sets the day formatter. | Of course, here is the Java code you requested:
```java
public void setDayFormatter(DayFormatter formatter) {
this.contentDescriptionFormatter = contentDescriptionFormatter == this.formatter ?
formatter : contentDescriptionFormatter;
this.formatter = formatter == null ? D... |
lambdazen/bitsy | src/main/java/com/lambdazen/bitsy/store/Record.java | Record.checkObsolete | public boolean checkObsolete(IGraphStore store, boolean isReorg, int lineNo, String fileName) {
if (type == RecordType.T) {
// Transaction boundaries are obsolete during reorg
return isReorg;
} else if (type == RecordType.L) {
// A log is always obsolete
... | java | public boolean checkObsolete(IGraphStore store, boolean isReorg, int lineNo, String fileName) {
if (type == RecordType.T) {
// Transaction boundaries are obsolete during reorg
return isReorg;
} else if (type == RecordType.L) {
// A log is always obsolete
... | [
"public",
"boolean",
"checkObsolete",
"(",
"IGraphStore",
"store",
",",
"boolean",
"isReorg",
",",
"int",
"lineNo",
",",
"String",
"fileName",
")",
"{",
"if",
"(",
"type",
"==",
"RecordType",
".",
"T",
")",
"{",
"// Transaction boundaries are obsolete during reorg... | This method checks to see if a record is obsolete, i.e., its version is not present in the store | [
"This",
"method",
"checks",
"to",
"see",
"if",
"a",
"record",
"is",
"obsolete",
"i",
".",
"e",
".",
"its",
"version",
"is",
"not",
"present",
"in",
"the",
"store"
] | c0dd4b6c9d6dc9987d0168c91417eb04d80bf712 | https://github.com/lambdazen/bitsy/blob/c0dd4b6c9d6dc9987d0168c91417eb04d80bf712/src/main/java/com/lambdazen/bitsy/store/Record.java#L150-L234 | train | Checks if the record is obsolete. | Of course, here is the Java code you requested:
```java
public boolean checkObsolete(IGraphStore store, boolean isReorg, int lineNo, String fileName) {
if (type == RecordType.T) {
// Transaction boundaries are obsolete during reorg
return isReorg;
} else if (type == RecordType.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.