repo stringlengths 7 59 | path stringlengths 17 234 | func_name stringlengths 3 117 | original_string stringlengths 63 281k | language stringclasses 1
value | code stringlengths 63 281k | code_tokens listlengths 20 16.3k | docstring stringlengths 1 34k | docstring_tokens listlengths 1 3.44k | sha stringlengths 40 40 | url stringlengths 106 339 | partition stringclasses 3
values | summary stringlengths 3 248 | output stringlengths 142 281k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
hawkular/hawkular-metrics | core/metrics-core-service/src/main/java/org/hawkular/metrics/core/util/GCGraceSecondsManager.java | GCGraceSecondsManager.maybeUpdateGCGraceSeconds | public void maybeUpdateGCGraceSeconds() {
logger.info("Checking tables in " + keyspace + " to see if gc_grace_seconds needs to be updated");
Stopwatch stopwatch = Stopwatch.createStarted();
Map<String, String> replication = session.getCluster().getMetadata().getKeyspace(keyspace).getReplication(... | java | public void maybeUpdateGCGraceSeconds() {
logger.info("Checking tables in " + keyspace + " to see if gc_grace_seconds needs to be updated");
Stopwatch stopwatch = Stopwatch.createStarted();
Map<String, String> replication = session.getCluster().getMetadata().getKeyspace(keyspace).getReplication(... | [
"public",
"void",
"maybeUpdateGCGraceSeconds",
"(",
")",
"{",
"logger",
".",
"info",
"(",
"\"Checking tables in \"",
"+",
"keyspace",
"+",
"\" to see if gc_grace_seconds needs to be updated\"",
")",
";",
"Stopwatch",
"stopwatch",
"=",
"Stopwatch",
".",
"createStarted",
... | Asynchronously performs gc_grace_seconds updates if necessary. This method should <strong>not</strong> be called
until schema updates have finished. | [
"Asynchronously",
"performs",
"gc_grace_seconds",
"updates",
"if",
"necessary",
".",
"This",
"method",
"should",
"<strong",
">",
"not<",
"/",
"strong",
">",
"be",
"called",
"until",
"schema",
"updates",
"have",
"finished",
"."
] | 6b9ab00d00c3d6d51e30c2c08c4ee48da7237e6c | https://github.com/hawkular/hawkular-metrics/blob/6b9ab00d00c3d6d51e30c2c08c4ee48da7237e6c/core/metrics-core-service/src/main/java/org/hawkular/metrics/core/util/GCGraceSecondsManager.java#L87-L118 | test | Check if the table in the keyspace has the gc_grace_seconds property. If it has the value of gc_grace_seconds then update the value of the gc_grace_seconds property. | Of course, here is the Java code you requested:
```java
public void maybeUpdateGCGraceSeconds() {
logger.info("Checking tables in " + keyspace + " to see if gc_grace_seconds needs to be updated");
Stopwatch stopwatch = Stopwatch.createStarted();
Map<String, String> replication = session.getClus... |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/core/contents/ContentsDao.java | ContentsDao.getTables | public List<String> getTables(String dataType) throws SQLException {
List<Contents> contents = getContents(dataType);
List<String> tableNames = new ArrayList<String>();
for (Contents content : contents) {
tableNames.add(content.getTableName());
}
return tableNames;
} | java | public List<String> getTables(String dataType) throws SQLException {
List<Contents> contents = getContents(dataType);
List<String> tableNames = new ArrayList<String>();
for (Contents content : contents) {
tableNames.add(content.getTableName());
}
return tableNames;
} | [
"public",
"List",
"<",
"String",
">",
"getTables",
"(",
"String",
"dataType",
")",
"throws",
"SQLException",
"{",
"List",
"<",
"Contents",
">",
"contents",
"=",
"getContents",
"(",
"dataType",
")",
";",
"List",
"<",
"String",
">",
"tableNames",
"=",
"new",... | Get table names by data type
@param dataType
data type
@return table names
@throws SQLException
upon query error
@since 3.0.1 | [
"Get",
"table",
"names",
"by",
"data",
"type"
] | 6431c3b041a45b7f3802904ea4156b4082a72daa | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/core/contents/ContentsDao.java#L137-L144 | train | Get the list of table names for the specified data type. | Of course, here is the Java code you requested:
```java
public List<String> getTables(String dataType) throws SQLException {
List<Contents> contents = getContents(dataType);
List<String> tableNames = new ArrayList<String>();
for (Contents content : contents) {
tableNames.add(content.getTableName());
}
ret... |
glookast/commons-timecode | src/main/java/com/glookast/commons/timecode/MutableTimecodeDuration.java | MutableTimecodeDuration.valueOf | public static MutableTimecodeDuration valueOf(String timecode, int timecodeBase) throws IllegalArgumentException
{
return valueOf(timecode, timecodeBase, StringType.NORMAL);
} | java | public static MutableTimecodeDuration valueOf(String timecode, int timecodeBase) throws IllegalArgumentException
{
return valueOf(timecode, timecodeBase, StringType.NORMAL);
} | [
"public",
"static",
"MutableTimecodeDuration",
"valueOf",
"(",
"String",
"timecode",
",",
"int",
"timecodeBase",
")",
"throws",
"IllegalArgumentException",
"{",
"return",
"valueOf",
"(",
"timecode",
",",
"timecodeBase",
",",
"StringType",
".",
"NORMAL",
")",
";",
... | Returns a TimecodeDuration instance for given timecode string and timecode base. Acceptable inputs are
the normal representation HH:MM:SS:FF for non drop frame and HH:MM:SS:FF for drop frame
@param timecode
@param timecodeBase
@return the TimecodeDuration
@throws IllegalArgumentException | [
"Returns",
"a",
"TimecodeDuration",
"instance",
"for",
"given",
"timecode",
"string",
"and",
"timecode",
"base",
".",
"Acceptable",
"inputs",
"are",
"the",
"normal",
"representation",
"HH",
":",
"MM",
":",
"SS",
":",
"FF",
"for",
"non",
"drop",
"frame",
"and... | ec2f682a51d1cc435d0b42d80de48ff15adb4ee8 | https://github.com/glookast/commons-timecode/blob/ec2f682a51d1cc435d0b42d80de48ff15adb4ee8/src/main/java/com/glookast/commons/timecode/MutableTimecodeDuration.java#L75-L78 | train | Gets a MutableTimecodeDuration object from a string of timecode and timecodeBase. | Of course, here is the Java code you requested:
```java
public static MutableTimecodeDuration valueOf(String timecode, int timecodeBase) throws IllegalArgumentException
{
return valueOf(timecode, timecodeBase, StringType.NORMAL);
}
```
Hope this helps! |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/util/SequenceTools.java | SequenceTools.equalLengthSequences | public static boolean equalLengthSequences(ProteinSequence[] sequences) {
for (int i=0; i<sequences.length-1; i++) {
if (sequences[i]==null)
continue;
for (int j=i+1; j<sequences.length; j++) {
if (sequences[j]==null)
continue;
if (sequences[i].getLength() == sequences[j].getLength())
ret... | java | public static boolean equalLengthSequences(ProteinSequence[] sequences) {
for (int i=0; i<sequences.length-1; i++) {
if (sequences[i]==null)
continue;
for (int j=i+1; j<sequences.length; j++) {
if (sequences[j]==null)
continue;
if (sequences[i].getLength() == sequences[j].getLength())
ret... | [
"public",
"static",
"boolean",
"equalLengthSequences",
"(",
"ProteinSequence",
"[",
"]",
"sequences",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"sequences",
".",
"length",
"-",
"1",
";",
"i",
"++",
")",
"{",
"if",
"(",
"sequences",
"... | A method to check whether an array of sequences contains at least two sequences having an equal length.
@param sequences the array of {@link org.biojava.nbio.core.sequence.ProteinSequence} sequences
@return true if any two sequences are of an equal length | [
"A",
"method",
"to",
"check",
"whether",
"an",
"array",
"of",
"sequences",
"contains",
"at",
"least",
"two",
"sequences",
"having",
"an",
"equal",
"length",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/util/SequenceTools.java#L123-L136 | train | Checks if the length of the sequence array is equal to the length of the sequence. | Of course, here is the Java code you requested:
```java
public static boolean equalLengthSequences(ProteinSequence[] sequences) {
for (int i=0; i<sequences.length-1; i++) {
if (sequences[i]==null)
continue;
for (int j=i+1; j<sequences.length; j++) {
if (sequences[j]==null)
continue;
if (seque... |
googleads/googleads-java-lib | modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v201808/Proposal.java | Proposal.setPrimarySalesperson | public void setPrimarySalesperson(com.google.api.ads.admanager.axis.v201808.SalespersonSplit primarySalesperson) {
this.primarySalesperson = primarySalesperson;
} | java | public void setPrimarySalesperson(com.google.api.ads.admanager.axis.v201808.SalespersonSplit primarySalesperson) {
this.primarySalesperson = primarySalesperson;
} | [
"public",
"void",
"setPrimarySalesperson",
"(",
"com",
".",
"google",
".",
"api",
".",
"ads",
".",
"admanager",
".",
"axis",
".",
"v201808",
".",
"SalespersonSplit",
"primarySalesperson",
")",
"{",
"this",
".",
"primarySalesperson",
"=",
"primarySalesperson",
";... | Sets the primarySalesperson value for this Proposal.
@param primarySalesperson * The primary salesperson who brokered the transaction with the
{@link #advertiser}.
This attribute is required when the proposal turns
into an order.
This attribute can be configured as editable after
the proposal has been submitted.
Ple... | [
"Sets",
"the",
"primarySalesperson",
"value",
"for",
"this",
"Proposal",
"."
] | 967957cc4f6076514e3a7926fe653e4f1f7cc9c9 | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v201808/Proposal.java#L1492-L1494 | train | Sets the primarySalesperson value for this CDN. | Of course, here is the Java code you requested:
```java
public void setPrimarySalesperson(com.google.api.ads.admanager.axis.v201808.SalespersonSplit primarySalesperson) {
this.primarySalesperson = primarySalesperson;
}
```
Hope this helps! |
actorapp/actor-platform | actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java | ImageLoading.save | private static void save(Bitmap src, String fileName, Bitmap.CompressFormat format, int quality) throws ImageSaveException {
FileOutputStream outputStream = null;
try {
outputStream = new FileOutputStream(fileName);
src.compress(format, quality, outputStream);
outputS... | java | private static void save(Bitmap src, String fileName, Bitmap.CompressFormat format, int quality) throws ImageSaveException {
FileOutputStream outputStream = null;
try {
outputStream = new FileOutputStream(fileName);
src.compress(format, quality, outputStream);
outputS... | [
"private",
"static",
"void",
"save",
"(",
"Bitmap",
"src",
",",
"String",
"fileName",
",",
"Bitmap",
".",
"CompressFormat",
"format",
",",
"int",
"quality",
")",
"throws",
"ImageSaveException",
"{",
"FileOutputStream",
"outputStream",
"=",
"null",
";",
"try",
... | Saving image to file
@param src source image
@param fileName destination file name
@param format image format
@param quality jpeg quality
@throws ImageSaveException if it is unable to save image | [
"Saving",
"image",
"to",
"file"
] | 5123c1584757c6eeea0ed2a0e7e043629871a0c6 | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java#L484-L501 | train | Save image in a file. | Of course, here is the Java code you requested:
```java
private static void save(Bitmap src, String fileName, Bitmap.CompressFormat format, int quality) throws ImageSaveException {
FileOutputStream outputStream = null;
try {
outputStream = new FileOutputStream(fileName);
src.com... |
Whiley/WhileyCompiler | src/main/java/wyil/check/FlowTypeCheck.java | FlowTypeCheck.checkLVal | public Type checkLVal(LVal lval, Environment environment) {
Type type;
switch (lval.getOpcode()) {
case EXPR_variablecopy:
type = checkVariableLVal((Expr.VariableAccess) lval, environment);
break;
case EXPR_staticvariable:
type = checkStaticVariableLVal((Expr.StaticVariableAccess) lval, environment);
... | java | public Type checkLVal(LVal lval, Environment environment) {
Type type;
switch (lval.getOpcode()) {
case EXPR_variablecopy:
type = checkVariableLVal((Expr.VariableAccess) lval, environment);
break;
case EXPR_staticvariable:
type = checkStaticVariableLVal((Expr.StaticVariableAccess) lval, environment);
... | [
"public",
"Type",
"checkLVal",
"(",
"LVal",
"lval",
",",
"Environment",
"environment",
")",
"{",
"Type",
"type",
";",
"switch",
"(",
"lval",
".",
"getOpcode",
"(",
")",
")",
"{",
"case",
"EXPR_variablecopy",
":",
"type",
"=",
"checkVariableLVal",
"(",
"(",... | Type check a given lval assuming an initial environment. This returns the
largest type which can be safely assigned to the lval. Observe that this type
is determined by the declared type of the variable being assigned.
@param expression
@param environment
@return
@throws ResolutionError | [
"Type",
"check",
"a",
"given",
"lval",
"assuming",
"an",
"initial",
"environment",
".",
"This",
"returns",
"the",
"largest",
"type",
"which",
"can",
"be",
"safely",
"assigned",
"to",
"the",
"lval",
".",
"Observe",
"that",
"this",
"type",
"is",
"determined",
... | 680f8a657d3fc286f8cc422755988b6d74ab3f4c | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/check/FlowTypeCheck.java#L1104-L1133 | train | Check a LVal. | Of course, here is the Java code you requested:
```java
public Type checkLVal(LVal lval, Environment environment) {
Type type;
switch (lval.getOpcode()) {
case EXPR_variablecopy:
type = checkVariableLVal((Expr.VariableAccess) lval, environment);
break;
case EXPR_staticvariable:
type = checkStaticVaria... |
shrinkwrap/resolver | maven/impl-maven/src/main/java/org/jboss/shrinkwrap/resolver/impl/maven/logging/LogRepositoryListener.java | LogRepositoryListener.artifactDescriptorInvalid | @Override
public void artifactDescriptorInvalid(RepositoryEvent event) {
log.warning("Invalid artifact descriptor for " + event.getArtifact() + ": " + event.getException().getMessage());
} | java | @Override
public void artifactDescriptorInvalid(RepositoryEvent event) {
log.warning("Invalid artifact descriptor for " + event.getArtifact() + ": " + event.getException().getMessage());
} | [
"@",
"Override",
"public",
"void",
"artifactDescriptorInvalid",
"(",
"RepositoryEvent",
"event",
")",
"{",
"log",
".",
"warning",
"(",
"\"Invalid artifact descriptor for \"",
"+",
"event",
".",
"getArtifact",
"(",
")",
"+",
"\": \"",
"+",
"event",
".",
"getExcepti... | /*
(non-Javadoc)
@see org.eclipse.aether.util.listener.AbstractRepositoryListener#
artifactDescriptorInvalid(org.eclipse.aether.RepositoryEvent) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | e881a84b8cff5b0a014f2a5ebf612be3eb9db01f | https://github.com/shrinkwrap/resolver/blob/e881a84b8cff5b0a014f2a5ebf612be3eb9db01f/maven/impl-maven/src/main/java/org/jboss/shrinkwrap/resolver/impl/maven/logging/LogRepositoryListener.java#L67-L70 | train | This method is called when an artifact descriptor is invalid. | Of course, here is the Java code you requested:
```java
@Override
public void artifactDescriptorInvalid(RepositoryEvent event) {
log.warning("Invalid artifact descriptor for " + event.getArtifact() + ": " + event.getException().getMessage());
}
```
Hope this helps! |
gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/ScheduleService.java | ScheduleService.isStageActive | private boolean isStageActive(Pipeline pipeline, StageConfig nextStage) {
return stageDao.isStageActive(pipeline.getName(), CaseInsensitiveString.str(nextStage.name()));
} | java | private boolean isStageActive(Pipeline pipeline, StageConfig nextStage) {
return stageDao.isStageActive(pipeline.getName(), CaseInsensitiveString.str(nextStage.name()));
} | [
"private",
"boolean",
"isStageActive",
"(",
"Pipeline",
"pipeline",
",",
"StageConfig",
"nextStage",
")",
"{",
"return",
"stageDao",
".",
"isStageActive",
"(",
"pipeline",
".",
"getName",
"(",
")",
",",
"CaseInsensitiveString",
".",
"str",
"(",
"nextStage",
".",... | this method checks if specified stage is active in all pipelines | [
"this",
"method",
"checks",
"if",
"specified",
"stage",
"is",
"active",
"in",
"all",
"pipelines"
] | 59a8480e23d6c06de39127635108dff57603cb71 | https://github.com/gocd/gocd/blob/59a8480e23d6c06de39127635108dff57603cb71/server/src/main/java/com/thoughtworks/go/server/service/ScheduleService.java#L403-L405 | train | Checks if the stage is active for the given pipeline and next stage. | Of course, here is the Java code you requested:
```java
private boolean isStageActive(Pipeline pipeline, StageConfig nextStage) {
return stageDao.isStageActive(pipeline.getName(), CaseInsensitiveString.str(nextStage.name()));
}
```
Hope this helps! |
google/closure-compiler | src/com/google/javascript/jscomp/Compiler.java | Compiler.processJsonInputs | Map<String, String> processJsonInputs(Iterable<CompilerInput> inputsToProcess) {
RewriteJsonToModule rewriteJson = new RewriteJsonToModule(this);
for (CompilerInput input : inputsToProcess) {
if (!input.getSourceFile().getOriginalPath().endsWith(".json")) {
continue;
}
input.setCompil... | java | Map<String, String> processJsonInputs(Iterable<CompilerInput> inputsToProcess) {
RewriteJsonToModule rewriteJson = new RewriteJsonToModule(this);
for (CompilerInput input : inputsToProcess) {
if (!input.getSourceFile().getOriginalPath().endsWith(".json")) {
continue;
}
input.setCompil... | [
"Map",
"<",
"String",
",",
"String",
">",
"processJsonInputs",
"(",
"Iterable",
"<",
"CompilerInput",
">",
"inputsToProcess",
")",
"{",
"RewriteJsonToModule",
"rewriteJson",
"=",
"new",
"RewriteJsonToModule",
"(",
"this",
")",
";",
"for",
"(",
"CompilerInput",
"... | Transforms JSON files to a module export that closure compiler can process and keeps track of
any "main" entries in package.json files. | [
"Transforms",
"JSON",
"files",
"to",
"a",
"module",
"export",
"that",
"closure",
"compiler",
"can",
"process",
"and",
"keeps",
"track",
"of",
"any",
"main",
"entries",
"in",
"package",
".",
"json",
"files",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L1992-L2012 | train | Process JSON inputs. | Of course, here is the Java code you requested:
```java
Map<String, String> processJsonInputs(Iterable<CompilerInput> inputsToProcess) {
RewriteJsonToModule rewriteJson = new RewriteJsonToModule(this);
for (CompilerInput input : inputsToProcess) {
if (!input.getSourceFile().getOriginalPath().endsWith(".j... |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/nonparametrics/onesample/ShapiroWilk.java | ShapiroWilk.poly | private static double poly(double[] cc, int nord, double x) {
/* Algorithm AS 181.2 Appl. Statist. (1982) Vol. 31, No. 2
Calculates the algebraic polynomial of order nord-1 with array of coefficients cc.
Zero order coefficient is cc(1) = cc[0] */
double ret_val = cc[0];
... | java | private static double poly(double[] cc, int nord, double x) {
/* Algorithm AS 181.2 Appl. Statist. (1982) Vol. 31, No. 2
Calculates the algebraic polynomial of order nord-1 with array of coefficients cc.
Zero order coefficient is cc(1) = cc[0] */
double ret_val = cc[0];
... | [
"private",
"static",
"double",
"poly",
"(",
"double",
"[",
"]",
"cc",
",",
"int",
"nord",
",",
"double",
"x",
")",
"{",
"/* Algorithm AS 181.2 Appl. Statist. (1982) Vol. 31, No. 2\n Calculates the algebraic polynomial of order nord-1 with array of coefficients cc.\n ... | Used internally by ShapiroWilkW().
@param cc
@param nord
@param x
@return | [
"Used",
"internally",
"by",
"ShapiroWilkW",
"()",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/nonparametrics/onesample/ShapiroWilk.java#L66-L80 | train | Calculate the polynomial of a set of coefficients. | Of course, here is the Java code you requested:
```java
private static double poly(double[] cc, int nord, double x) {
/* Algorithm AS 181.2 Appl. Statist. (1982) Vol. 31, No. 2
Calculates the algebraic polynomial of order nord-1 with array of coefficients cc.
Zero order coefficient is cc(... |
xfcjscn/sudoor-server-lib | src/main/java/net/gplatform/sudoor/server/security/model/auth/SSAuth.java | SSAuth.signin | public void signin(String username, String password) {
logger.debug("signin:" + username);
Authentication request = new UsernamePasswordAuthenticationToken(username, password, null);
SecurityContextHolder.getContext().setAuthentication(request);
} | java | public void signin(String username, String password) {
logger.debug("signin:" + username);
Authentication request = new UsernamePasswordAuthenticationToken(username, password, null);
SecurityContextHolder.getContext().setAuthentication(request);
} | [
"public",
"void",
"signin",
"(",
"String",
"username",
",",
"String",
"password",
")",
"{",
"logger",
".",
"debug",
"(",
"\"signin:\"",
"+",
"username",
")",
";",
"Authentication",
"request",
"=",
"new",
"UsernamePasswordAuthenticationToken",
"(",
"username",
",... | WARNING: Normally this is used by non-web interface. For web interface,
pls use Spring Security config to auto authenticate Here there is no
authenticate
@param username
@param password | [
"WARNING",
":",
"Normally",
"this",
"is",
"used",
"by",
"non",
"-",
"web",
"interface",
".",
"For",
"web",
"interface",
"pls",
"use",
"Spring",
"Security",
"config",
"to",
"auto",
"authenticate",
"Here",
"there",
"is",
"no",
"authenticate"
] | 37dc1996eaa9cad25c82abd1de315ba565e32097 | https://github.com/xfcjscn/sudoor-server-lib/blob/37dc1996eaa9cad25c82abd1de315ba565e32097/src/main/java/net/gplatform/sudoor/server/security/model/auth/SSAuth.java#L127-L132 | train | Sign in a user. | Of course, here is the Java code you requested:
```java
public void signin(String username, String password) {
logger.debug("signin:" + username);
Authentication request = new UsernamePasswordAuthenticationToken(username, password, null);
SecurityContextHolder.getContext().setAuthentication(request);
}
```
Ho... |
eclipse/xtext-extras | org.eclipse.xtext.purexbase.ide/src-gen/org/eclipse/xtext/purexbase/ide/contentassist/antlr/internal/InternalPureXbaseLexer.java | InternalPureXbaseLexer.mT__68 | public final void mT__68() throws RecognitionException {
try {
int _type = T__68;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalPureXbase.g:66:7: ( 'do' )
// InternalPureXbase.g:66:9: 'do'
{
match("do");
}
sta... | java | public final void mT__68() throws RecognitionException {
try {
int _type = T__68;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalPureXbase.g:66:7: ( 'do' )
// InternalPureXbase.g:66:9: 'do'
{
match("do");
}
sta... | [
"public",
"final",
"void",
"mT__68",
"(",
")",
"throws",
"RecognitionException",
"{",
"try",
"{",
"int",
"_type",
"=",
"T__68",
";",
"int",
"_channel",
"=",
"DEFAULT_TOKEN_CHANNEL",
";",
"// InternalPureXbase.g:66:7: ( 'do' )",
"// InternalPureXbase.g:66:9: 'do'",
"{",
... | $ANTLR start "T__68" | [
"$ANTLR",
"start",
"T__68"
] | 451359541295323a29f5855e633f770cec02069a | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.purexbase.ide/src-gen/org/eclipse/xtext/purexbase/ide/contentassist/antlr/internal/InternalPureXbaseLexer.java#L1249-L1266 | train | Use for t__68 | Of course, here is the Java code you requested:
```java
public final void mT__68() throws RecognitionException {
try {
int _type = T__68;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalPureXbase.g:66:7: ( 'do' )
// InternalPureXbase.g:66:9: 'do'
{
... |
thorstenwagner/TraJ | src/main/java/de/biomedical_imaging/traJ/VisualizationUtils.java | VisualizationUtils.getMSDLineChart | public static Chart getMSDLineChart(ArrayList<Trajectory> t, int lagMin,
int lagMax) {
return getMSDLineChart(t, lagMin, lagMax,
new MeanSquaredDisplacmentFeature(t.get(0), lagMin));
} | java | public static Chart getMSDLineChart(ArrayList<Trajectory> t, int lagMin,
int lagMax) {
return getMSDLineChart(t, lagMin, lagMax,
new MeanSquaredDisplacmentFeature(t.get(0), lagMin));
} | [
"public",
"static",
"Chart",
"getMSDLineChart",
"(",
"ArrayList",
"<",
"Trajectory",
">",
"t",
",",
"int",
"lagMin",
",",
"int",
"lagMax",
")",
"{",
"return",
"getMSDLineChart",
"(",
"t",
",",
"lagMin",
",",
"lagMax",
",",
"new",
"MeanSquaredDisplacmentFeature... | Plots the mean MSD curve over all trajectories in t.
@param t List of trajectories
@param lagMin Minimum timelag (e.g. 1,2,3..) lagMin*timelag = elapsed time in seconds
@param lagMax Maximum timelag (e.g. 1,2,3..) lagMax*timelag = elapsed time in seconds | [
"Plots",
"the",
"mean",
"MSD",
"curve",
"over",
"all",
"trajectories",
"in",
"t",
"."
] | 505fafb1f2f77a2d67bb2a089a2fdebe2c9bc7cb | https://github.com/thorstenwagner/TraJ/blob/505fafb1f2f77a2d67bb2a089a2fdebe2c9bc7cb/src/main/java/de/biomedical_imaging/traJ/VisualizationUtils.java#L323-L327 | train | Creates a MSD line chart for trajectories. | Of course, here is the Java code you requested:
```java
public static Chart getMSDLineChart(ArrayList<Trajectory> t, int lagMin,
int lagMax) {
return getMSDLineChart(t, lagMin, lagMax,
new MeanSquaredDisplacmentFeature(t.get(0), lagMin));
}
```
Hope this helps! |
yan74/afplib | org.afplib/src/main/java/org/afplib/afplib/impl/BPTImpl.java | BPTImpl.eGet | @Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AfplibPackage.BPT__PTDO_NAME:
return getPTdoName();
case AfplibPackage.BPT__TRIPLETS:
return getTriplets();
}
return super.eGet(featureID, resolve, coreType);
} | java | @Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AfplibPackage.BPT__PTDO_NAME:
return getPTdoName();
case AfplibPackage.BPT__TRIPLETS:
return getTriplets();
}
return super.eGet(featureID, resolve, coreType);
} | [
"@",
"Override",
"public",
"Object",
"eGet",
"(",
"int",
"featureID",
",",
"boolean",
"resolve",
",",
"boolean",
"coreType",
")",
"{",
"switch",
"(",
"featureID",
")",
"{",
"case",
"AfplibPackage",
".",
"BPT__PTDO_NAME",
":",
"return",
"getPTdoName",
"(",
")... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f | https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/BPTImpl.java#L143-L152 | train | Override eGet to return the value of the featureID. | Of course, here is the Java code you requested:
```java
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AfplibPackage.BPT__PTDO_NAME:
return getPTdoName();
case AfplibPackage.BPT__TRIPLETS:
return getTriplets();
}
return super.eGet(feature... |
google/closure-templates | java/src/com/google/template/soy/jssrc/dsl/Statement.java | Statement.forLoop | public static Statement forLoop(String localVar, Expression limit, Statement body) {
return For.create(localVar, Expression.number(0), limit, Expression.number(1), body);
} | java | public static Statement forLoop(String localVar, Expression limit, Statement body) {
return For.create(localVar, Expression.number(0), limit, Expression.number(1), body);
} | [
"public",
"static",
"Statement",
"forLoop",
"(",
"String",
"localVar",
",",
"Expression",
"limit",
",",
"Statement",
"body",
")",
"{",
"return",
"For",
".",
"create",
"(",
"localVar",
",",
"Expression",
".",
"number",
"(",
"0",
")",
",",
"limit",
",",
"E... | Creates a code chunk representing a for loop, with default values for initial & increment. | [
"Creates",
"a",
"code",
"chunk",
"representing",
"a",
"for",
"loop",
"with",
"default",
"values",
"for",
"initial",
"&",
"increment",
"."
] | cc61e1dff70ae97f24f417a57410081bc498bd56 | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jssrc/dsl/Statement.java#L73-L75 | train | Creates a for loop statement. | Of course, here is the Java code you requested:
```java
public static Statement forLoop(String localVar, Expression limit, Statement body) {
return For.create(localVar, Expression.number(0), limit, Expression.number(1), body);
}
```
Hope this helps! |
amzn/ion-java | src/com/amazon/ion/impl/lite/IonDatagramLite.java | IonDatagramLite.systemSize | public int systemSize()
{
int count = 0;
ListIterator<IonValue> iterator = systemIterator();
while (iterator.hasNext()) {
@SuppressWarnings("unused")
IonValue value = iterator.next();
count++;
}
return count;
} | java | public int systemSize()
{
int count = 0;
ListIterator<IonValue> iterator = systemIterator();
while (iterator.hasNext()) {
@SuppressWarnings("unused")
IonValue value = iterator.next();
count++;
}
return count;
} | [
"public",
"int",
"systemSize",
"(",
")",
"{",
"int",
"count",
"=",
"0",
";",
"ListIterator",
"<",
"IonValue",
">",
"iterator",
"=",
"systemIterator",
"(",
")",
";",
"while",
"(",
"iterator",
".",
"hasNext",
"(",
")",
")",
"{",
"@",
"SuppressWarnings",
... | deprecate this is there isn't (which I suspect is actually the case) | [
"deprecate",
"this",
"is",
"there",
"isn",
"t",
"(",
"which",
"I",
"suspect",
"is",
"actually",
"the",
"case",
")"
] | 4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270 | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/lite/IonDatagramLite.java#L517-L527 | train | Get the size of the system. | Of course, here is the Java code you requested:
```java
public int systemSize()
{
int count = 0;
ListIterator<IonValue> iterator = systemIterator();
while (iterator.hasNext()) {
@SuppressWarnings("unused")
IonValue value = iterator.next();
count++;
... |
gallandarakhneorg/afc | core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/astar/AStar.java | AStar.setSegmentOrientationTool | public AStarSegmentOrientation<ST, PT> setSegmentOrientationTool(AStarSegmentOrientation<ST, PT> tool) {
final AStarSegmentOrientation<ST, PT> old = this.segmentOrientation;
this.segmentOrientation = tool;
return old;
} | java | public AStarSegmentOrientation<ST, PT> setSegmentOrientationTool(AStarSegmentOrientation<ST, PT> tool) {
final AStarSegmentOrientation<ST, PT> old = this.segmentOrientation;
this.segmentOrientation = tool;
return old;
} | [
"public",
"AStarSegmentOrientation",
"<",
"ST",
",",
"PT",
">",
"setSegmentOrientationTool",
"(",
"AStarSegmentOrientation",
"<",
"ST",
",",
"PT",
">",
"tool",
")",
"{",
"final",
"AStarSegmentOrientation",
"<",
"ST",
",",
"PT",
">",
"old",
"=",
"this",
".",
... | Set the tool that permits to retreive the orinetation of the segments.
@param tool the tool for retreiving the orientation of the segments.
@return the old tool. | [
"Set",
"the",
"tool",
"that",
"permits",
"to",
"retreive",
"the",
"orinetation",
"of",
"the",
"segments",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/astar/AStar.java#L257-L261 | train | Sets the tool for the segment orientation. | Of course, here is the Java code you requested:
```java
public AStarSegmentOrientation<ST, PT> setSegmentOrientationTool(AStarSegmentOrientation<ST, PT> tool) {
final AStarSegmentOrientation<ST, PT> old = this.segmentOrientation;
this.segmentOrientation = tool;
return old;
}
```
Hope this helps! |
JavaMoney/jsr354-api | src/main/java/javax/money/AbstractQuery.java | AbstractQuery.getProviderNames | public List<String> getProviderNames() {
@SuppressWarnings("unchecked") List<String> result = get(KEY_QUERY_PROVIDERS, List.class);
if (result == null) {
return Collections.emptyList();
}
return result;
} | java | public List<String> getProviderNames() {
@SuppressWarnings("unchecked") List<String> result = get(KEY_QUERY_PROVIDERS, List.class);
if (result == null) {
return Collections.emptyList();
}
return result;
} | [
"public",
"List",
"<",
"String",
">",
"getProviderNames",
"(",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"List",
"<",
"String",
">",
"result",
"=",
"get",
"(",
"KEY_QUERY_PROVIDERS",
",",
"List",
".",
"class",
")",
";",
"if",
"(",
"re... | Returns the providers and their ordering to be considered. This information typically must be interpreted by the
singleton SPI implementations, which are backing the singleton accessors.
If the list returned is empty, the default provider list,
determined by methods like {@code getDefaultProviderNames()} should be used... | [
"Returns",
"the",
"providers",
"and",
"their",
"ordering",
"to",
"be",
"considered",
".",
"This",
"information",
"typically",
"must",
"be",
"interpreted",
"by",
"the",
"singleton",
"SPI",
"implementations",
"which",
"are",
"backing",
"the",
"singleton",
"accessors... | 49a7ae436eaf45cac1040879185531ef22de5525 | https://github.com/JavaMoney/jsr354-api/blob/49a7ae436eaf45cac1040879185531ef22de5525/src/main/java/javax/money/AbstractQuery.java#L65-L72 | train | Gets the list of providers names. | Of course, here is the Java code you requested:
```java
public List<String> getProviderNames() {
@SuppressWarnings("unchecked") List<String> result = get(KEY_QUERY_PROVIDERS, List.class);
if (result == null) {
return Collections.emptyList();
}
return result;
}
```
Hope... |
spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/core/LdapRdn.java | LdapRdn.compareTo | public int compareTo(Object obj) {
LdapRdn that = (LdapRdn) obj;
if(this.components.size() != that.components.size()) {
return this.components.size() - that.components.size();
}
Set<Map.Entry<String,LdapRdnComponent>> theseEntries = this.components.entrySet();
for... | java | public int compareTo(Object obj) {
LdapRdn that = (LdapRdn) obj;
if(this.components.size() != that.components.size()) {
return this.components.size() - that.components.size();
}
Set<Map.Entry<String,LdapRdnComponent>> theseEntries = this.components.entrySet();
for... | [
"public",
"int",
"compareTo",
"(",
"Object",
"obj",
")",
"{",
"LdapRdn",
"that",
"=",
"(",
"LdapRdn",
")",
"obj",
";",
"if",
"(",
"this",
".",
"components",
".",
"size",
"(",
")",
"!=",
"that",
".",
"components",
".",
"size",
"(",
")",
")",
"{",
... | Compare this LdapRdn to another object.
@param obj the object to compare to.
@throws ClassCastException if the supplied object is not an LdapRdn
instance. | [
"Compare",
"this",
"LdapRdn",
"to",
"another",
"object",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/core/LdapRdn.java#L177-L198 | train | Compare two LdapRdn objects. | Of course, here is the Java code you requested:
```java
public int compareTo(Object obj) {
LdapRdn that = (LdapRdn) obj;
if(this.components.size() != that.components.size()) {
return this.components.size() - that.components.size();
}
Set<Map.Entry<String,LdapRdnComponent>... |
kiswanij/jk-util | src/main/java/com/jk/util/validation/builtin/SplitStringValidator.java | SplitStringValidator.validate | @Override
public boolean validate(final Problems problems, final String compName, final String model) {
final String[] components = model.split(this.regexp);
boolean result = true;
for (final String component : components) {
result &= this.other.validate(problems, compName, component);
}
return result;
} | java | @Override
public boolean validate(final Problems problems, final String compName, final String model) {
final String[] components = model.split(this.regexp);
boolean result = true;
for (final String component : components) {
result &= this.other.validate(problems, compName, component);
}
return result;
} | [
"@",
"Override",
"public",
"boolean",
"validate",
"(",
"final",
"Problems",
"problems",
",",
"final",
"String",
"compName",
",",
"final",
"String",
"model",
")",
"{",
"final",
"String",
"[",
"]",
"components",
"=",
"model",
".",
"split",
"(",
"this",
".",
... | /*
(non-Javadoc)
@see
com.fs.commons.desktop.validation.Validator#validate(com.fs.commons.desktop.
validation.Problems, java.lang.String, java.lang.Object) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/validation/builtin/SplitStringValidator.java#L66-L74 | train | Validate the model. | Of course, here is the Java code you requested:
```java
@Override
public boolean validate(final Problems problems, final String compName, final String model) {
final String[] components = model.split(this.regexp);
boolean result = true;
for (final String component : components) {
result &= this.other.validat... |
GoogleCloudPlatform/appengine-plugins-core | src/main/java/com/google/cloud/tools/appengine/operations/cloudsdk/internal/args/GcloudArgs.java | GcloudArgs.get | public static List<String> get(String name, @Nullable String value) {
return Args.string(name, value);
} | java | public static List<String> get(String name, @Nullable String value) {
return Args.string(name, value);
} | [
"public",
"static",
"List",
"<",
"String",
">",
"get",
"(",
"String",
"name",
",",
"@",
"Nullable",
"String",
"value",
")",
"{",
"return",
"Args",
".",
"string",
"(",
"name",
",",
"value",
")",
";",
"}"
] | Returns {@code [--name, value]} or {@code []} if value is null. | [
"Returns",
"{"
] | d22e9fa1103522409ab6fdfbf68c4a5a0bc5b97d | https://github.com/GoogleCloudPlatform/appengine-plugins-core/blob/d22e9fa1103522409ab6fdfbf68c4a5a0bc5b97d/src/main/java/com/google/cloud/tools/appengine/operations/cloudsdk/internal/args/GcloudArgs.java#L29-L31 | train | Get a list of strings. | Of course, here is the Java code you requested:
```java
public static List<String> get(String name, @Nullable String value) {
return Args.string(name, value);
}
```
Hope this helps! |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/dht/RangeStreamer.java | RangeStreamer.getAllRangesWithSourcesFor | private Multimap<Range<Token>, InetAddress> getAllRangesWithSourcesFor(String keyspaceName, Collection<Range<Token>> desiredRanges)
{
AbstractReplicationStrategy strat = Keyspace.open(keyspaceName).getReplicationStrategy();
Multimap<Range<Token>, InetAddress> rangeAddresses = strat.getRangeAddresses... | java | private Multimap<Range<Token>, InetAddress> getAllRangesWithSourcesFor(String keyspaceName, Collection<Range<Token>> desiredRanges)
{
AbstractReplicationStrategy strat = Keyspace.open(keyspaceName).getReplicationStrategy();
Multimap<Range<Token>, InetAddress> rangeAddresses = strat.getRangeAddresses... | [
"private",
"Multimap",
"<",
"Range",
"<",
"Token",
">",
",",
"InetAddress",
">",
"getAllRangesWithSourcesFor",
"(",
"String",
"keyspaceName",
",",
"Collection",
"<",
"Range",
"<",
"Token",
">",
">",
"desiredRanges",
")",
"{",
"AbstractReplicationStrategy",
"strat"... | Get a map of all ranges and their respective sources that are candidates for streaming the given ranges
to us. For each range, the list of sources is sorted by proximity relative to the given destAddress. | [
"Get",
"a",
"map",
"of",
"all",
"ranges",
"and",
"their",
"respective",
"sources",
"that",
"are",
"candidates",
"for",
"streaming",
"the",
"given",
"ranges",
"to",
"us",
".",
"For",
"each",
"range",
"the",
"list",
"of",
"sources",
"is",
"sorted",
"by",
"... | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/dht/RangeStreamer.java#L165-L188 | train | Get all ranges with sources for the given keyspace name | Of course, here is the Java code you requested:
```java
private Multimap<Range<Token>, InetAddress> getAllRangesWithSourcesFor(String keyspaceName, Collection<Range<Token>> desiredRanges)
{
AbstractReplicationStrategy strat = Keyspace.open(keyspaceName).getReplicationStrategy();
Multimap<Range<Toke... |
google/closure-compiler | src/com/google/javascript/jscomp/CoverageInstrumentationCallback.java | CoverageInstrumentationCallback.visit | @Override
public void visit(NodeTraversal traversal, Node node, Node parent) {
// SCRIPT node is special - it is the root of the AST for code from a file.
// Append code to declare and initialize structures used in instrumentation.
if (node.isScript()) {
String fileName = getFileName(traversal);
... | java | @Override
public void visit(NodeTraversal traversal, Node node, Node parent) {
// SCRIPT node is special - it is the root of the AST for code from a file.
// Append code to declare and initialize structures used in instrumentation.
if (node.isScript()) {
String fileName = getFileName(traversal);
... | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"NodeTraversal",
"traversal",
",",
"Node",
"node",
",",
"Node",
"parent",
")",
"{",
"// SCRIPT node is special - it is the root of the AST for code from a file.",
"// Append code to declare and initialize structures used in instrumen... | Instruments the JS code by inserting appropriate nodes into the AST. The
instrumentation logic is tuned to collect "line coverage" data only. | [
"Instruments",
"the",
"JS",
"code",
"by",
"inserting",
"appropriate",
"nodes",
"into",
"the",
"AST",
".",
"The",
"instrumentation",
"logic",
"is",
"tuned",
"to",
"collect",
"line",
"coverage",
"data",
"only",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CoverageInstrumentationCallback.java#L146-L208 | train | Override the visit method to add instrumentation code to a block. | Of course, here is the Java code you requested:
```java
@Override
public void visit(NodeTraversal traversal, Node node, Node parent) {
// SCRIPT node is special - it is the root of the AST for code from a file.
// Append code to declare and initialize structures used in instrumentation.
if (node.isScript... |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/util/LatLongUtils.java | LatLongUtils.parseCoordinateString | public static double[] parseCoordinateString(String coordinatesString, int numberOfCoordinates) {
StringTokenizer stringTokenizer = new StringTokenizer(coordinatesString, DELIMITER, true);
boolean isDelimiter = true;
List<String> tokens = new ArrayList<>(numberOfCoordinates);
while (str... | java | public static double[] parseCoordinateString(String coordinatesString, int numberOfCoordinates) {
StringTokenizer stringTokenizer = new StringTokenizer(coordinatesString, DELIMITER, true);
boolean isDelimiter = true;
List<String> tokens = new ArrayList<>(numberOfCoordinates);
while (str... | [
"public",
"static",
"double",
"[",
"]",
"parseCoordinateString",
"(",
"String",
"coordinatesString",
",",
"int",
"numberOfCoordinates",
")",
"{",
"StringTokenizer",
"stringTokenizer",
"=",
"new",
"StringTokenizer",
"(",
"coordinatesString",
",",
"DELIMITER",
",",
"tru... | Parses a given number of comma-separated coordinate values from the supplied string.
@param coordinatesString a comma-separated string of coordinate values.
@param numberOfCoordinates the expected number of coordinate values in the string.
@return the coordinate values in the order they have been parsed from the str... | [
"Parses",
"a",
"given",
"number",
"of",
"comma",
"-",
"separated",
"coordinate",
"values",
"from",
"the",
"supplied",
"string",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/LatLongUtils.java#L249-L275 | train | Parses a string of coordinates into an array of double values. | Of course, here is the Java code you requested:
```java
public static double[] parseCoordinateString(String coordinatesString, int numberOfCoordinates) {
StringTokenizer stringTokenizer = new StringTokenizer(coordinatesString, DELIMITER, true);
boolean isDelimiter = true;
List<String> tokens = ... |
casbin/jcasbin | src/main/java/org/casbin/jcasbin/main/Enforcer.java | Enforcer.addPermissionForUser | public boolean addPermissionForUser(String user, List<String> permission) {
return addPermissionForUser(user, permission.toArray(new String[0]));
} | java | public boolean addPermissionForUser(String user, List<String> permission) {
return addPermissionForUser(user, permission.toArray(new String[0]));
} | [
"public",
"boolean",
"addPermissionForUser",
"(",
"String",
"user",
",",
"List",
"<",
"String",
">",
"permission",
")",
"{",
"return",
"addPermissionForUser",
"(",
"user",
",",
"permission",
".",
"toArray",
"(",
"new",
"String",
"[",
"0",
"]",
")",
")",
";... | addPermissionForUser adds a permission for a user or role.
Returns false if the user or role already has the permission (aka not affected).
@param user the user.
@param permission the permission, usually be (obj, act). It is actually the rule without the subject.
@return succeeds or not. | [
"addPermissionForUser",
"adds",
"a",
"permission",
"for",
"a",
"user",
"or",
"role",
".",
"Returns",
"false",
"if",
"the",
"user",
"or",
"role",
"already",
"has",
"the",
"permission",
"(",
"aka",
"not",
"affected",
")",
"."
] | b46d7a756b6c39cdb17e0600607e5fcdc66edd11 | https://github.com/casbin/jcasbin/blob/b46d7a756b6c39cdb17e0600607e5fcdc66edd11/src/main/java/org/casbin/jcasbin/main/Enforcer.java#L268-L270 | train | Add permission for a user. | Of course, here is the Java code you requested:
```java
public boolean addPermissionForUser(String user, List<String> permission) {
return addPermissionForUser(user, permission.toArray(new String[0]));
}
```
Hope this helps! |
perwendel/spark | src/main/java/spark/TemplateViewRouteImpl.java | TemplateViewRouteImpl.create | public static TemplateViewRouteImpl create(String path,
TemplateViewRoute route,
TemplateEngine engine) {
return create(path, Service.DEFAULT_ACCEPT_TYPE, route, engine);
} | java | public static TemplateViewRouteImpl create(String path,
TemplateViewRoute route,
TemplateEngine engine) {
return create(path, Service.DEFAULT_ACCEPT_TYPE, route, engine);
} | [
"public",
"static",
"TemplateViewRouteImpl",
"create",
"(",
"String",
"path",
",",
"TemplateViewRoute",
"route",
",",
"TemplateEngine",
"engine",
")",
"{",
"return",
"create",
"(",
"path",
",",
"Service",
".",
"DEFAULT_ACCEPT_TYPE",
",",
"route",
",",
"engine",
... | factory method
@param path the path
@param route the route
@param engine the engine
@return the wrapper template view route | [
"factory",
"method"
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/TemplateViewRouteImpl.java#L37-L42 | train | Create a new TemplateViewRoute with default accept type and template engine | Of course, here is the Java code you requested:
```java
public static TemplateViewRouteImpl create(String path,
TemplateViewRoute route,
TemplateEngine engine) {
return create(path, Service.DEFAULT_ACCEPT_TYPE, route... |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/data/conversion/AbstractConverterRegistry.java | AbstractConverterRegistry.unregister | @NullSafe
@Override
@SuppressWarnings("unchecked")
public <R extends Registry<Converter<?, ?>>> R unregister(Converter<?, ?> converter) {
for (Iterator<Converter<?, ?>> iterator = iterator(); iterator.hasNext(); ) {
if (iterator.next().equals(converter)) {
iterator.remove();
converter.s... | java | @NullSafe
@Override
@SuppressWarnings("unchecked")
public <R extends Registry<Converter<?, ?>>> R unregister(Converter<?, ?> converter) {
for (Iterator<Converter<?, ?>> iterator = iterator(); iterator.hasNext(); ) {
if (iterator.next().equals(converter)) {
iterator.remove();
converter.s... | [
"@",
"NullSafe",
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"R",
"extends",
"Registry",
"<",
"Converter",
"<",
"?",
",",
"?",
">",
">",
">",
"R",
"unregister",
"(",
"Converter",
"<",
"?",
",",
"?",
">",
"convert... | Unregisters the {@link Converter} from this {@link ConverterRegistry}.
@param converter {@link Converter} to unregister.
@return this {@link ConverterRegistry}.
@see org.cp.elements.data.conversion.Converter
@see #register(Converter) | [
"Unregisters",
"the",
"{",
"@link",
"Converter",
"}",
"from",
"this",
"{",
"@link",
"ConverterRegistry",
"}",
"."
] | f2163c149fbbef05015e688132064ebcac7c49ab | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/data/conversion/AbstractConverterRegistry.java#L111-L124 | train | Unregister a single entry from the sequence. | Of course, here is the Java code you requested:
```java
@NullSafe
@Override
@SuppressWarnings("unchecked")
public <R extends Registry<Converter<?, ?>>> R unregister(Converter<?, ?> converter) {
for (Iterator<Converter<?, ?>> iterator = iterator(); iterator.hasNext(); ) {
if (iterator.next().equals(con... |
wg/lettuce | src/main/java/com/lambdaworks/redis/RedisConnection.java | RedisConnection.evalsha | @SuppressWarnings("unchecked")
public <T> T evalsha(String digest, ScriptOutputType type, K... keys) {
return (T) await(c.evalsha(digest, type, keys, (V[]) new Object[0]));
} | java | @SuppressWarnings("unchecked")
public <T> T evalsha(String digest, ScriptOutputType type, K... keys) {
return (T) await(c.evalsha(digest, type, keys, (V[]) new Object[0]));
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"evalsha",
"(",
"String",
"digest",
",",
"ScriptOutputType",
"type",
",",
"K",
"...",
"keys",
")",
"{",
"return",
"(",
"T",
")",
"await",
"(",
"c",
".",
"evalsha",
"(",
... | Eval a pre-loaded script identified by its SHA-1 digest, which must result
in the requested {@link ScriptOutputType type}.
@param digest Lowercase hex string of script's SHA-1 digest.
@param type Script output type.
@param keys Redis keys to pass to script.
@param <T> Expected return type.
@return... | [
"Eval",
"a",
"pre",
"-",
"loaded",
"script",
"identified",
"by",
"its",
"SHA",
"-",
"1",
"digest",
"which",
"must",
"result",
"in",
"the",
"requested",
"{",
"@link",
"ScriptOutputType",
"type",
"}",
"."
] | 5141640dc8289ff3af07b44a87020cef719c5f4a | https://github.com/wg/lettuce/blob/5141640dc8289ff3af07b44a87020cef719c5f4a/src/main/java/com/lambdaworks/redis/RedisConnection.java#L203-L206 | train | Evaluate a SHA - 1 digest. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public <T> T evalsha(String digest, ScriptOutputType type, K... keys) {
return (T) await(c.evalsha(digest, type, keys, (V[]) new Object[0]));
}
```
Hope this helps! |
lightblueseas/xml-extensions | src/main/java/de/alpharogroup/xml/XmlExtensions.java | XmlExtensions.loadObject | private static <T> T loadObject(final InputStream is) throws IOException
{
final String xmlString = ReadFileExtensions.inputStream2String(is);
final T object = XmlToObjectExtensions.toObjectWithXStream(xmlString);
return object;
} | java | private static <T> T loadObject(final InputStream is) throws IOException
{
final String xmlString = ReadFileExtensions.inputStream2String(is);
final T object = XmlToObjectExtensions.toObjectWithXStream(xmlString);
return object;
} | [
"private",
"static",
"<",
"T",
">",
"T",
"loadObject",
"(",
"final",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"final",
"String",
"xmlString",
"=",
"ReadFileExtensions",
".",
"inputStream2String",
"(",
"is",
")",
";",
"final",
"T",
"object",
"=... | Load from the given input stream that should represent an xml file and transform it to the
generic type object.
@param <T>
the generic type
@param is
the input stream
@return the object from the given input stream.
@throws IOException
Signals that an I/O exception has occurred. | [
"Load",
"from",
"the",
"given",
"input",
"stream",
"that",
"should",
"represent",
"an",
"xml",
"file",
"and",
"transform",
"it",
"to",
"the",
"generic",
"type",
"object",
"."
] | 4c79d3b2a27349cc7b682d88ce55ac06025e6612 | https://github.com/lightblueseas/xml-extensions/blob/4c79d3b2a27349cc7b682d88ce55ac06025e6612/src/main/java/de/alpharogroup/xml/XmlExtensions.java#L89-L94 | valid | Load an object from an input stream. | Of course, here is the Java code you requested:
```java
private static <T> T loadObject(final InputStream is) throws IOException
{
final String xmlString = ReadFileExtensions.inputStream2String(is);
final T object = XmlToObjectExtensions.toObjectWithXStream(xmlString);
return object;
}
```
Hope this helps! |
flow/nbt | src/main/java/com/flowpowered/nbt/stream/NBTOutputStream.java | NBTOutputStream.writeIntArrayTagPayload | private void writeIntArrayTagPayload(IntArrayTag tag) throws IOException {
int[] ints = tag.getValue();
os.writeInt(ints.length);
for (int i = 0; i < ints.length; i++) {
os.writeInt(ints[i]);
}
} | java | private void writeIntArrayTagPayload(IntArrayTag tag) throws IOException {
int[] ints = tag.getValue();
os.writeInt(ints.length);
for (int i = 0; i < ints.length; i++) {
os.writeInt(ints[i]);
}
} | [
"private",
"void",
"writeIntArrayTagPayload",
"(",
"IntArrayTag",
"tag",
")",
"throws",
"IOException",
"{",
"int",
"[",
"]",
"ints",
"=",
"tag",
".",
"getValue",
"(",
")",
";",
"os",
".",
"writeInt",
"(",
"ints",
".",
"length",
")",
";",
"for",
"(",
"i... | Writes a {@code TAG_Int_Array} tag.
@param tag The tag.
@throws java.io.IOException if an I/O error occurs. | [
"Writes",
"a",
"{",
"@code",
"TAG_Int_Array",
"}",
"tag",
"."
] | 7a1b6d986e6fbd01862356d47827b8b357349a22 | https://github.com/flow/nbt/blob/7a1b6d986e6fbd01862356d47827b8b357349a22/src/main/java/com/flowpowered/nbt/stream/NBTOutputStream.java#L301-L307 | train | Write int array tag payload. | Of course, here is the Java code you requested:
```java
private void writeIntArrayTagPayload(IntArrayTag tag) throws IOException {
int[] ints = tag.getValue();
os.writeInt(ints.length);
for (int i = 0; i < ints.length; i++) {
os.writeInt(ints[i]);
}
}
```
Hope this help... |
linkedin/parseq | subprojects/parseq-zk-client/src/main/java/com/linkedin/parseq/zk/client/ZKClientImpl.java | ZKClientImpl.getChildren | @Override
public WatchableTask<List<String>> getChildren(String path) {
return new WatchableTask<List<String>>("zkGetChildren: " + path) {
@Override
protected Promise run(Context context) throws Throwable {
SettablePromise<List<String>> promise = Promises.settable();
_zkClient.getChild... | java | @Override
public WatchableTask<List<String>> getChildren(String path) {
return new WatchableTask<List<String>>("zkGetChildren: " + path) {
@Override
protected Promise run(Context context) throws Throwable {
SettablePromise<List<String>> promise = Promises.settable();
_zkClient.getChild... | [
"@",
"Override",
"public",
"WatchableTask",
"<",
"List",
"<",
"String",
">",
">",
"getChildren",
"(",
"String",
"path",
")",
"{",
"return",
"new",
"WatchableTask",
"<",
"List",
"<",
"String",
">",
">",
"(",
"\"zkGetChildren: \"",
"+",
"path",
")",
"{",
"... | {@inheritDoc} | [
"{"
] | 35b194c2837ad45c36e80c2333c5feeb561ca24e | https://github.com/linkedin/parseq/blob/35b194c2837ad45c36e80c2333c5feeb561ca24e/subprojects/parseq-zk-client/src/main/java/com/linkedin/parseq/zk/client/ZKClientImpl.java#L211-L230 | valid | Gets children of a node. | Of course, here is the Java code you requested:
```java
@Override
public WatchableTask<List<String>> getChildren(String path) {
return new WatchableTask<List<String>>("zkGetChildren: " + path) {
@Override
protected Promise run(Context context) throws Throwable {
SettablePromise<List<String>> ... |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/util/plugin/PluginConfigSupport.java | PluginConfigSupport.getPlugins | public Plugin[] getPlugins() {
if (mPluginContext != null) {
Collection c = mPluginContext.getPlugins().values();
if (c != null) {
return (Plugin[])c.toArray(new Plugin[c.size()]);
}
}
return new Plugin[0];
} | java | public Plugin[] getPlugins() {
if (mPluginContext != null) {
Collection c = mPluginContext.getPlugins().values();
if (c != null) {
return (Plugin[])c.toArray(new Plugin[c.size()]);
}
}
return new Plugin[0];
} | [
"public",
"Plugin",
"[",
"]",
"getPlugins",
"(",
")",
"{",
"if",
"(",
"mPluginContext",
"!=",
"null",
")",
"{",
"Collection",
"c",
"=",
"mPluginContext",
".",
"getPlugins",
"(",
")",
".",
"values",
"(",
")",
";",
"if",
"(",
"c",
"!=",
"null",
")",
... | Returns an array of all of the Plugins.
@return the array of Plugins. | [
"Returns",
"an",
"array",
"of",
"all",
"of",
"the",
"Plugins",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/util/plugin/PluginConfigSupport.java#L78-L86 | train | Get the plugins. | Of course, here is the Java code you requested:
```java
public Plugin[] getPlugins() {
if (mPluginContext != null) {
Collection c = mPluginContext.getPlugins().values();
if (c != null) {
return (Plugin[])c.toArray(new Plugin[c.size()]);
}
}
return new Plugin[0];
}
```
Hope this helps! |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java | SarlDocumentationParser.reportError | protected static void reportError(ParsingContext context, String message, Object... parameter) {
final File file = context.getCurrentFile();
final int offset = context.getMatcher().start() + context.getStartIndex();
final int lineno = context.getLineNo();
Throwable cause = null;
for (final Object param :... | java | protected static void reportError(ParsingContext context, String message, Object... parameter) {
final File file = context.getCurrentFile();
final int offset = context.getMatcher().start() + context.getStartIndex();
final int lineno = context.getLineNo();
Throwable cause = null;
for (final Object param :... | [
"protected",
"static",
"void",
"reportError",
"(",
"ParsingContext",
"context",
",",
"String",
"message",
",",
"Object",
"...",
"parameter",
")",
"{",
"final",
"File",
"file",
"=",
"context",
".",
"getCurrentFile",
"(",
")",
";",
"final",
"int",
"offset",
"=... | Report an error.
@param context the context.
@param message the message in a format compatible with {@link MessageFormat}. The first argument is
the filename. The second argument is the line number. The third argument is the position in the file.
@param parameter additional parameter, starting at {4}. | [
"Report",
"an",
"error",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java#L965-L986 | train | Report an error. | Of course, here is the Java code you requested:
```java
protected static void reportError(ParsingContext context, String message, Object... parameter) {
final File file = context.getCurrentFile();
final int offset = context.getMatcher().start() + context.getStartIndex();
final int lineno = context.getLineNo()... |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/jvm/Gen.java | Gen.estimateCodeComplexity | int estimateCodeComplexity(JCTree tree) {
if (tree == null) return 0;
class ComplexityScanner extends TreeScanner {
int complexity = 0;
public void scan(JCTree tree) {
if (complexity > jsrlimit) return;
super.scan(tree);
}
p... | java | int estimateCodeComplexity(JCTree tree) {
if (tree == null) return 0;
class ComplexityScanner extends TreeScanner {
int complexity = 0;
public void scan(JCTree tree) {
if (complexity > jsrlimit) return;
super.scan(tree);
}
p... | [
"int",
"estimateCodeComplexity",
"(",
"JCTree",
"tree",
")",
"{",
"if",
"(",
"tree",
"==",
"null",
")",
"return",
"0",
";",
"class",
"ComplexityScanner",
"extends",
"TreeScanner",
"{",
"int",
"complexity",
"=",
"0",
";",
"public",
"void",
"scan",
"(",
"JCT... | Very roughly estimate the number of instructions needed for
the given tree. | [
"Very",
"roughly",
"estimate",
"the",
"number",
"of",
"instructions",
"needed",
"for",
"the",
"given",
"tree",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/jvm/Gen.java#L1665-L1747 | train | Estimates the code complexity of a JCTree. | Of course, here is the Java code you requested:
```java
int estimateCodeComplexity(JCTree tree) {
if (tree == null) return 0;
class ComplexityScanner extends TreeScanner {
int complexity = 0;
public void scan(JCTree tree) {
if (complexity > jsrlimit) return;
... |
TheHortonMachine/hortonmachine | dbs/src/main/java/jsqlite/Database.java | Database.compile | public Vm compile( String sql, String args[] ) throws jsqlite.Exception {
synchronized (this) {
Vm vm = new Vm();
vm_compile_args(sql, vm, args);
return vm;
}
} | java | public Vm compile( String sql, String args[] ) throws jsqlite.Exception {
synchronized (this) {
Vm vm = new Vm();
vm_compile_args(sql, vm, args);
return vm;
}
} | [
"public",
"Vm",
"compile",
"(",
"String",
"sql",
",",
"String",
"args",
"[",
"]",
")",
"throws",
"jsqlite",
".",
"Exception",
"{",
"synchronized",
"(",
"this",
")",
"{",
"Vm",
"vm",
"=",
"new",
"Vm",
"(",
")",
";",
"vm_compile_args",
"(",
"sql",
",",... | Compile and return SQLite VM for SQL statement. Only available
in SQLite 3.0 and above, otherwise a no-op.
@param sql SQL statement to be compiled
@param args arguments for the SQL statement, '%q' substitution
@return a Vm object | [
"Compile",
"and",
"return",
"SQLite",
"VM",
"for",
"SQL",
"statement",
".",
"Only",
"available",
"in",
"SQLite",
"3",
".",
"0",
"and",
"above",
"otherwise",
"a",
"no",
"-",
"op",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/jsqlite/Database.java#L696-L702 | train | Compile a SQL statement and return a Vm object. | Of course, here is the Java code you requested:
```java
public Vm compile( String sql, String args[] ) throws jsqlite.Exception {
synchronized (this) {
Vm vm = new Vm();
vm_compile_args(sql, vm, args);
return vm;
}
}
```
Hope this helps! |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/ftp/FTPFileSystem.java | FTPFileSystem.makeAbsolute | private Path makeAbsolute(Path workDir, Path path) {
if (path.isAbsolute()) {
return path;
}
return new Path(workDir, path);
} | java | private Path makeAbsolute(Path workDir, Path path) {
if (path.isAbsolute()) {
return path;
}
return new Path(workDir, path);
} | [
"private",
"Path",
"makeAbsolute",
"(",
"Path",
"workDir",
",",
"Path",
"path",
")",
"{",
"if",
"(",
"path",
".",
"isAbsolute",
"(",
")",
")",
"{",
"return",
"path",
";",
"}",
"return",
"new",
"Path",
"(",
"workDir",
",",
"path",
")",
";",
"}"
] | Resolve against given working directory. *
@param workDir
@param path
@return | [
"Resolve",
"against",
"given",
"working",
"directory",
".",
"*"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/ftp/FTPFileSystem.java#L151-L156 | train | Make absolute path. | Of course, here is the Java code you requested:
```java
private Path makeAbsolute(Path workDir, Path path) {
if (path.isAbsolute()) {
return path;
}
return new Path(workDir, path);
}
```
Hope this helps! |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/AbstractEntityReader.java | AbstractEntityReader.fetchDataFromLucene | protected Set<String> fetchDataFromLucene(Class<?> clazz, Client client)
{
// use lucene to query and get Pk's only.
// go to client and get relation with values.!
// populate EnhanceEntity
/** The lucene query from jpa query. */
String luceneQueryFromJPAQuery = KunderaCoreU... | java | protected Set<String> fetchDataFromLucene(Class<?> clazz, Client client)
{
// use lucene to query and get Pk's only.
// go to client and get relation with values.!
// populate EnhanceEntity
/** The lucene query from jpa query. */
String luceneQueryFromJPAQuery = KunderaCoreU... | [
"protected",
"Set",
"<",
"String",
">",
"fetchDataFromLucene",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"Client",
"client",
")",
"{",
"// use lucene to query and get Pk's only.",
"// go to client and get relation with values.!",
"// populate EnhanceEntity",
"/** The lucene ... | Fetch data from lucene.
@param client
the client
@return the sets the | [
"Fetch",
"data",
"from",
"lucene",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/AbstractEntityReader.java#L603-L615 | train | Fetch data from lucene. | Of course, here is the Java code you requested:
```java
protected Set<String> fetchDataFromLucene(Class<?> clazz, Client client)
{
// use lucene to query and get Pk's only.
// go to client and get relation with values.!
// populate EnhanceEntity
/** The lucene query from jpa query.... |
liveontologies/elk-reasoner | elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/saturation/properties/ObjectPropertyTaxonomyComputationFactory.java | ObjectPropertyTaxonomyComputationFactory.instertIntoTaxonomy | private void instertIntoTaxonomy(final IndexedObjectProperty property) {
/*
* @formatter:off
*
* Transitive reduction and taxonomy computation
* if sub-properties of a sub-property contain this property,
* they are equivalent
* if a property is a strict sub-property of another strict sub-prop... | java | private void instertIntoTaxonomy(final IndexedObjectProperty property) {
/*
* @formatter:off
*
* Transitive reduction and taxonomy computation
* if sub-properties of a sub-property contain this property,
* they are equivalent
* if a property is a strict sub-property of another strict sub-prop... | [
"private",
"void",
"instertIntoTaxonomy",
"(",
"final",
"IndexedObjectProperty",
"property",
")",
"{",
"/* \n\t\t * @formatter:off\n\t\t * \n\t\t * Transitive reduction and taxonomy computation\n\t\t * \tif sub-properties of a sub-property contain this property,\n\t\t * \t\tthey are equivalent\n\t... | Adds the specified object property into the taxonomy if it is not in it
yet and sets its direct sub-properties if not set yet.
@param property
The property that should be inserted into taxonomy. | [
"Adds",
"the",
"specified",
"object",
"property",
"into",
"the",
"taxonomy",
"if",
"it",
"is",
"not",
"in",
"it",
"yet",
"and",
"sets",
"its",
"direct",
"sub",
"-",
"properties",
"if",
"not",
"set",
"yet",
"."
] | cfbe5279a57e0433d45c1676c7658ddb6e29b9eb | https://github.com/liveontologies/elk-reasoner/blob/cfbe5279a57e0433d45c1676c7658ddb6e29b9eb/elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/saturation/properties/ObjectPropertyTaxonomyComputationFactory.java#L112-L190 | test | Inerts the property into the taxonomy. | Of course, here is the Java code you requested:
```java
private void instertIntoTaxonomy(final IndexedObjectProperty property) {
/*
* @formatter:off
*
* Transitive reduction and taxonomy computation
* if sub-properties of a sub-property contain this property,
* they are equivalent
* if a pro... |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowTriggersInner.java | WorkflowTriggersInner.getSchemaJsonAsync | public ServiceFuture<JsonSchemaInner> getSchemaJsonAsync(String resourceGroupName, String workflowName, String triggerName, final ServiceCallback<JsonSchemaInner> serviceCallback) {
return ServiceFuture.fromResponse(getSchemaJsonWithServiceResponseAsync(resourceGroupName, workflowName, triggerName), serviceCall... | java | public ServiceFuture<JsonSchemaInner> getSchemaJsonAsync(String resourceGroupName, String workflowName, String triggerName, final ServiceCallback<JsonSchemaInner> serviceCallback) {
return ServiceFuture.fromResponse(getSchemaJsonWithServiceResponseAsync(resourceGroupName, workflowName, triggerName), serviceCall... | [
"public",
"ServiceFuture",
"<",
"JsonSchemaInner",
">",
"getSchemaJsonAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"workflowName",
",",
"String",
"triggerName",
",",
"final",
"ServiceCallback",
"<",
"JsonSchemaInner",
">",
"serviceCallback",
")",
"{",
"r... | Get the trigger schema as JSON.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@param triggerName The workflow trigger name.
@param serviceCallback the async ServiceCallback to handle successful and failed responses.
@throws IllegalArgumentException thrown if parameters fail t... | [
"Get",
"the",
"trigger",
"schema",
"as",
"JSON",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowTriggersInner.java#L652-L654 | train | Gets the schema JSON of the trigger identified by workflow name. | Of course, here is the Java code you requested:
```java
public ServiceFuture<JsonSchemaInner> getSchemaJsonAsync(String resourceGroupName, String workflowName, String triggerName, final ServiceCallback<JsonSchemaInner> serviceCallback) {
return ServiceFuture.fromResponse(getSchemaJsonWithServiceResponseAsync(r... |
shrinkwrap/shrinkwrap | impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/ServiceProviderAsset.java | ServiceProviderAsset.openStream | @Override
public InputStream openStream() {
StringBuilder content = new StringBuilder();
for (String providerImpl : providerImpls) {
content.append(providerImpl).append('\n');
}
return new ByteArrayInputStream(content.toString().getBytes());
} | java | @Override
public InputStream openStream() {
StringBuilder content = new StringBuilder();
for (String providerImpl : providerImpls) {
content.append(providerImpl).append('\n');
}
return new ByteArrayInputStream(content.toString().getBytes());
} | [
"@",
"Override",
"public",
"InputStream",
"openStream",
"(",
")",
"{",
"StringBuilder",
"content",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"String",
"providerImpl",
":",
"providerImpls",
")",
"{",
"content",
".",
"append",
"(",
"providerImpl",
... | /*
(non-Javadoc)
@see org.jboss.shrinkwrap.api.Asset#openStream() | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 3f8a1a6d344651428c709a63ebb52d35343c5387 | https://github.com/shrinkwrap/shrinkwrap/blob/3f8a1a6d344651428c709a63ebb52d35343c5387/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/ServiceProviderAsset.java#L72-L79 | train | Open an InputStream to the XML file. | Of course, here is the Java code you requested:
```java
@Override
public InputStream openStream() {
StringBuilder content = new StringBuilder();
for (String providerImpl : providerImpls) {
content.append(providerImpl).append('\n');
}
return new ByteArrayInputStream(conte... |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/collection/PdfCollectionSort.java | PdfCollectionSort.setSortOrder | public void setSortOrder(boolean ascending) {
PdfObject o = get(PdfName.S);
if (o instanceof PdfName) {
put(PdfName.A, new PdfBoolean(ascending));
}
else {
throw new IllegalArgumentException("You have to define a boolean array for this collection sort dictionary.");
}
} | java | public void setSortOrder(boolean ascending) {
PdfObject o = get(PdfName.S);
if (o instanceof PdfName) {
put(PdfName.A, new PdfBoolean(ascending));
}
else {
throw new IllegalArgumentException("You have to define a boolean array for this collection sort dictionary.");
}
} | [
"public",
"void",
"setSortOrder",
"(",
"boolean",
"ascending",
")",
"{",
"PdfObject",
"o",
"=",
"get",
"(",
"PdfName",
".",
"S",
")",
";",
"if",
"(",
"o",
"instanceof",
"PdfName",
")",
"{",
"put",
"(",
"PdfName",
".",
"A",
",",
"new",
"PdfBoolean",
"... | Defines the sort order of the field (ascending or descending).
@param ascending true is the default, use false for descending order | [
"Defines",
"the",
"sort",
"order",
"of",
"the",
"field",
"(",
"ascending",
"or",
"descending",
")",
"."
] | 438fc1899367fd13dfdfa8dfdca9a3c1a7783b84 | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/collection/PdfCollectionSort.java#L37-L45 | train | Sets the sort direction. | Of course, here is the Java code you requested:
```java
public void setSortOrder(boolean ascending) {
PdfObject o = get(PdfName.S);
if (o instanceof PdfName) {
put(PdfName.A, new PdfBoolean(ascending));
}
else {
throw new IllegalArgumentException("You have to define a boolean array for this collection so... |
aws/aws-sdk-java | aws-java-sdk-applicationautoscaling/src/main/java/com/amazonaws/services/applicationautoscaling/model/DescribeScalingPoliciesRequest.java | DescribeScalingPoliciesRequest.setPolicyNames | public void setPolicyNames(java.util.Collection<String> policyNames) {
if (policyNames == null) {
this.policyNames = null;
return;
}
this.policyNames = new java.util.ArrayList<String>(policyNames);
} | java | public void setPolicyNames(java.util.Collection<String> policyNames) {
if (policyNames == null) {
this.policyNames = null;
return;
}
this.policyNames = new java.util.ArrayList<String>(policyNames);
} | [
"public",
"void",
"setPolicyNames",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"String",
">",
"policyNames",
")",
"{",
"if",
"(",
"policyNames",
"==",
"null",
")",
"{",
"this",
".",
"policyNames",
"=",
"null",
";",
"return",
";",
"}",
"this",
".... | <p>
The names of the scaling policies to describe.
</p>
@param policyNames
The names of the scaling policies to describe. | [
"<p",
">",
"The",
"names",
"of",
"the",
"scaling",
"policies",
"to",
"describe",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-applicationautoscaling/src/main/java/com/amazonaws/services/applicationautoscaling/model/DescribeScalingPoliciesRequest.java#L217-L224 | train | Sets the value of the policyNames property. | Of course, here is the Java code you requested:
```java
public void setPolicyNames(java.util.Collection<String> policyNames) {
if (policyNames == null) {
this.policyNames = null;
return;
}
this.policyNames = new java.util.ArrayList<String>(policyNames);
}
```
Hope ... |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/CmsPopup.java | CmsPopup.centerHorizontally | public void centerHorizontally(int top) {
if (Position.FIXED.getCssName().equals(getElement().getStyle().getPosition())) {
show();
// keep position fixed, as may have been set to absolute
setPositionFixed();
int left = (Window.getClientWidth() - getOffsetWidth())... | java | public void centerHorizontally(int top) {
if (Position.FIXED.getCssName().equals(getElement().getStyle().getPosition())) {
show();
// keep position fixed, as may have been set to absolute
setPositionFixed();
int left = (Window.getClientWidth() - getOffsetWidth())... | [
"public",
"void",
"centerHorizontally",
"(",
"int",
"top",
")",
"{",
"if",
"(",
"Position",
".",
"FIXED",
".",
"getCssName",
"(",
")",
".",
"equals",
"(",
"getElement",
"(",
")",
".",
"getStyle",
"(",
")",
".",
"getPosition",
"(",
")",
")",
")",
"{",... | Shows the dialog and centers it horizontally, but positions it at a fixed vertical position.<p>
@param top the top position | [
"Shows",
"the",
"dialog",
"and",
"centers",
"it",
"horizontally",
"but",
"positions",
"it",
"at",
"a",
"fixed",
"vertical",
"position",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsPopup.java#L592-L605 | train | Center the popup horizontally. | Of course, here is the Java code you requested:
```java
public void centerHorizontally(int top) {
if (Position.FIXED.getCssName().equals(getElement().getStyle().getPosition())) {
show();
// keep position fixed, as may have been set to absolute
setPositionFixed();
... |
tobato/FastDFS_Client | src/main/java/com/github/tobato/fastdfs/domain/proto/mapper/FdfsParamMapper.java | FdfsParamMapper.mapByIndex | private static <T> T mapByIndex(byte[] content, Class<T> genericType, ObjectMetaData objectMap, Charset charset)
throws InstantiationException, IllegalAccessException, InvocationTargetException {
List<FieldMetaData> mappingFields = objectMap.getFieldList();
T obj = genericType.newInstance()... | java | private static <T> T mapByIndex(byte[] content, Class<T> genericType, ObjectMetaData objectMap, Charset charset)
throws InstantiationException, IllegalAccessException, InvocationTargetException {
List<FieldMetaData> mappingFields = objectMap.getFieldList();
T obj = genericType.newInstance()... | [
"private",
"static",
"<",
"T",
">",
"T",
"mapByIndex",
"(",
"byte",
"[",
"]",
"content",
",",
"Class",
"<",
"T",
">",
"genericType",
",",
"ObjectMetaData",
"objectMap",
",",
"Charset",
"charset",
")",
"throws",
"InstantiationException",
",",
"IllegalAccessExce... | 按列顺序映射
@param content
@param genericType
@param objectMap
@return
@throws InstantiationException
@throws IllegalAccessException
@throws InvocationTargetException | [
"按列顺序映射"
] | 8e3bfe712f1739028beed7f3a6b2cc4579a231e4 | https://github.com/tobato/FastDFS_Client/blob/8e3bfe712f1739028beed7f3a6b2cc4579a231e4/src/main/java/com/github/tobato/fastdfs/domain/proto/mapper/FdfsParamMapper.java#L90-L103 | train | Map by index. | Of course, here is the Java code you requested:
```java
private static <T> T mapByIndex(byte[] content, Class<T> genericType, ObjectMetaData objectMap, Charset charset)
throws InstantiationException, IllegalAccessException, InvocationTargetException {
List<FieldMetaData> mappingFields = objectMap.... |
geomajas/geomajas-project-client-gwt | common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java | HtmlBuilder.openTag | public static String openTag(String tag, String clazz, String style, String... content) {
return openTag(tag, clazz, style, false, content);
} | java | public static String openTag(String tag, String clazz, String style, String... content) {
return openTag(tag, clazz, style, false, content);
} | [
"public",
"static",
"String",
"openTag",
"(",
"String",
"tag",
",",
"String",
"clazz",
",",
"String",
"style",
",",
"String",
"...",
"content",
")",
"{",
"return",
"openTag",
"(",
"tag",
",",
"clazz",
",",
"style",
",",
"false",
",",
"content",
")",
";... | Build a String containing a HTML opening tag with given CSS class and/or style and concatenates the given
content. Content should contain no HTML, because it is prepared with {@link #htmlEncode(String)}.
@param tag String name of HTML tag
@param clazz CSS class of the tag
@param style style for tag (plain CSS)
@param ... | [
"Build",
"a",
"String",
"containing",
"a",
"HTML",
"opening",
"tag",
"with",
"given",
"CSS",
"class",
"and",
"/",
"or",
"style",
"and",
"concatenates",
"the",
"given",
"content",
".",
"Content",
"should",
"contain",
"no",
"HTML",
"because",
"it",
"is",
"pr... | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java#L390-L392 | train | Create an HTML opening tag with the specified attributes. | Of course, here is the Java code you requested:
```java
public static String openTag(String tag, String clazz, String style, String... content) {
return openTag(tag, clazz, style, false, content);
}
```
Hope this helps! |
ruediste/jabsaw | impl/src/main/java/org/jabsaw/impl/GraphizPrinter.java | GraphizPrinter.print | public void print(ProjectModel project, File f, boolean includeClasses)
throws IOException {
FileWriter writer = new FileWriter(f);
print(project, writer, includeClasses);
writer.close();
} | java | public void print(ProjectModel project, File f, boolean includeClasses)
throws IOException {
FileWriter writer = new FileWriter(f);
print(project, writer, includeClasses);
writer.close();
} | [
"public",
"void",
"print",
"(",
"ProjectModel",
"project",
",",
"File",
"f",
",",
"boolean",
"includeClasses",
")",
"throws",
"IOException",
"{",
"FileWriter",
"writer",
"=",
"new",
"FileWriter",
"(",
"f",
")",
";",
"print",
"(",
"project",
",",
"writer",
... | Print the given {@link ProjectModel} as Graphviz .dot file to the given
file | [
"Print",
"the",
"given",
"{"
] | 8f1b5ead6d83f0ade8bd14db67ea430b36e15856 | https://github.com/ruediste/jabsaw/blob/8f1b5ead6d83f0ade8bd14db67ea430b36e15856/impl/src/main/java/org/jabsaw/impl/GraphizPrinter.java#L24-L29 | train | Print a CBE Project to a file. | Of course, here is the Java code you requested:
```java
public void print(ProjectModel project, File f, boolean includeClasses)
throws IOException {
FileWriter writer = new FileWriter(f);
print(project, writer, includeClasses);
writer.close();
}
```
Hope this helps! |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPOut.java | JBBPOut.BeginBin | public static JBBPOut BeginBin(final OutputStream out, final JBBPByteOrder byteOrder, final JBBPBitOrder bitOrder) {
return new JBBPOut(out, byteOrder, bitOrder);
} | java | public static JBBPOut BeginBin(final OutputStream out, final JBBPByteOrder byteOrder, final JBBPBitOrder bitOrder) {
return new JBBPOut(out, byteOrder, bitOrder);
} | [
"public",
"static",
"JBBPOut",
"BeginBin",
"(",
"final",
"OutputStream",
"out",
",",
"final",
"JBBPByteOrder",
"byteOrder",
",",
"final",
"JBBPBitOrder",
"bitOrder",
")",
"{",
"return",
"new",
"JBBPOut",
"(",
"out",
",",
"byteOrder",
",",
"bitOrder",
")",
";",... | Start a DSL session for a defined stream with defined parameters.
@param out the defined stream
@param byteOrder the byte outOrder for the session
@param bitOrder the bit outOrder for the session
@return the new DSL session generated for the stream with parameters | [
"Start",
"a",
"DSL",
"session",
"for",
"a",
"defined",
"stream",
"with",
"defined",
"parameters",
"."
] | 6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPOut.java#L119-L121 | train | Begin a binary stream. | Of course, here is the Java code you requested:
```java
public static JBBPOut BeginBin(final OutputStream out, final JBBPByteOrder byteOrder, final JBBPBitOrder bitOrder) {
return new JBBPOut(out, byteOrder, bitOrder);
}
```
Hope this helps! |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/EnumUtils.java | EnumUtils.getEnumList | public static <E extends Enum<E>> List<E> getEnumList(final Class<E> enumClass) {
return new ArrayList<>(Arrays.asList(enumClass.getEnumConstants()));
} | java | public static <E extends Enum<E>> List<E> getEnumList(final Class<E> enumClass) {
return new ArrayList<>(Arrays.asList(enumClass.getEnumConstants()));
} | [
"public",
"static",
"<",
"E",
"extends",
"Enum",
"<",
"E",
">",
">",
"List",
"<",
"E",
">",
"getEnumList",
"(",
"final",
"Class",
"<",
"E",
">",
"enumClass",
")",
"{",
"return",
"new",
"ArrayList",
"<>",
"(",
"Arrays",
".",
"asList",
"(",
"enumClass"... | <p>Gets the {@code List} of enums.</p>
<p>This method is useful when you need a list of enums rather than an array.</p>
@param <E> the type of the enumeration
@param enumClass the class of the enum to query, not null
@return the modifiable list of enums, never null | [
"<p",
">",
"Gets",
"the",
"{",
"@code",
"List",
"}",
"of",
"enums",
".",
"<",
"/",
"p",
">"
] | 9e2dfbbda3668cfa5d935fe76479d1426c294504 | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/EnumUtils.java#L76-L78 | train | Get the list of enum constants. | Of course, here is the Java code you requested:
```java
public static <E extends Enum<E>> List<E> getEnumList(final Class<E> enumClass) {
return new ArrayList<>(Arrays.asList(enumClass.getEnumConstants()));
}
```
Hope this helps! |
jglobus/JGlobus | gridftp/src/main/java/org/globus/ftp/ByteRange.java | ByteRange.merge | public int merge(final ByteRange other) {
/* notation:
t = this range
o = other range
- = the common subset of both
Thus there are 13 cases:
o t
ot
o-t
o-
o-o
-t
-
-o
t-t
t-
t-o
to
t o
*/
if (other.from < this.from) ... | java | public int merge(final ByteRange other) {
/* notation:
t = this range
o = other range
- = the common subset of both
Thus there are 13 cases:
o t
ot
o-t
o-
o-o
-t
-
-o
t-t
t-
t-o
to
t o
*/
if (other.from < this.from) ... | [
"public",
"int",
"merge",
"(",
"final",
"ByteRange",
"other",
")",
"{",
"/* notation:\n\t t = this range\n\t o = other range\n\t - = the common subset of both\n\t Thus there are 13 cases:\n\t o t\n\t ot\n\t o-t\n\t o-\n\t o-o\n\t -t\n\t -\n\t -o\n\t ... | If this range can be consolidated with the other one,
modify this range so that it represents the result of merging
this and the other range.
The parameter object remains intact.
Return value indicates what operation has been performed.
<ul>
<li> If the two ranges were separate, then this range will remain unchanged.
T... | [
"If",
"this",
"range",
"can",
"be",
"consolidated",
"with",
"the",
"other",
"one",
"modify",
"this",
"range",
"so",
"that",
"it",
"represents",
"the",
"result",
"of",
"merging",
"this",
"and",
"the",
"other",
"range",
".",
"The",
"parameter",
"object",
"re... | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gridftp/src/main/java/org/globus/ftp/ByteRange.java#L105-L168 | train | Merge two ByteRanges. | Of course, here is the Java code you requested:
```java
public int merge(final ByteRange other) {
/* notation:
t = this range
o = other range
- = the common subset of both
Thus there are 13 cases:
o t
ot
o-t
o-
o-o
-t
-
-o
t-t
t-
... |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/XPathParser.java | XPathParser.getFunctionToken | final int getFunctionToken(String key)
{
int tok;
Object id;
try
{
// These are nodetests, xpathparser treats them as functions when parsing
// a FilterExpr.
id = Keywords.lookupNodeTest(key);
if (null == id) id = m_functionTable.getFunctionID(key);
tok = ((Intege... | java | final int getFunctionToken(String key)
{
int tok;
Object id;
try
{
// These are nodetests, xpathparser treats them as functions when parsing
// a FilterExpr.
id = Keywords.lookupNodeTest(key);
if (null == id) id = m_functionTable.getFunctionID(key);
tok = ((Intege... | [
"final",
"int",
"getFunctionToken",
"(",
"String",
"key",
")",
"{",
"int",
"tok",
";",
"Object",
"id",
";",
"try",
"{",
"// These are nodetests, xpathparser treats them as functions when parsing",
"// a FilterExpr. ",
"id",
"=",
"Keywords",
".",
"lookupNodeTest",
"(",
... | Given a string, return the corresponding function token.
@param key A local name of a function.
@return The function ID, which may correspond to one of the FUNC_XXX
values found in {@link org.apache.xpath.compiler.FunctionTable}, but may
be a value installed by an external module. | [
"Given",
"a",
"string",
"return",
"the",
"corresponding",
"function",
"token",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/XPathParser.java#L710-L735 | train | Get the function token. | Of course, here is the Java code you requested:
```java
final int getFunctionToken(String key)
{
int tok;
Object id;
try
{
// These are nodetests, xpathparser treats them as functions when parsing
// a FilterExpr.
id = Keywords.lookupNodeTest(key);
if (null == id) id =... |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/dataset/DatasetUtils.java | DatasetUtils.instantiateDatasetFinder | @SuppressWarnings("unchecked")
public static <T extends org.apache.gobblin.dataset.Dataset> DatasetsFinder<T> instantiateDatasetFinder(Properties props,
FileSystem fs, String default_class, Object... additionalArgs)
throws IOException {
String className = default_class;
if (props.containsKey(DATAS... | java | @SuppressWarnings("unchecked")
public static <T extends org.apache.gobblin.dataset.Dataset> DatasetsFinder<T> instantiateDatasetFinder(Properties props,
FileSystem fs, String default_class, Object... additionalArgs)
throws IOException {
String className = default_class;
if (props.containsKey(DATAS... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
"extends",
"org",
".",
"apache",
".",
"gobblin",
".",
"dataset",
".",
"Dataset",
">",
"DatasetsFinder",
"<",
"T",
">",
"instantiateDatasetFinder",
"(",
"Properties",
"props",
","... | Instantiate a {@link DatasetsFinder}. The class of the {@link DatasetsFinder} is read from property
{@link #DATASET_PROFILE_CLASS_KEY}.
@param props Properties used for building {@link DatasetsFinder}.
@param fs {@link FileSystem} where datasets are located.
@return A new instance of {@link DatasetsFinder}.
@throws IO... | [
"Instantiate",
"a",
"{",
"@link",
"DatasetsFinder",
"}",
".",
"The",
"class",
"of",
"the",
"{",
"@link",
"DatasetsFinder",
"}",
"is",
"read",
"from",
"property",
"{",
"@link",
"#DATASET_PROFILE_CLASS_KEY",
"}",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/dataset/DatasetUtils.java#L75-L93 | train | Instantiates a DatasetsFinder object from the given properties. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public static <T extends org.apache.gobblin.dataset.Dataset> DatasetsFinder<T> instantiateDatasetFinder(Properties props,
FileSystem fs, String default_class, Object... additionalArgs)
throws IOException {
String c... |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/UnitQuaternions.java | UnitQuaternions.orientationMetric | public static double orientationMetric(Point3d[] a, Point3d[] b) {
Quat4d qa = orientation(a);
Quat4d qb = orientation(b);
return orientationMetric(qa, qb);
} | java | public static double orientationMetric(Point3d[] a, Point3d[] b) {
Quat4d qa = orientation(a);
Quat4d qb = orientation(b);
return orientationMetric(qa, qb);
} | [
"public",
"static",
"double",
"orientationMetric",
"(",
"Point3d",
"[",
"]",
"a",
",",
"Point3d",
"[",
"]",
"b",
")",
"{",
"Quat4d",
"qa",
"=",
"orientation",
"(",
"a",
")",
";",
"Quat4d",
"qb",
"=",
"orientation",
"(",
"b",
")",
";",
"return",
"orie... | The orientation metric is obtained by comparing the quaternion
orientations of the principal axes of each set of points in 3D.
<p>
First, the quaternion orientation of each set of points is calculated
using their principal axes with {@link #orientation(Point3d[])}. Then,
the two quaternions are compared using the metho... | [
"The",
"orientation",
"metric",
"is",
"obtained",
"by",
"comparing",
"the",
"quaternion",
"orientations",
"of",
"the",
"principal",
"axes",
"of",
"each",
"set",
"of",
"points",
"in",
"3D",
".",
"<p",
">",
"First",
"the",
"quaternion",
"orientation",
"of",
"e... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/UnitQuaternions.java#L72-L78 | train | Compute the orientation metric of two 3D points. | Of course, here is the Java code you requested:
```java
public static double orientationMetric(Point3d[] a, Point3d[] b) {
Quat4d qa = orientation(a);
Quat4d qb = orientation(b);
return orientationMetric(qa, qb);
}
```
Hope this helps! |
elki-project/elki | elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/query/knn/LinearScanDistanceKNNQuery.java | LinearScanDistanceKNNQuery.linearScanBatchKNN | private void linearScanBatchKNN(ArrayDBIDs ids, List<KNNHeap> heaps) {
final DistanceQuery<O> dq = distanceQuery;
// The distance is computed on database IDs
for(DBIDIter iter = getRelation().getDBIDs().iter(); iter.valid(); iter.advance()) {
int index = 0;
for(DBIDIter iter2 = ids.iter(); iter2... | java | private void linearScanBatchKNN(ArrayDBIDs ids, List<KNNHeap> heaps) {
final DistanceQuery<O> dq = distanceQuery;
// The distance is computed on database IDs
for(DBIDIter iter = getRelation().getDBIDs().iter(); iter.valid(); iter.advance()) {
int index = 0;
for(DBIDIter iter2 = ids.iter(); iter2... | [
"private",
"void",
"linearScanBatchKNN",
"(",
"ArrayDBIDs",
"ids",
",",
"List",
"<",
"KNNHeap",
">",
"heaps",
")",
"{",
"final",
"DistanceQuery",
"<",
"O",
">",
"dq",
"=",
"distanceQuery",
";",
"// The distance is computed on database IDs",
"for",
"(",
"DBIDIter",... | Linear batch knn for arbitrary distance functions.
@param ids DBIDs to process
@param heaps Heaps to store the results in | [
"Linear",
"batch",
"knn",
"for",
"arbitrary",
"distance",
"functions",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/query/knn/LinearScanDistanceKNNQuery.java#L103-L113 | train | Linear scan batch knn. | Of course, here is the Java code you requested:
```java
private void linearScanBatchKNN(ArrayDBIDs ids, List<KNNHeap> heaps) {
final DistanceQuery<O> dq = distanceQuery;
// The distance is computed on database IDs
for(DBIDIter iter = getRelation().getDBIDs().iter(); iter.valid(); iter.advance()) {
in... |
scalecube/scalecube-services | services-gateway-websocket/src/main/java/io/scalecube/services/gateway/ws/WebsocketSession.java | WebsocketSession.send | public Mono<Void> send(GatewayMessage response) {
return Mono.defer(
() ->
outbound
.sendObject(Mono.just(response).map(codec::encode).map(TextWebSocketFrame::new))
.then()
.doOnSuccessOrError((avoid, th) -> logSend(response, th)));
} | java | public Mono<Void> send(GatewayMessage response) {
return Mono.defer(
() ->
outbound
.sendObject(Mono.just(response).map(codec::encode).map(TextWebSocketFrame::new))
.then()
.doOnSuccessOrError((avoid, th) -> logSend(response, th)));
} | [
"public",
"Mono",
"<",
"Void",
">",
"send",
"(",
"GatewayMessage",
"response",
")",
"{",
"return",
"Mono",
".",
"defer",
"(",
"(",
")",
"->",
"outbound",
".",
"sendObject",
"(",
"Mono",
".",
"just",
"(",
"response",
")",
".",
"map",
"(",
"codec",
"::... | Method to send normal response.
@param response response
@return mono void | [
"Method",
"to",
"send",
"normal",
"response",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-gateway-websocket/src/main/java/io/scalecube/services/gateway/ws/WebsocketSession.java#L82-L89 | train | Sends a response to the server. | Of course, here is the Java code you requested:
```java
public Mono<Void> send(GatewayMessage response) {
return Mono.defer(
() ->
outbound
.sendObject(Mono.just(response).map(codec::encode).map(TextWebSocketFrame::new))
.then()
.doOnSuccessOrErro... |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsSessionImpl.java | JmsSessionImpl.validateStopCloseForMessageListener | void validateStopCloseForMessageListener(String functionCall) throws IllegalStateException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "validateStopForMessageListener");
//Before triggering onMessage .. SIB pushes "owning session object" to Threa... | java | void validateStopCloseForMessageListener(String functionCall) throws IllegalStateException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "validateStopForMessageListener");
//Before triggering onMessage .. SIB pushes "owning session object" to Threa... | [
"void",
"validateStopCloseForMessageListener",
"(",
"String",
"functionCall",
")",
"throws",
"IllegalStateException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"... | A message listener must not attempt to stop its own connection or context as this would lead to deadlock.
IllegalStateException has to be thrown in case if it calls stop.
THIS FUNCTION is called only in non-managed environments. | [
"A",
"message",
"listener",
"must",
"not",
"attempt",
"to",
"stop",
"its",
"own",
"connection",
"or",
"context",
"as",
"this",
"would",
"lead",
"to",
"deadlock",
".",
"IllegalStateException",
"has",
"to",
"be",
"thrown",
"in",
"case",
"if",
"it",
"calls",
... | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsSessionImpl.java#L2808-L2844 | train | Validate stop close for message listener. | Of course, here is the Java code you requested:
```java
void validateStopCloseForMessageListener(String functionCall) throws IllegalStateException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "validateStopForMessageListener");
//Before triggering... |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.deposit_depositId_GET | public OvhDeposit deposit_depositId_GET(String depositId) throws IOException {
String qPath = "/me/deposit/{depositId}";
StringBuilder sb = path(qPath, depositId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhDeposit.class);
} | java | public OvhDeposit deposit_depositId_GET(String depositId) throws IOException {
String qPath = "/me/deposit/{depositId}";
StringBuilder sb = path(qPath, depositId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhDeposit.class);
} | [
"public",
"OvhDeposit",
"deposit_depositId_GET",
"(",
"String",
"depositId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/deposit/{depositId}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"depositId",
")",
";",
"String",
"res... | Get this object properties
REST: GET /me/deposit/{depositId}
@param depositId [required] | [
"Get",
"this",
"object",
"properties"
] | 6d531a40e56e09701943e334c25f90f640c55701 | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L3291-L3296 | train | Get details of a deposit | Of course, here is the Java code you requested:
```java
public OvhDeposit deposit_depositId_GET(String depositId) throws IOException {
String qPath = "/me/deposit/{depositId}";
StringBuilder sb = path(qPath, depositId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhDeposit.cl... |
RestComm/jss7 | isup/isup-impl/src/main/java/org/restcomm/protocols/ss7/isup/impl/message/ISUPMessageFactoryImpl.java | ISUPMessageFactoryImpl.createSUS | @Override
public SuspendMessage createSUS() {
SuspendMessage msg = new SuspendMessageImpl(_SUS_HOLDER.mandatoryCodes, _SUS_HOLDER.mandatoryVariableCodes,
_SUS_HOLDER.optionalCodes, _SUS_HOLDER.mandatoryCodeToIndex, _SUS_HOLDER.mandatoryVariableCodeToIndex,
_SUS_HOLDER.optiona... | java | @Override
public SuspendMessage createSUS() {
SuspendMessage msg = new SuspendMessageImpl(_SUS_HOLDER.mandatoryCodes, _SUS_HOLDER.mandatoryVariableCodes,
_SUS_HOLDER.optionalCodes, _SUS_HOLDER.mandatoryCodeToIndex, _SUS_HOLDER.mandatoryVariableCodeToIndex,
_SUS_HOLDER.optiona... | [
"@",
"Override",
"public",
"SuspendMessage",
"createSUS",
"(",
")",
"{",
"SuspendMessage",
"msg",
"=",
"new",
"SuspendMessageImpl",
"(",
"_SUS_HOLDER",
".",
"mandatoryCodes",
",",
"_SUS_HOLDER",
".",
"mandatoryVariableCodes",
",",
"_SUS_HOLDER",
".",
"optionalCodes",
... | /*
(non-Javadoc)
@see org.restcomm.protocols.ss7.isup.ISUPMessageFactory#createSUS() | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/isup/isup-impl/src/main/java/org/restcomm/protocols/ss7/isup/impl/message/ISUPMessageFactoryImpl.java#L3279-L3286 | train | Create a SuspendMessage in the context of this SuspendMessage. | Of course, here is the Java code you requested:
```java
@Override
public SuspendMessage createSUS() {
SuspendMessage msg = new SuspendMessageImpl(_SUS_HOLDER.mandatoryCodes, _SUS_HOLDER.mandatoryVariableCodes,
_SUS_HOLDER.optionalCodes, _SUS_HOLDER.mandatoryCodeToIndex, _SUS_HOLDER.mandator... |
soarcn/COCOQuery | query/src/main/java/com/cocosw/query/AbstractViewQuery.java | AbstractViewQuery.image | public T image(Bitmap bm) {
if (view instanceof ImageView) {
ImageView iv = (ImageView) view;
iv.setImageBitmap(bm);
}
return self();
} | java | public T image(Bitmap bm) {
if (view instanceof ImageView) {
ImageView iv = (ImageView) view;
iv.setImageBitmap(bm);
}
return self();
} | [
"public",
"T",
"image",
"(",
"Bitmap",
"bm",
")",
"{",
"if",
"(",
"view",
"instanceof",
"ImageView",
")",
"{",
"ImageView",
"iv",
"=",
"(",
"ImageView",
")",
"view",
";",
"iv",
".",
"setImageBitmap",
"(",
"bm",
")",
";",
"}",
"return",
"self",
"(",
... | Set the image of an ImageView.
@param bm Bitmap
@return self | [
"Set",
"the",
"image",
"of",
"an",
"ImageView",
"."
] | 712eac37ab65ef3dbdf55dbfae28750edfc36608 | https://github.com/soarcn/COCOQuery/blob/712eac37ab65ef3dbdf55dbfae28750edfc36608/query/src/main/java/com/cocosw/query/AbstractViewQuery.java#L334-L342 | train | Sets the image bitmap. | Of course, here is the Java code you requested:
```java
public T image(Bitmap bm) {
if (view instanceof ImageView) {
ImageView iv = (ImageView) view;
iv.setImageBitmap(bm);
}
return self();
}
```
Hope this helps! |
pwittchen/ReactiveNetwork | library/src/main/java/com/github/pwittchen/reactivenetwork/library/rx2/ConnectivityPredicate.java | ConnectivityPredicate.hasType | public static Predicate<Connectivity> hasType(final int... types) {
final int[] extendedTypes = appendUnknownNetworkTypeToTypes(types);
return new Predicate<Connectivity>() {
@Override public boolean test(@NonNull Connectivity connectivity) throws Exception {
for (int type : extendedTypes) {
... | java | public static Predicate<Connectivity> hasType(final int... types) {
final int[] extendedTypes = appendUnknownNetworkTypeToTypes(types);
return new Predicate<Connectivity>() {
@Override public boolean test(@NonNull Connectivity connectivity) throws Exception {
for (int type : extendedTypes) {
... | [
"public",
"static",
"Predicate",
"<",
"Connectivity",
">",
"hasType",
"(",
"final",
"int",
"...",
"types",
")",
"{",
"final",
"int",
"[",
"]",
"extendedTypes",
"=",
"appendUnknownNetworkTypeToTypes",
"(",
"types",
")",
";",
"return",
"new",
"Predicate",
"<",
... | Filter, which returns true if at least one given type occurred
@param types int, which can have one or more types
@return true if at least one given type occurred | [
"Filter",
"which",
"returns",
"true",
"if",
"at",
"least",
"one",
"given",
"type",
"occurred"
] | cfeb3b79a1e44d106581af5e6709ff206e60c369 | https://github.com/pwittchen/ReactiveNetwork/blob/cfeb3b79a1e44d106581af5e6709ff206e60c369/library/src/main/java/com/github/pwittchen/reactivenetwork/library/rx2/ConnectivityPredicate.java#L57-L69 | train | Create a predicate that returns true if connectivity has one of the given network types. | Of course, here is the Java code you requested:
```java
public static Predicate<Connectivity> hasType(final int... types) {
final int[] extendedTypes = appendUnknownNetworkTypeToTypes(types);
return new Predicate<Connectivity>() {
@Override public boolean test(@NonNull Connectivity connectivity) throws E... |
eFaps/eFaps-Kernel | src/main/java/org/efaps/db/AbstractPrintQuery.java | AbstractPrintQuery.getTableIndex | public Integer getTableIndex(final String _tableName,
final String _column,
final int _relIndex,
final Long _clazzId)
{
return this.sqlTable2Index.get(_relIndex + "__" + _tableName + "__" + _column
... | java | public Integer getTableIndex(final String _tableName,
final String _column,
final int _relIndex,
final Long _clazzId)
{
return this.sqlTable2Index.get(_relIndex + "__" + _tableName + "__" + _column
... | [
"public",
"Integer",
"getTableIndex",
"(",
"final",
"String",
"_tableName",
",",
"final",
"String",
"_column",
",",
"final",
"int",
"_relIndex",
",",
"final",
"Long",
"_clazzId",
")",
"{",
"return",
"this",
".",
"sqlTable2Index",
".",
"get",
"(",
"_relIndex",
... | Method to get an table index from {@link #sqlTable2Index}.
@param _tableName tablename the index is wanted for
@param _column name of the column, used for the relation
@param _relIndex relation the table is used in
@param _clazzId optional id of the classification
@return index of the table or null if not found | [
"Method",
"to",
"get",
"an",
"table",
"index",
"from",
"{",
"@link",
"#sqlTable2Index",
"}",
"."
] | 04b96548f518c2386a93f5ec2b9349f9b9063859 | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/db/AbstractPrintQuery.java#L1008-L1015 | train | Gets the table index. | Of course, here is the Java code you requested:
```java
public Integer getTableIndex(final String _tableName,
final String _column,
final int _relIndex,
final Long _clazzId)
{
return this.sqlTable2Index.get(_... |
biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/symmetry/jmolScript/JmolSymmetryScriptGeneratorH.java | JmolSymmetryScriptGeneratorH.drawAxes | @Override
public String drawAxes() {
StringBuilder s = new StringBuilder();
// Point3d centroid = helixAxisAligner.getCentroid();
// System.out.println("Centroid: " + helixAxisAligner.getCentroid());
// Point3d centroid = helixAxisAligner.getGeometricCenter();
Point3d centroid = helixAxisAligner.calcCenterOfRot... | java | @Override
public String drawAxes() {
StringBuilder s = new StringBuilder();
// Point3d centroid = helixAxisAligner.getCentroid();
// System.out.println("Centroid: " + helixAxisAligner.getCentroid());
// Point3d centroid = helixAxisAligner.getGeometricCenter();
Point3d centroid = helixAxisAligner.calcCenterOfRot... | [
"@",
"Override",
"public",
"String",
"drawAxes",
"(",
")",
"{",
"StringBuilder",
"s",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"//\t\tPoint3d centroid = helixAxisAligner.getCentroid();",
"//\t\tSystem.out.println(\"Centroid: \" + helixAxisAligner.getCentroid());",
"//\t\tPoint... | Returns a Jmol script that draws symmetry or inertia axes for a structure.
Use showAxes() and hideAxes() to toggle visibility.
@return Jmol script | [
"Returns",
"a",
"Jmol",
"script",
"that",
"draws",
"symmetry",
"or",
"inertia",
"axes",
"for",
"a",
"structure",
".",
"Use",
"showAxes",
"()",
"and",
"hideAxes",
"()",
"to",
"toggle",
"visibility",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/symmetry/jmolScript/JmolSymmetryScriptGeneratorH.java#L313-L341 | train | Draw the axes of the helix. | Of course, here is the Java code you requested:
```java
@Override
public String drawAxes() {
StringBuilder s = new StringBuilder();
// Point3d centroid = helixAxisAligner.getCentroid();
// System.out.println("Centroid: " + helixAxisAligner.getCentroid());
// Point3d centroid = helixAxisAligner.getGeometricCenter... |
aws/aws-sdk-java | aws-java-sdk-datapipeline/src/main/java/com/amazonaws/services/datapipeline/model/DescribePipelinesRequest.java | DescribePipelinesRequest.getPipelineIds | public java.util.List<String> getPipelineIds() {
if (pipelineIds == null) {
pipelineIds = new com.amazonaws.internal.SdkInternalList<String>();
}
return pipelineIds;
} | java | public java.util.List<String> getPipelineIds() {
if (pipelineIds == null) {
pipelineIds = new com.amazonaws.internal.SdkInternalList<String>();
}
return pipelineIds;
} | [
"public",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
"getPipelineIds",
"(",
")",
"{",
"if",
"(",
"pipelineIds",
"==",
"null",
")",
"{",
"pipelineIds",
"=",
"new",
"com",
".",
"amazonaws",
".",
"internal",
".",
"SdkInternalList",
"<",
"String",... | <p>
The IDs of the pipelines to describe. You can pass as many as 25 identifiers in a single call. To obtain pipeline
IDs, call <a>ListPipelines</a>.
</p>
@return The IDs of the pipelines to describe. You can pass as many as 25 identifiers in a single call. To obtain
pipeline IDs, call <a>ListPipelines</a>. | [
"<p",
">",
"The",
"IDs",
"of",
"the",
"pipelines",
"to",
"describe",
".",
"You",
"can",
"pass",
"as",
"many",
"as",
"25",
"identifiers",
"in",
"a",
"single",
"call",
".",
"To",
"obtain",
"pipeline",
"IDs",
"call",
"<a",
">",
"ListPipelines<",
"/",
"a",... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-datapipeline/src/main/java/com/amazonaws/services/datapipeline/model/DescribePipelinesRequest.java#L49-L54 | train | Gets the value of the pipelineIds property. | Of course, here is the Java code you requested:
```java
public java.util.List<String> getPipelineIds() {
if (pipelineIds == null) {
pipelineIds = new com.amazonaws.internal.SdkInternalList<String>();
}
return pipelineIds;
}
```
Hope this helps! |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/subnet/SubnetClient.java | SubnetClient.listSubnets | public ListSubnetsResponse listSubnets(ListSubnetsRequest request) {
checkNotNull(request, "request should not be null.");
InternalRequest internalRequest = this.createRequest(request, HttpMethodName.GET, SUBNET_PREFIX);
if (request.getMarker() != null) {
internalRequest.addParameter... | java | public ListSubnetsResponse listSubnets(ListSubnetsRequest request) {
checkNotNull(request, "request should not be null.");
InternalRequest internalRequest = this.createRequest(request, HttpMethodName.GET, SUBNET_PREFIX);
if (request.getMarker() != null) {
internalRequest.addParameter... | [
"public",
"ListSubnetsResponse",
"listSubnets",
"(",
"ListSubnetsRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"request should not be null.\"",
")",
";",
"InternalRequest",
"internalRequest",
"=",
"this",
".",
"createRequest",
"(",
"request",
","... | Return a list of subnet owned by the authenticated user.
@param request The request containing all options for listing own's subnet.
@return The response containing a list of subnets owned by the authenticated user. | [
"Return",
"a",
"list",
"of",
"subnet",
"owned",
"by",
"the",
"authenticated",
"user",
"."
] | f7140f28dd82121515c88ded7bfe769a37d0ec4a | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/subnet/SubnetClient.java#L212-L222 | train | List all the subnets owned by the authenticated user. | Of course, here is the Java code you requested:
```java
public ListSubnetsResponse listSubnets(ListSubnetsRequest request) {
checkNotNull(request, "request should not be null.");
InternalRequest internalRequest = this.createRequest(request, HttpMethodName.GET, SUBNET_PREFIX);
if (request.getMar... |
MTDdk/jawn | jawn-core/src/main/java/net/javapla/jawn/core/ResultBuilder.java | ResultBuilder.json | public final Result json(Object obj) {
final Result response = ok().contentType(MediaType.APPLICATION_JSON).renderable(obj);
holder.setControllerResult(response);
return response;
} | java | public final Result json(Object obj) {
final Result response = ok().contentType(MediaType.APPLICATION_JSON).renderable(obj);
holder.setControllerResult(response);
return response;
} | [
"public",
"final",
"Result",
"json",
"(",
"Object",
"obj",
")",
"{",
"final",
"Result",
"response",
"=",
"ok",
"(",
")",
".",
"contentType",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
".",
"renderable",
"(",
"obj",
")",
";",
"holder",
".",
"setContr... | This method will send a JSON response to the client.
It will not use any layouts.
Use it to build app.services and to support AJAX.
@param obj
@return {@link Result}, to accept additional information. The response is automatically
has its content type set to "application/json" | [
"This",
"method",
"will",
"send",
"a",
"JSON",
"response",
"to",
"the",
"client",
".",
"It",
"will",
"not",
"use",
"any",
"layouts",
".",
"Use",
"it",
"to",
"build",
"app",
".",
"services",
"and",
"to",
"support",
"AJAX",
"."
] | 4ec2d09b97d413efdead7487e6075e5bfd13b925 | https://github.com/MTDdk/jawn/blob/4ec2d09b97d413efdead7487e6075e5bfd13b925/jawn-core/src/main/java/net/javapla/jawn/core/ResultBuilder.java#L105-L109 | train | A JSON response. | Of course, here is the Java code you requested:
```java
public final Result json(Object obj) {
final Result response = ok().contentType(MediaType.APPLICATION_JSON).renderable(obj);
holder.setControllerResult(response);
return response;
}
```
Hope this helps! |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java | ParameterTool.getShort | public short getShort(String key) {
addToDefaults(key, null);
String value = getRequired(key);
return Short.valueOf(value);
} | java | public short getShort(String key) {
addToDefaults(key, null);
String value = getRequired(key);
return Short.valueOf(value);
} | [
"public",
"short",
"getShort",
"(",
"String",
"key",
")",
"{",
"addToDefaults",
"(",
"key",
",",
"null",
")",
";",
"String",
"value",
"=",
"getRequired",
"(",
"key",
")",
";",
"return",
"Short",
".",
"valueOf",
"(",
"value",
")",
";",
"}"
] | Returns the Short value for the given key.
The method fails if the key does not exist. | [
"Returns",
"the",
"Short",
"value",
"for",
"the",
"given",
"key",
".",
"The",
"method",
"fails",
"if",
"the",
"key",
"does",
"not",
"exist",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L413-L417 | train | Returns the Short value for the given key. If the key does not exist it will be created and returned. | Of course, here is the Java code you requested:
```java
public short getShort(String key) {
addToDefaults(key, null);
String value = getRequired(key);
return Short.valueOf(value);
}
```
Hope this helps! |
Samsung/GearVRf | GVRf/Extensions/3DCursor/3DCursorLibrary/src/main/java/org/gearvrf/io/cursor3d/Cursor.java | Cursor.checkAndSetAsset | void checkAndSetAsset(Action action) {
// check the theme if we have a asset
CursorAsset asset = mCursorTheme.getAsset(action);
if (asset == null) {
return;
}
// do not set if the app is busy loading
if (mCursorAsset == null || !mCursorAsset.getAction().equa... | java | void checkAndSetAsset(Action action) {
// check the theme if we have a asset
CursorAsset asset = mCursorTheme.getAsset(action);
if (asset == null) {
return;
}
// do not set if the app is busy loading
if (mCursorAsset == null || !mCursorAsset.getAction().equa... | [
"void",
"checkAndSetAsset",
"(",
"Action",
"action",
")",
"{",
"// check the theme if we have a asset",
"CursorAsset",
"asset",
"=",
"mCursorTheme",
".",
"getAsset",
"(",
"action",
")",
";",
"if",
"(",
"asset",
"==",
"null",
")",
"{",
"return",
";",
"}",
"// d... | /* Set the asset only if it is not already set,
return true if the asset has been changed, else return false. | [
"/",
"*",
"Set",
"the",
"asset",
"only",
"if",
"it",
"is",
"not",
"already",
"set",
"return",
"true",
"if",
"the",
"asset",
"has",
"been",
"changed",
"else",
"return",
"false",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/3DCursor/3DCursorLibrary/src/main/java/org/gearvrf/io/cursor3d/Cursor.java#L371-L388 | train | Check if the cursor has an asset for the given action and set it if it is. | Of course, here is the Java code you requested:
```java
void checkAndSetAsset(Action action) {
// check the theme if we have a asset
CursorAsset asset = mCursorTheme.getAsset(action);
if (asset == null) {
return;
}
// do not set if the app is busy loading
i... |
overturetool/overture | core/interpreter/src/main/java/org/overture/interpreter/assistant/statement/PStmAssistantInterpreter.java | PStmAssistantInterpreter.findStatement | public PStm findStatement(PStm stm, int lineno)
{
try
{
return stm.apply(af.getStatementFinder(), lineno);// FIXME: should we handle exceptions like this
} catch (AnalysisException e)
{
return null; // Most have none
}
} | java | public PStm findStatement(PStm stm, int lineno)
{
try
{
return stm.apply(af.getStatementFinder(), lineno);// FIXME: should we handle exceptions like this
} catch (AnalysisException e)
{
return null; // Most have none
}
} | [
"public",
"PStm",
"findStatement",
"(",
"PStm",
"stm",
",",
"int",
"lineno",
")",
"{",
"try",
"{",
"return",
"stm",
".",
"apply",
"(",
"af",
".",
"getStatementFinder",
"(",
")",
",",
"lineno",
")",
";",
"// FIXME: should we handle exceptions like this",
"}",
... | Find a statement starting on the given line. Single statements just compare their location to lineno, but block
statements and statements with sub-statements iterate over their branches.
@param stm
the statement
@param lineno
The line number to locate.
@return A statement starting on the line, or null. | [
"Find",
"a",
"statement",
"starting",
"on",
"the",
"given",
"line",
".",
"Single",
"statements",
"just",
"compare",
"their",
"location",
"to",
"lineno",
"but",
"block",
"statements",
"and",
"statements",
"with",
"sub",
"-",
"statements",
"iterate",
"over",
"th... | 83175dc6c24fa171cde4fcf61ecb648eba3bdbc1 | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/interpreter/src/main/java/org/overture/interpreter/assistant/statement/PStmAssistantInterpreter.java#L41-L51 | train | Find a statement in the source file. | Of course, here is the Java code you requested:
```java
public PStm findStatement(PStm stm, int lineno)
{
try
{
return stm.apply(af.getStatementFinder(), lineno);// FIXME: should we handle exceptions like this
} catch (AnalysisException e)
{
return null; // Most have none
}
}
```
Hope this helps! |
lunisolar/magma | magma-func-builder/src/main/java/eu/lunisolar/magma/func/build/std/ToIntFunctionBuilder.java | ToIntFunctionBuilder.toIntFunction | @Nonnull
public static <T> ToIntFunctionBuilder<T> toIntFunction(Consumer<ToIntFunction<T>> consumer) {
return new ToIntFunctionBuilder(consumer);
} | java | @Nonnull
public static <T> ToIntFunctionBuilder<T> toIntFunction(Consumer<ToIntFunction<T>> consumer) {
return new ToIntFunctionBuilder(consumer);
} | [
"@",
"Nonnull",
"public",
"static",
"<",
"T",
">",
"ToIntFunctionBuilder",
"<",
"T",
">",
"toIntFunction",
"(",
"Consumer",
"<",
"ToIntFunction",
"<",
"T",
">",
">",
"consumer",
")",
"{",
"return",
"new",
"ToIntFunctionBuilder",
"(",
"consumer",
")",
";",
... | One of ways of creating builder. This might be the only way (considering all _functional_ builders) that might be utilize to specify generic params only once. | [
"One",
"of",
"ways",
"of",
"creating",
"builder",
".",
"This",
"might",
"be",
"the",
"only",
"way",
"(",
"considering",
"all",
"_functional_",
"builders",
")",
"that",
"might",
"be",
"utilize",
"to",
"specify",
"generic",
"params",
"only",
"once",
"."
] | 83809c6d1a33d913aec6c49920251e4f0be8b213 | https://github.com/lunisolar/magma/blob/83809c6d1a33d913aec6c49920251e4f0be8b213/magma-func-builder/src/main/java/eu/lunisolar/magma/func/build/std/ToIntFunctionBuilder.java#L90-L93 | train | Create a ToIntFunctionBuilder from an consumer. | Of course, here is the Java code you requested:
```java
@Nonnull
public static <T> ToIntFunctionBuilder<T> toIntFunction(Consumer<ToIntFunction<T>> consumer) {
return new ToIntFunctionBuilder(consumer);
}
```
Hope this helps! |
baratine/baratine | framework/src/main/java/com/caucho/v5/bartender/heartbeat/JoinClient.java | JoinClient.startServer | private void startServer(ServerHeartbeat server,
ClusterHeartbeat cluster,
Consumer<UpdateRackHeartbeat> consumer,
JoinFuture future)
{
String address = server.getAddress();
int port = server.port();
if (port <= 0) {
t... | java | private void startServer(ServerHeartbeat server,
ClusterHeartbeat cluster,
Consumer<UpdateRackHeartbeat> consumer,
JoinFuture future)
{
String address = server.getAddress();
int port = server.port();
if (port <= 0) {
t... | [
"private",
"void",
"startServer",
"(",
"ServerHeartbeat",
"server",
",",
"ClusterHeartbeat",
"cluster",
",",
"Consumer",
"<",
"UpdateRackHeartbeat",
">",
"consumer",
",",
"JoinFuture",
"future",
")",
"{",
"String",
"address",
"=",
"server",
".",
"getAddress",
"(",... | /*
private boolean isSeedServer(ServerBartender server)
{
return (! "".equals(server.getAddress()) && server.getPort() > 0);
} | [
"/",
"*",
"private",
"boolean",
"isSeedServer",
"(",
"ServerBartender",
"server",
")",
"{",
"return",
"(",
"!",
".",
"equals",
"(",
"server",
".",
"getAddress",
"()",
")",
"&&",
"server",
".",
"getPort",
"()",
">",
"0",
")",
";",
"}"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/heartbeat/JoinClient.java#L179-L224 | train | Start a server. | Of course, here is the Java code you requested:
```java
private void startServer(ServerHeartbeat server,
ClusterHeartbeat cluster,
Consumer<UpdateRackHeartbeat> consumer,
JoinFuture future)
{
String address = server.getAddress();
... |
apache/flink | flink-connectors/flink-orc/src/main/java/org/apache/flink/orc/OrcBatchReader.java | OrcBatchReader.readField | private static void readField(Object[] vals, int fieldIdx, TypeDescription schema, ColumnVector vector, int childCount) {
// check the type of the vector to decide how to read it.
switch (schema.getCategory()) {
case BOOLEAN:
if (vector.noNulls) {
readNonNullLongColumn(vals, fieldIdx, (LongColumnVector... | java | private static void readField(Object[] vals, int fieldIdx, TypeDescription schema, ColumnVector vector, int childCount) {
// check the type of the vector to decide how to read it.
switch (schema.getCategory()) {
case BOOLEAN:
if (vector.noNulls) {
readNonNullLongColumn(vals, fieldIdx, (LongColumnVector... | [
"private",
"static",
"void",
"readField",
"(",
"Object",
"[",
"]",
"vals",
",",
"int",
"fieldIdx",
",",
"TypeDescription",
"schema",
",",
"ColumnVector",
"vector",
",",
"int",
"childCount",
")",
"{",
"// check the type of the vector to decide how to read it.",
"switch... | Reads a vector of data into an array of objects.
@param vals The array that needs to be filled.
@param fieldIdx If the vals array is an array of Row, the index of the field that needs to be filled.
Otherwise a -1 must be passed and the data is directly filled into the array.
@param schema The schema of the vector to r... | [
"Reads",
"a",
"vector",
"of",
"data",
"into",
"an",
"array",
"of",
"objects",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-orc/src/main/java/org/apache/flink/orc/OrcBatchReader.java#L158-L274 | train | Read a field from the given vector. | Of course, here is the Java code you requested:
```java
private static void readField(Object[] vals, int fieldIdx, TypeDescription schema, ColumnVector vector, int childCount) {
// check the type of the vector to decide how to read it.
switch (schema.getCategory()) {
case BOOLEAN:
if (vector.noNulls) {
... |
wildfly/wildfly-core | launcher/src/main/java/org/wildfly/core/launcher/DomainCommandBuilder.java | DomainCommandBuilder.addHostControllerJavaOptions | public DomainCommandBuilder addHostControllerJavaOptions(final String... args) {
if (args != null) {
for (String arg : args) {
addHostControllerJavaOption(arg);
}
}
return this;
} | java | public DomainCommandBuilder addHostControllerJavaOptions(final String... args) {
if (args != null) {
for (String arg : args) {
addHostControllerJavaOption(arg);
}
}
return this;
} | [
"public",
"DomainCommandBuilder",
"addHostControllerJavaOptions",
"(",
"final",
"String",
"...",
"args",
")",
"{",
"if",
"(",
"args",
"!=",
"null",
")",
"{",
"for",
"(",
"String",
"arg",
":",
"args",
")",
"{",
"addHostControllerJavaOption",
"(",
"arg",
")",
... | Adds a JVM arguments to the host controller ignoring {@code null} values.
@param args the arguments to add
@return the builder | [
"Adds",
"a",
"JVM",
"arguments",
"to",
"the",
"host",
"controller",
"ignoring",
"{",
"@code",
"null",
"}",
"values",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/launcher/src/main/java/org/wildfly/core/launcher/DomainCommandBuilder.java#L511-L518 | train | Add host controller java options. | Of course, here is the Java code you requested:
```java
public DomainCommandBuilder addHostControllerJavaOptions(final String... args) {
if (args != null) {
for (String arg : args) {
addHostControllerJavaOption(arg);
}
}
return this;
}
```
Hope this ... |
rapidpro/expressions | java/src/main/java/io/rapidpro/expressions/functions/ExcelFunctions.java | ExcelFunctions.unichar | public static String unichar(EvaluationContext ctx, Object number) {
return "" + (char) Conversions.toInteger(number, ctx);
} | java | public static String unichar(EvaluationContext ctx, Object number) {
return "" + (char) Conversions.toInteger(number, ctx);
} | [
"public",
"static",
"String",
"unichar",
"(",
"EvaluationContext",
"ctx",
",",
"Object",
"number",
")",
"{",
"return",
"\"\"",
"+",
"(",
"char",
")",
"Conversions",
".",
"toInteger",
"(",
"number",
",",
"ctx",
")",
";",
"}"
] | Returns the unicode character specified by a number | [
"Returns",
"the",
"unicode",
"character",
"specified",
"by",
"a",
"number"
] | b03d91ec58fc328960bce90ecb5fa49dcf467627 | https://github.com/rapidpro/expressions/blob/b03d91ec58fc328960bce90ecb5fa49dcf467627/java/src/main/java/io/rapidpro/expressions/functions/ExcelFunctions.java#L178-L180 | train | Returns the unicode code of the given number. | Of course, here is the Java code you requested:
```java
public static String unichar(EvaluationContext ctx, Object number) {
return "" + (char) Conversions.toInteger(number, ctx);
}
```
Hope this helps! |
lucee/Lucee | core/src/main/java/lucee/runtime/interpreter/VariableInterpreter.java | VariableInterpreter.getVariableEL | public static Object getVariableEL(PageContext pc, String var, Object defaultValue) {
StringList list = parse(pc, new ParserString(var), false);
if (list == null) return defaultValue;
int scope = scopeString2Int(pc.ignoreScopes(), list.next());
Object coll = null;
if (scope == Scope.SCOPE_UNDEFINED) {
coll =... | java | public static Object getVariableEL(PageContext pc, String var, Object defaultValue) {
StringList list = parse(pc, new ParserString(var), false);
if (list == null) return defaultValue;
int scope = scopeString2Int(pc.ignoreScopes(), list.next());
Object coll = null;
if (scope == Scope.SCOPE_UNDEFINED) {
coll =... | [
"public",
"static",
"Object",
"getVariableEL",
"(",
"PageContext",
"pc",
",",
"String",
"var",
",",
"Object",
"defaultValue",
")",
"{",
"StringList",
"list",
"=",
"parse",
"(",
"pc",
",",
"new",
"ParserString",
"(",
"var",
")",
",",
"false",
")",
";",
"i... | get a variable from page context
@param pc Page Context
@param var variable string to get value to
@param defaultValue value returnded if variable was not found
@return the value or default value if not found | [
"get",
"a",
"variable",
"from",
"page",
"context"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/interpreter/VariableInterpreter.java#L223-L248 | train | get a variable from a String | Of course, here is the Java code you requested:
```java
public static Object getVariableEL(PageContext pc, String var, Object defaultValue) {
StringList list = parse(pc, new ParserString(var), false);
if (list == null) return defaultValue;
int scope = scopeString2Int(pc.ignoreScopes(), list.next());
Object coll =... |
gwtbootstrap3/gwtbootstrap3-extras | src/main/java/org/gwtbootstrap3/extras/slider/client/ui/Range.java | Range.toJsArray | public JsArrayNumber toJsArray() {
JsArrayNumber array = JavaScriptObject.createArray().cast();
array.push(minValue);
array.push(maxValue);
return array;
} | java | public JsArrayNumber toJsArray() {
JsArrayNumber array = JavaScriptObject.createArray().cast();
array.push(minValue);
array.push(maxValue);
return array;
} | [
"public",
"JsArrayNumber",
"toJsArray",
"(",
")",
"{",
"JsArrayNumber",
"array",
"=",
"JavaScriptObject",
".",
"createArray",
"(",
")",
".",
"cast",
"(",
")",
";",
"array",
".",
"push",
"(",
"minValue",
")",
";",
"array",
".",
"push",
"(",
"maxValue",
")... | Converts the range to a JavaScript number array.
@return a JavaScript number array | [
"Converts",
"the",
"range",
"to",
"a",
"JavaScript",
"number",
"array",
"."
] | 8e42aaffd2a082e9cb23a14c37a3c87b7cbdfa94 | https://github.com/gwtbootstrap3/gwtbootstrap3-extras/blob/8e42aaffd2a082e9cb23a14c37a3c87b7cbdfa94/src/main/java/org/gwtbootstrap3/extras/slider/client/ui/Range.java#L83-L88 | train | Returns a JsArrayNumber representing the current set of attributes. | Of course, here is the Java code you requested:
```java
public JsArrayNumber toJsArray() {
JsArrayNumber array = JavaScriptObject.createArray().cast();
array.push(minValue);
array.push(maxValue);
return array;
}
```
Hope this helps! |
Alluxio/alluxio | core/transport/src/main/java/alluxio/grpc/GetJobStatusPRequest.java | GetJobStatusPRequest.getOptions | public alluxio.grpc.GetJobStatusPOptions getOptions() {
return options_ == null ? alluxio.grpc.GetJobStatusPOptions.getDefaultInstance() : options_;
} | java | public alluxio.grpc.GetJobStatusPOptions getOptions() {
return options_ == null ? alluxio.grpc.GetJobStatusPOptions.getDefaultInstance() : options_;
} | [
"public",
"alluxio",
".",
"grpc",
".",
"GetJobStatusPOptions",
"getOptions",
"(",
")",
"{",
"return",
"options_",
"==",
"null",
"?",
"alluxio",
".",
"grpc",
".",
"GetJobStatusPOptions",
".",
"getDefaultInstance",
"(",
")",
":",
"options_",
";",
"}"
] | <code>optional .alluxio.grpc.job.GetJobStatusPOptions options = 2;</code> | [
"<code",
">",
"optional",
".",
"alluxio",
".",
"grpc",
".",
"job",
".",
"GetJobStatusPOptions",
"options",
"=",
"2",
";",
"<",
"/",
"code",
">"
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/transport/src/main/java/alluxio/grpc/GetJobStatusPRequest.java#L122-L124 | train | Gets the options. | Of course, here is the Java code you requested:
```java
public alluxio.grpc.GetJobStatusPOptions getOptions() {
return options_ == null ? alluxio.grpc.GetJobStatusPOptions.getDefaultInstance() : options_;
}
```
Hope this helps! |
grails/grails-core | grails-encoder/src/main/groovy/org/grails/encoder/WriterEncodedAppender.java | WriterEncodedAppender.write | @Override
protected void write(EncodingState encodingState, char[] b, int off, int len) throws IOException {
target.write(b, off, len);
} | java | @Override
protected void write(EncodingState encodingState, char[] b, int off, int len) throws IOException {
target.write(b, off, len);
} | [
"@",
"Override",
"protected",
"void",
"write",
"(",
"EncodingState",
"encodingState",
",",
"char",
"[",
"]",
"b",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"target",
".",
"write",
"(",
"b",
",",
"off",
",",
"len",
")",
... | /* (non-Javadoc)
@see AbstractEncodedAppender#write(EncodingState, char[], int, int) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-encoder/src/main/groovy/org/grails/encoder/WriterEncodedAppender.java#L52-L55 | train | Override this method to write the content of a sequence of characters to the target stream. | Of course, here is the Java code you requested:
```java
@Override
protected void write(EncodingState encodingState, char[] b, int off, int len) throws IOException {
target.write(b, off, len);
}
```
Hope this helps! |
overturetool/overture | ide/debug/src/main/java/org/overture/ide/debug/utils/CharOperation.java | CharOperation.indexOf | public static final int indexOf(final char[] toBeFound, final char[] array,
final boolean isCaseSensitive, final int start, final int end)
{
final int arrayLength = end;
final int toBeFoundLength = toBeFound.length;
if (toBeFoundLength > arrayLength)
{
return -1;
}
if (toBeFoundLength == 0)
{
re... | java | public static final int indexOf(final char[] toBeFound, final char[] array,
final boolean isCaseSensitive, final int start, final int end)
{
final int arrayLength = end;
final int toBeFoundLength = toBeFound.length;
if (toBeFoundLength > arrayLength)
{
return -1;
}
if (toBeFoundLength == 0)
{
re... | [
"public",
"static",
"final",
"int",
"indexOf",
"(",
"final",
"char",
"[",
"]",
"toBeFound",
",",
"final",
"char",
"[",
"]",
"array",
",",
"final",
"boolean",
"isCaseSensitive",
",",
"final",
"int",
"start",
",",
"final",
"int",
"end",
")",
"{",
"final",
... | Answers the first index in the array for which the toBeFound array is a matching subarray following the case rule
starting at the index start. Answers -1 if no match is found. <br>
<br>
For example:
<ol>
<li>
<pre>
toBeFound = { 'c' }
array = { ' a', 'b', 'c', 'd' }
result => 2
</pre>
</li>
<li>
<pre>
toBeFound =... | [
"Answers",
"the",
"first",
"index",
"in",
"the",
"array",
"for",
"which",
"the",
"toBeFound",
"array",
"is",
"a",
"matching",
"subarray",
"following",
"the",
"case",
"rule",
"starting",
"at",
"the",
"index",
"start",
".",
"Answers",
"-",
"1",
"if",
"no",
... | 83175dc6c24fa171cde4fcf61ecb648eba3bdbc1 | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/ide/debug/src/main/java/org/overture/ide/debug/utils/CharOperation.java#L2182-L2255 | train | Gets the index of the first occurrence of toBeFound in the array. | Of course, here is the Java code you requested:
```java
public static final int indexOf(final char[] toBeFound, final char[] array,
final boolean isCaseSensitive, final int start, final int end)
{
final int arrayLength = end;
final int toBeFoundLength = toBeFound.length;
if (toBeFoundLength > arrayLength)
... |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/JCRCacheHandler.java | JCRCacheHandler.move | public void move(Serializable oldKey, Serializable newKey, CacheType cacheType)
{
if (enabled)
{
super.move(oldKey, newKey, cacheType);
}
} | java | public void move(Serializable oldKey, Serializable newKey, CacheType cacheType)
{
if (enabled)
{
super.move(oldKey, newKey, cacheType);
}
} | [
"public",
"void",
"move",
"(",
"Serializable",
"oldKey",
",",
"Serializable",
"newKey",
",",
"CacheType",
"cacheType",
")",
"{",
"if",
"(",
"enabled",
")",
"{",
"super",
".",
"move",
"(",
"oldKey",
",",
"newKey",
",",
"cacheType",
")",
";",
"}",
"}"
] | {@inheritDoc} | [
"{"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/JCRCacheHandler.java#L167-L173 | train | Move the entry from one key to another. | Of course, here is the Java code you requested:
```java
public void move(Serializable oldKey, Serializable newKey, CacheType cacheType)
{
if (enabled)
{
super.move(oldKey, newKey, cacheType);
}
}
```
Hope this helps! |
aws/aws-sdk-java | aws-java-sdk-iam/src/main/java/com/amazonaws/services/identitymanagement/model/GetAccountAuthorizationDetailsResult.java | GetAccountAuthorizationDetailsResult.setRoleDetailList | public void setRoleDetailList(java.util.Collection<RoleDetail> roleDetailList) {
if (roleDetailList == null) {
this.roleDetailList = null;
return;
}
this.roleDetailList = new com.amazonaws.internal.SdkInternalList<RoleDetail>(roleDetailList);
} | java | public void setRoleDetailList(java.util.Collection<RoleDetail> roleDetailList) {
if (roleDetailList == null) {
this.roleDetailList = null;
return;
}
this.roleDetailList = new com.amazonaws.internal.SdkInternalList<RoleDetail>(roleDetailList);
} | [
"public",
"void",
"setRoleDetailList",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"RoleDetail",
">",
"roleDetailList",
")",
"{",
"if",
"(",
"roleDetailList",
"==",
"null",
")",
"{",
"this",
".",
"roleDetailList",
"=",
"null",
";",
"return",
";",
"}"... | <p>
A list containing information about IAM roles.
</p>
@param roleDetailList
A list containing information about IAM roles. | [
"<p",
">",
"A",
"list",
"containing",
"information",
"about",
"IAM",
"roles",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iam/src/main/java/com/amazonaws/services/identitymanagement/model/GetAccountAuthorizationDetailsResult.java#L242-L249 | train | Sets the value roleDetailList ; | Of course, here is the Java code you requested:
```java
public void setRoleDetailList(java.util.Collection<RoleDetail> roleDetailList) {
if (roleDetailList == null) {
this.roleDetailList = null;
return;
}
this.roleDetailList = new com.amazonaws.internal.SdkInternalList<... |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/common/ProjectNodeSupport.java | ProjectNodeSupport.unloadSources | private synchronized void unloadSources() {
nodesSourceList = new ArrayList<>();
Closeables.closeQuietly(nodeSourceReferences);
nodeSourceReferences = new HashSet<>();
sourcesOpened = false;
} | java | private synchronized void unloadSources() {
nodesSourceList = new ArrayList<>();
Closeables.closeQuietly(nodeSourceReferences);
nodeSourceReferences = new HashSet<>();
sourcesOpened = false;
} | [
"private",
"synchronized",
"void",
"unloadSources",
"(",
")",
"{",
"nodesSourceList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Closeables",
".",
"closeQuietly",
"(",
"nodeSourceReferences",
")",
";",
"nodeSourceReferences",
"=",
"new",
"HashSet",
"<>",
"("... | Clear the sources list and close all plugin loader references | [
"Clear",
"the",
"sources",
"list",
"and",
"close",
"all",
"plugin",
"loader",
"references"
] | 8070f774f55bffaa1118ff0c03aea319d40a9668 | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/common/ProjectNodeSupport.java#L255-L260 | train | Unload all sources. | Of course, here is the Java code you requested:
```java
private synchronized void unloadSources() {
nodesSourceList = new ArrayList<>();
Closeables.closeQuietly(nodeSourceReferences);
nodeSourceReferences = new HashSet<>();
sourcesOpened = false;
}
```
Hope this helps! |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java | PackageUseWriter.generatePackageUseFile | protected void generatePackageUseFile() throws IOException {
Content body = getPackageUseHeader();
HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.addStyle(HtmlStyle.contentContainer);
if (usingPackageToUsedClasses.isEmpty()) {
div.addContent(getResource(
"d... | java | protected void generatePackageUseFile() throws IOException {
Content body = getPackageUseHeader();
HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.addStyle(HtmlStyle.contentContainer);
if (usingPackageToUsedClasses.isEmpty()) {
div.addContent(getResource(
"d... | [
"protected",
"void",
"generatePackageUseFile",
"(",
")",
"throws",
"IOException",
"{",
"Content",
"body",
"=",
"getPackageUseHeader",
"(",
")",
";",
"HtmlTree",
"div",
"=",
"new",
"HtmlTree",
"(",
"HtmlTag",
".",
"DIV",
")",
";",
"div",
".",
"addStyle",
"(",... | Generate the package use list. | [
"Generate",
"the",
"package",
"use",
"list",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java#L117-L131 | train | Generate the package use file. | Of course, here is the Java code you requested:
```java
protected void generatePackageUseFile() throws IOException {
Content body = getPackageUseHeader();
HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.addStyle(HtmlStyle.contentContainer);
if (usingPackageToUsedClasses.isEmpty()) {
... |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java | CPDefinitionOptionRelPersistenceImpl.create | @Override
public CPDefinitionOptionRel create(long CPDefinitionOptionRelId) {
CPDefinitionOptionRel cpDefinitionOptionRel = new CPDefinitionOptionRelImpl();
cpDefinitionOptionRel.setNew(true);
cpDefinitionOptionRel.setPrimaryKey(CPDefinitionOptionRelId);
String uuid = PortalUUIDUtil.generate();
cpDefiniti... | java | @Override
public CPDefinitionOptionRel create(long CPDefinitionOptionRelId) {
CPDefinitionOptionRel cpDefinitionOptionRel = new CPDefinitionOptionRelImpl();
cpDefinitionOptionRel.setNew(true);
cpDefinitionOptionRel.setPrimaryKey(CPDefinitionOptionRelId);
String uuid = PortalUUIDUtil.generate();
cpDefiniti... | [
"@",
"Override",
"public",
"CPDefinitionOptionRel",
"create",
"(",
"long",
"CPDefinitionOptionRelId",
")",
"{",
"CPDefinitionOptionRel",
"cpDefinitionOptionRel",
"=",
"new",
"CPDefinitionOptionRelImpl",
"(",
")",
";",
"cpDefinitionOptionRel",
".",
"setNew",
"(",
"true",
... | Creates a new cp definition option rel with the primary key. Does not add the cp definition option rel to the database.
@param CPDefinitionOptionRelId the primary key for the new cp definition option rel
@return the new cp definition option rel | [
"Creates",
"a",
"new",
"cp",
"definition",
"option",
"rel",
"with",
"the",
"primary",
"key",
".",
"Does",
"not",
"add",
"the",
"cp",
"definition",
"option",
"rel",
"to",
"the",
"database",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java#L4014-L4028 | train | Creates a new cp definition option rel with the primary key. Does not add the cp definition option rel to the database. Also notifies the appropriate model listeners. | Of course, here is the Java code you requested:
```java
@Override
public CPDefinitionOptionRel create(long CPDefinitionOptionRelId) {
CPDefinitionOptionRel cpDefinitionOptionRel = new CPDefinitionOptionRelImpl();
cpDefinitionOptionRel.setNew(true);
cpDefinitionOptionRel.setPrimaryKey(CPDefinitionOptionRelId);
... |
grails/grails-core | grails-bootstrap/src/main/groovy/org/grails/io/support/GrailsResourceUtils.java | GrailsResourceUtils.getPathFromBaseDir | public static String getPathFromBaseDir(String path) {
int i = path.indexOf("grails-app/");
if(i > -1 ) {
return path.substring(i + 11);
}
else {
try {
File baseDir = BuildSettings.BASE_DIR;
String basePath = baseDir != null ? baseD... | java | public static String getPathFromBaseDir(String path) {
int i = path.indexOf("grails-app/");
if(i > -1 ) {
return path.substring(i + 11);
}
else {
try {
File baseDir = BuildSettings.BASE_DIR;
String basePath = baseDir != null ? baseD... | [
"public",
"static",
"String",
"getPathFromBaseDir",
"(",
"String",
"path",
")",
"{",
"int",
"i",
"=",
"path",
".",
"indexOf",
"(",
"\"grails-app/\"",
")",
";",
"if",
"(",
"i",
">",
"-",
"1",
")",
"{",
"return",
"path",
".",
"substring",
"(",
"i",
"+"... | Gets the path relative to the project base directory.
Input: /usr/joe/project/grails-app/conf/BootStrap.groovy
Output: grails-app/conf/BootStrap.groovy
@param path The path
@return The path relative to the base directory or null if it can't be established | [
"Gets",
"the",
"path",
"relative",
"to",
"the",
"project",
"base",
"directory",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-bootstrap/src/main/groovy/org/grails/io/support/GrailsResourceUtils.java#L861-L879 | train | Get path from base directory | Of course, here is the Java code you requested:
```java
public static String getPathFromBaseDir(String path) {
int i = path.indexOf("grails-app/");
if(i > -1 ) {
return path.substring(i + 11);
}
else {
try {
File baseDir = BuildSettings.BASE_DIR;
... |
hsiafan/requests | src/main/java/net/dongliu/requests/Headers.java | Headers.getCharset | public Charset getCharset(Charset defaultCharset) {
String contentType = getHeader(HttpHeaders.NAME_CONTENT_TYPE);
if (contentType == null) {
return defaultCharset;
}
String[] items = contentType.split(";");
for (String item : items) {
item = item.trim();
... | java | public Charset getCharset(Charset defaultCharset) {
String contentType = getHeader(HttpHeaders.NAME_CONTENT_TYPE);
if (contentType == null) {
return defaultCharset;
}
String[] items = contentType.split(";");
for (String item : items) {
item = item.trim();
... | [
"public",
"Charset",
"getCharset",
"(",
"Charset",
"defaultCharset",
")",
"{",
"String",
"contentType",
"=",
"getHeader",
"(",
"HttpHeaders",
".",
"NAME_CONTENT_TYPE",
")",
";",
"if",
"(",
"contentType",
"==",
"null",
")",
"{",
"return",
"defaultCharset",
";",
... | Get charset set in content type header.
@return the charset, or defaultCharset if no charset is set. | [
"Get",
"charset",
"set",
"in",
"content",
"type",
"header",
"."
] | a6cc6f8293e808cc937d3789aec2616a8383dee0 | https://github.com/hsiafan/requests/blob/a6cc6f8293e808cc937d3789aec2616a8383dee0/src/main/java/net/dongliu/requests/Headers.java#L110-L135 | train | Gets the charset from the content type header. | Of course, here is the Java code you requested:
```java
public Charset getCharset(Charset defaultCharset) {
String contentType = getHeader(HttpHeaders.NAME_CONTENT_TYPE);
if (contentType == null) {
return defaultCharset;
}
String[] items = contentType.split(";");
for... |
jcuda/jcublas | JCublasJava/src/main/java/jcuda/jcublas/JCublas.java | JCublas.cublasDsyr | public static void cublasDsyr(char uplo, int n, double alpha, Pointer x, int incx, Pointer A, int lda)
{
cublasDsyrNative(uplo, n, alpha, x, incx, A, lda);
checkResultBLAS();
} | java | public static void cublasDsyr(char uplo, int n, double alpha, Pointer x, int incx, Pointer A, int lda)
{
cublasDsyrNative(uplo, n, alpha, x, incx, A, lda);
checkResultBLAS();
} | [
"public",
"static",
"void",
"cublasDsyr",
"(",
"char",
"uplo",
",",
"int",
"n",
",",
"double",
"alpha",
",",
"Pointer",
"x",
",",
"int",
"incx",
",",
"Pointer",
"A",
",",
"int",
"lda",
")",
"{",
"cublasDsyrNative",
"(",
"uplo",
",",
"n",
",",
"alpha"... | <pre>
void
cublasDsyr (char uplo, int n, double alpha, const double *x, int incx,
double *A, int lda)
performs the symmetric rank 1 operation
A = alpha * x * transpose(x) + A,
where alpha is a double precision scalar, x is an n element double
precision vector and A is an n x n symmetric matrix consisting of
double p... | [
"<pre",
">",
"void",
"cublasDsyr",
"(",
"char",
"uplo",
"int",
"n",
"double",
"alpha",
"const",
"double",
"*",
"x",
"int",
"incx",
"double",
"*",
"A",
"int",
"lda",
")"
] | 80875235d24562073f4d66651dd17263f306427d | https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L7715-L7719 | test | Cublas Dsyr for symmetric matrix. | Of course, here is the Java code you requested:
```java
public static void cublasDsyr(char uplo, int n, double alpha, Pointer x, int incx, Pointer A, int lda)
{
cublasDsyrNative(uplo, n, alpha, x, incx, A, lda);
checkResultBLAS();
}
```
Hope this helps! |
BioPAX/Paxtools | paxtools-query/src/main/java/org/biopax/paxtools/query/wrapperL3undirected/ControlWrapper.java | ControlWrapper.initUpstream | @Override
public void initUpstream()
{
for (Controller controller : ctrl.getController())
{
if (controller instanceof Pathway) continue;
PhysicalEntity pe = (PhysicalEntity) controller;
bindUpstream(pe);
}
for (Control control : ctrl.getControlledOf())
{
bindUpstream(control);
}
for (Proc... | java | @Override
public void initUpstream()
{
for (Controller controller : ctrl.getController())
{
if (controller instanceof Pathway) continue;
PhysicalEntity pe = (PhysicalEntity) controller;
bindUpstream(pe);
}
for (Control control : ctrl.getControlledOf())
{
bindUpstream(control);
}
for (Proc... | [
"@",
"Override",
"public",
"void",
"initUpstream",
"(",
")",
"{",
"for",
"(",
"Controller",
"controller",
":",
"ctrl",
".",
"getController",
"(",
")",
")",
"{",
"if",
"(",
"controller",
"instanceof",
"Pathway",
")",
"continue",
";",
"PhysicalEntity",
"pe",
... | Binds the controller and other Controls that controls this control. | [
"Binds",
"the",
"controller",
"and",
"other",
"Controls",
"that",
"controls",
"this",
"control",
"."
] | 2f93afa94426bf8b5afc2e0e61cd4b269a83288d | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/wrapperL3undirected/ControlWrapper.java#L139-L162 | train | Initializes the upstream. | Of course, here is the Java code you requested:
```java
@Override
public void initUpstream()
{
for (Controller controller : ctrl.getController())
{
if (controller instanceof Pathway) continue;
PhysicalEntity pe = (PhysicalEntity) controller;
bindUpstream(pe);
}
for (Control control : ctrl.getContr... |
TheHolyWaffle/League-of-Legends-XMPP-Chat-Library | src/main/java/com/github/theholywaffle/lolchatapi/LolStatus.java | LolStatus.getInt | private int getInt(XMLProperty p, int defaultValue) {
final String value = get(p);
if (value.isEmpty()) {
return defaultValue;
}
return Integer.parseInt(value);
} | java | private int getInt(XMLProperty p, int defaultValue) {
final String value = get(p);
if (value.isEmpty()) {
return defaultValue;
}
return Integer.parseInt(value);
} | [
"private",
"int",
"getInt",
"(",
"XMLProperty",
"p",
",",
"int",
"defaultValue",
")",
"{",
"final",
"String",
"value",
"=",
"get",
"(",
"p",
")",
";",
"if",
"(",
"value",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"defaultValue",
";",
"}",
"return... | If the value exists it returns its value else the default value
@param p the {@link XMLProperty}
@param defaultValue the fallback value
@return returns the value of the given {@link XMLProperty} | [
"If",
"the",
"value",
"exists",
"it",
"returns",
"its",
"value",
"else",
"the",
"default",
"value"
] | 5e4d87d0c054ff2f6510545b0e9f838338695c70 | https://github.com/TheHolyWaffle/League-of-Legends-XMPP-Chat-Library/blob/5e4d87d0c054ff2f6510545b0e9f838338695c70/src/main/java/com/github/theholywaffle/lolchatapi/LolStatus.java#L264-L270 | train | Gets the value of a
property. | Of course, here is the Java code you requested:
```java
private int getInt(XMLProperty p, int defaultValue) {
final String value = get(p);
if (value.isEmpty()) {
return defaultValue;
}
return Integer.parseInt(value);
}
```
Hope this helps! |
sksamuel/scrimage | scrimage-filters/src/main/java/thirdparty/marvin/image/MarvinAttributes.java | MarvinAttributes.toStringArray | public String[] toStringArray() {
String key;
String attrs[] = new String[hashAttributes.size() * 2];
String[] keys = hashAttributes.keySet().toArray(new String[0]);
for (int x = 0; x < keys.length; x++) {
attrs[(x * 2)] = keys[x];
attrs[(x * 2) + 1] = "" + hashAt... | java | public String[] toStringArray() {
String key;
String attrs[] = new String[hashAttributes.size() * 2];
String[] keys = hashAttributes.keySet().toArray(new String[0]);
for (int x = 0; x < keys.length; x++) {
attrs[(x * 2)] = keys[x];
attrs[(x * 2) + 1] = "" + hashAt... | [
"public",
"String",
"[",
"]",
"toStringArray",
"(",
")",
"{",
"String",
"key",
";",
"String",
"attrs",
"[",
"]",
"=",
"new",
"String",
"[",
"hashAttributes",
".",
"size",
"(",
")",
"*",
"2",
"]",
";",
"String",
"[",
"]",
"keys",
"=",
"hashAttributes"... | Returns all attributes� name and value as a String array.
@return string array with all attributes� name and value. | [
"Returns",
"all",
"attributes�",
"name",
"and",
"value",
"as",
"a",
"String",
"array",
"."
] | 52dab448136e6657a71951b0e6b7d5e64dc979ac | https://github.com/sksamuel/scrimage/blob/52dab448136e6657a71951b0e6b7d5e64dc979ac/scrimage-filters/src/main/java/thirdparty/marvin/image/MarvinAttributes.java#L80-L89 | train | Returns an array of strings representing the attributes of this class. | Of course, here is the Java code you requested:
```java
public String[] toStringArray() {
String key;
String attrs[] = new String[hashAttributes.size() * 2];
String[] keys = hashAttributes.keySet().toArray(new String[0]);
for (int x = 0; x < keys.length; x++) {
attrs[(x * 2)... |
redkale/redkale | src/org/redkale/net/http/HttpRequest.java | HttpRequest.getRequstURIPath | public short getRequstURIPath(String prefix, short defvalue) {
String val = getRequstURIPath(prefix, null);
try {
return val == null ? defvalue : Short.parseShort(val);
} catch (NumberFormatException e) {
return defvalue;
}
} | java | public short getRequstURIPath(String prefix, short defvalue) {
String val = getRequstURIPath(prefix, null);
try {
return val == null ? defvalue : Short.parseShort(val);
} catch (NumberFormatException e) {
return defvalue;
}
} | [
"public",
"short",
"getRequstURIPath",
"(",
"String",
"prefix",
",",
"short",
"defvalue",
")",
"{",
"String",
"val",
"=",
"getRequstURIPath",
"(",
"prefix",
",",
"null",
")",
";",
"try",
"{",
"return",
"val",
"==",
"null",
"?",
"defvalue",
":",
"Short",
... | 获取请求URL分段中含prefix段的short值 <br>
例如请求URL /pipes/record/query/type:10 <br>
获取type参数: short type = request.getRequstURIPath("type:", (short)0);
@param prefix prefix段前缀
@param defvalue 默认short值
@return short值 | [
"获取请求URL分段中含prefix段的short值",
"<br",
">",
"例如请求URL",
"/",
"pipes",
"/",
"record",
"/",
"query",
"/",
"type",
":",
"10",
"<br",
">",
"获取type参数",
":",
"short",
"type",
"=",
"request",
".",
"getRequstURIPath",
"(",
"type",
":",
"(",
"short",
")",
"0",
")",
... | ea5169b5c5ea7412fd762331c0c497165832e901 | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/net/http/HttpRequest.java#L817-L824 | train | Gets the relativized URI path. | Of course, here is the Java code you requested:
```java
public short getRequstURIPath(String prefix, short defvalue) {
String val = getRequstURIPath(prefix, null);
try {
return val == null ? defvalue : Short.parseShort(val);
} catch (NumberFormatException e) {
retur... |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteModelMethod.java | SQLiteModelMethod.findParameterTypeByAliasOrName | public TypeName findParameterTypeByAliasOrName(String name) {
if (parameterAlias2NameField.containsKey(name)) {
return findParameterType(parameterAlias2NameField.get(name));
}
return findParameterType(name);
} | java | public TypeName findParameterTypeByAliasOrName(String name) {
if (parameterAlias2NameField.containsKey(name)) {
return findParameterType(parameterAlias2NameField.get(name));
}
return findParameterType(name);
} | [
"public",
"TypeName",
"findParameterTypeByAliasOrName",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"parameterAlias2NameField",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"return",
"findParameterType",
"(",
"parameterAlias2NameField",
".",
"get",
"(",
"name",
... | Check if method contains a parameter with value as typeName.
@param name
the name
@return TypeMirror associated | [
"Check",
"if",
"method",
"contains",
"a",
"parameter",
"with",
"value",
"as",
"typeName",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteModelMethod.java#L758-L764 | train | Find the type by alias name. | Of course, here is the Java code you requested:
```java
public TypeName findParameterTypeByAliasOrName(String name) {
if (parameterAlias2NameField.containsKey(name)) {
return findParameterType(parameterAlias2NameField.get(name));
}
return findParameterType(name);
}
```
Hope this helps! |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/DefaultBeanContext.java | DefaultBeanContext.findBean | public @Nonnull <T> Optional<T> findBean(@Nullable BeanResolutionContext resolutionContext, @Nonnull Class<T> beanType, @Nullable Qualifier<T> qualifier) {
ArgumentUtils.requireNonNull("beanType", beanType);
// allow injection the bean context
if (thisInterfaces.contains(beanType)) {
... | java | public @Nonnull <T> Optional<T> findBean(@Nullable BeanResolutionContext resolutionContext, @Nonnull Class<T> beanType, @Nullable Qualifier<T> qualifier) {
ArgumentUtils.requireNonNull("beanType", beanType);
// allow injection the bean context
if (thisInterfaces.contains(beanType)) {
... | [
"public",
"@",
"Nonnull",
"<",
"T",
">",
"Optional",
"<",
"T",
">",
"findBean",
"(",
"@",
"Nullable",
"BeanResolutionContext",
"resolutionContext",
",",
"@",
"Nonnull",
"Class",
"<",
"T",
">",
"beanType",
",",
"@",
"Nullable",
"Qualifier",
"<",
"T",
">",
... | Find an optional bean of the given type and qualifier.
@param resolutionContext The bean context resolution
@param beanType The bean type
@param qualifier The qualifier
@param <T> The bean type parameter
@return The found bean wrapped as an {@link Optional} | [
"Find",
"an",
"optional",
"bean",
"of",
"the",
"given",
"type",
"and",
"qualifier",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/DefaultBeanContext.java#L1025-L1038 | train | Find a bean. | Of course, here is the Java code you requested:
```java
public @Nonnull <T> Optional<T> findBean(@Nullable BeanResolutionContext resolutionContext, @Nonnull Class<T> beanType, @Nullable Qualifier<T> qualifier) {
ArgumentUtils.requireNonNull("beanType", beanType);
// allow injection the bean context
... |
adamfisk/littleshoot-commons-id | src/main/java/org/apache/commons/id/uuid/state/StateHelper.java | StateHelper.decodeMACAddress | public static byte[] decodeMACAddress(String address) {
StringBuffer buf = new StringBuffer(MAC_ADDRESS_TOKEN_COUNT * 2);
StringTokenizer tokens = new StringTokenizer(address, "-");
if (tokens.countTokens() != MAC_ADDRESS_TOKEN_COUNT) {
return null;
} else {
for (... | java | public static byte[] decodeMACAddress(String address) {
StringBuffer buf = new StringBuffer(MAC_ADDRESS_TOKEN_COUNT * 2);
StringTokenizer tokens = new StringTokenizer(address, "-");
if (tokens.countTokens() != MAC_ADDRESS_TOKEN_COUNT) {
return null;
} else {
for (... | [
"public",
"static",
"byte",
"[",
"]",
"decodeMACAddress",
"(",
"String",
"address",
")",
"{",
"StringBuffer",
"buf",
"=",
"new",
"StringBuffer",
"(",
"MAC_ADDRESS_TOKEN_COUNT",
"*",
"2",
")",
";",
"StringTokenizer",
"tokens",
"=",
"new",
"StringTokenizer",
"(",
... | <p>Utility method decodes a valid MAC address in the form of
XX-XX-XX-XX-XX-XX where each XX represents a hexidecimal value.</p>
<p> Returns null if the address can not be decoded. </p>
@param address the String hexidecimal dash separated MAC address.
@return a byte array representing the the address. Null if not a v... | [
"<p",
">",
"Utility",
"method",
"decodes",
"a",
"valid",
"MAC",
"address",
"in",
"the",
"form",
"of",
"XX",
"-",
"XX",
"-",
"XX",
"-",
"XX",
"-",
"XX",
"-",
"XX",
"where",
"each",
"XX",
"represents",
"a",
"hexidecimal",
"value",
".",
"<",
"/",
"p",... | 49a8f5f2b10831c509876ca463bf1a87e1e49ae9 | https://github.com/adamfisk/littleshoot-commons-id/blob/49a8f5f2b10831c509876ca463bf1a87e1e49ae9/src/main/java/org/apache/commons/id/uuid/state/StateHelper.java#L215-L232 | train | Decode a MAC address. | Of course, here is the Java code you requested:
```java
public static byte[] decodeMACAddress(String address) {
StringBuffer buf = new StringBuffer(MAC_ADDRESS_TOKEN_COUNT * 2);
StringTokenizer tokens = new StringTokenizer(address, "-");
if (tokens.countTokens() != MAC_ADDRESS_TOKEN_COUNT) {
... |
ixa-ehu/ixa-pipe-ml | src/main/java/eus/ixa/ixa/pipe/ml/parse/CollinsHeadFinder.java | CollinsHeadFinder.printHeads | @Override
public void printHeads(final Parse parse) {
if (parse == null || parse.getChildCount() == 0) {
throw new IllegalArgumentException(
"Can't return head of null or leaf Parse.");
}
final LinkedList<Parse> nodes = new LinkedList<Parse>();
nodes.add(parse);
// This is a recurs... | java | @Override
public void printHeads(final Parse parse) {
if (parse == null || parse.getChildCount() == 0) {
throw new IllegalArgumentException(
"Can't return head of null or leaf Parse.");
}
final LinkedList<Parse> nodes = new LinkedList<Parse>();
nodes.add(parse);
// This is a recurs... | [
"@",
"Override",
"public",
"void",
"printHeads",
"(",
"final",
"Parse",
"parse",
")",
"{",
"if",
"(",
"parse",
"==",
"null",
"||",
"parse",
".",
"getChildCount",
"(",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Can't retur... | /*
(non-Javadoc)
@see
eus.ixa.ixa.pipe.heads.HeadFinder#printHeads(opennlp.tools.parser.Parse) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | c817fa1e40e96ed15fc79d22c3a7c25f1a40d172 | https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/parse/CollinsHeadFinder.java#L84-L118 | train | Print the head of a parse. | Of course, here is the Java code you requested:
```java
@Override
public void printHeads(final Parse parse) {
if (parse == null || parse.getChildCount() == 0) {
throw new IllegalArgumentException(
"Can't return head of null or leaf Parse.");
}
final LinkedList<Parse> nodes = new LinkedLis... |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java | JDBCStorageConnection.rollback | public final void rollback() throws IllegalStateException, RepositoryException
{
checkIfOpened();
try
{
closeStatements();
if (!readOnly)
{
try
{
if (getDbConnectionTotalUsed() == 1)
{
// We don't ro... | java | public final void rollback() throws IllegalStateException, RepositoryException
{
checkIfOpened();
try
{
closeStatements();
if (!readOnly)
{
try
{
if (getDbConnectionTotalUsed() == 1)
{
// We don't ro... | [
"public",
"final",
"void",
"rollback",
"(",
")",
"throws",
"IllegalStateException",
",",
"RepositoryException",
"{",
"checkIfOpened",
"(",
")",
";",
"try",
"{",
"closeStatements",
"(",
")",
";",
"if",
"(",
"!",
"readOnly",
")",
"{",
"try",
"{",
"if",
"(",
... | {@inheritDoc} | [
"{"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java#L408-L481 | train | Rollback from the database. | Of course, here is the Java code you requested:
```java
public final void rollback() throws IllegalStateException, RepositoryException
{
checkIfOpened();
try
{
closeStatements();
if (!readOnly)
{
try
{
if (getDbConnectionTotalUsed(... |
apereo/cas | support/cas-server-support-consent-core/src/main/java/org/apereo/cas/consent/AttributeConsentReportEndpoint.java | AttributeConsentReportEndpoint.consentDecisions | @ReadOperation
public Collection<Map<String, Object>> consentDecisions(@Selector final String principal) {
val result = new HashSet<Map<String, Object>>();
LOGGER.debug("Fetching consent decisions for principal [{}]", principal);
val consentDecisions = this.consentRepository.findConsentDecis... | java | @ReadOperation
public Collection<Map<String, Object>> consentDecisions(@Selector final String principal) {
val result = new HashSet<Map<String, Object>>();
LOGGER.debug("Fetching consent decisions for principal [{}]", principal);
val consentDecisions = this.consentRepository.findConsentDecis... | [
"@",
"ReadOperation",
"public",
"Collection",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"consentDecisions",
"(",
"@",
"Selector",
"final",
"String",
"principal",
")",
"{",
"val",
"result",
"=",
"new",
"HashSet",
"<",
"Map",
"<",
"String",
",",
... | Consent decisions collection.
@param principal the principal
@return the collection | [
"Consent",
"decisions",
"collection",
"."
] | b4b306433a8782cef803a39bea5b1f96740e0e9b | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-consent-core/src/main/java/org/apereo/cas/consent/AttributeConsentReportEndpoint.java#L44-L58 | train | Gets consent decisions. | Of course, here is the Java code you requested:
```java
@ReadOperation
public Collection<Map<String, Object>> consentDecisions(@Selector final String principal) {
val result = new HashSet<Map<String, Object>>();
LOGGER.debug("Fetching consent decisions for principal [{}]", principal);
val c... |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/join/JoinRecordReader.java | JoinRecordReader.next | public boolean next(K key, TupleWritable value) throws IOException {
if (jc.flush(value)) {
WritableUtils.cloneInto(key, jc.key());
return true;
}
jc.clear();
K iterkey = createKey();
final PriorityQueue<ComposableRecordReader<K,?>> q = getRecordReaderQueue();
while (!q.isEmpty()) {
... | java | public boolean next(K key, TupleWritable value) throws IOException {
if (jc.flush(value)) {
WritableUtils.cloneInto(key, jc.key());
return true;
}
jc.clear();
K iterkey = createKey();
final PriorityQueue<ComposableRecordReader<K,?>> q = getRecordReaderQueue();
while (!q.isEmpty()) {
... | [
"public",
"boolean",
"next",
"(",
"K",
"key",
",",
"TupleWritable",
"value",
")",
"throws",
"IOException",
"{",
"if",
"(",
"jc",
".",
"flush",
"(",
"value",
")",
")",
"{",
"WritableUtils",
".",
"cloneInto",
"(",
"key",
",",
"jc",
".",
"key",
"(",
")"... | Emit the next set of key, value pairs as defined by the child
RecordReaders and operation associated with this composite RR. | [
"Emit",
"the",
"next",
"set",
"of",
"key",
"value",
"pairs",
"as",
"defined",
"by",
"the",
"child",
"RecordReaders",
"and",
"operation",
"associated",
"with",
"this",
"composite",
"RR",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/join/JoinRecordReader.java#L47-L65 | train | This method is called to read the next tuple from the underlying record reader. | Of course, here is the Java code you requested:
```java
public boolean next(K key, TupleWritable value) throws IOException {
if (jc.flush(value)) {
WritableUtils.cloneInto(key, jc.key());
return true;
}
jc.clear();
K iterkey = createKey();
final PriorityQueue<ComposableRecordReader<K,?>... |
groupe-sii/ogham | ogham-core/src/main/java/fr/sii/ogham/core/builder/retry/RetryBuilder.java | RetryBuilder.fixedDelay | public FixedDelayBuilder<RetryBuilder<P>> fixedDelay() {
if (fixedDelay == null) {
fixedDelay = new FixedDelayBuilder<>(this, environmentBuilder);
}
return fixedDelay;
} | java | public FixedDelayBuilder<RetryBuilder<P>> fixedDelay() {
if (fixedDelay == null) {
fixedDelay = new FixedDelayBuilder<>(this, environmentBuilder);
}
return fixedDelay;
} | [
"public",
"FixedDelayBuilder",
"<",
"RetryBuilder",
"<",
"P",
">",
">",
"fixedDelay",
"(",
")",
"{",
"if",
"(",
"fixedDelay",
"==",
"null",
")",
"{",
"fixedDelay",
"=",
"new",
"FixedDelayBuilder",
"<>",
"(",
"this",
",",
"environmentBuilder",
")",
";",
"}"... | Retry several times with a fixed delay between each try until the maximum
attempts is reached.
For example:
<pre>
.fixedDelay()
.delay(500)
.maxRetries(5)
</pre>
Means that a retry will be attempted every 500ms until 5 attempts are
reached (inclusive). For example, you want to connect to an external
system at t1=0 a... | [
"Retry",
"several",
"times",
"with",
"a",
"fixed",
"delay",
"between",
"each",
"try",
"until",
"the",
"maximum",
"attempts",
"is",
"reached",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-core/src/main/java/fr/sii/ogham/core/builder/retry/RetryBuilder.java#L83-L88 | train | Returns a builder that will use a fixed delay for the retry. | Of course, here is the Java code you requested:
```java
public FixedDelayBuilder<RetryBuilder<P>> fixedDelay() {
if (fixedDelay == null) {
fixedDelay = new FixedDelayBuilder<>(this, environmentBuilder);
}
return fixedDelay;
}
```
Hope this helps! |
alkacon/opencms-core | src/org/opencms/xml/content/CmsXmlContent.java | CmsXmlContent.synchronizeElement | private void synchronizeElement(
CmsObject cms,
String elementPath,
Collection<String> skipPaths,
Locale sourceLocale) {
if (elementPath.contains("/")) {
String parentPath = CmsXmlUtils.removeLastXpathElement(elementPath);
List<I_CmsXmlContentValue> paren... | java | private void synchronizeElement(
CmsObject cms,
String elementPath,
Collection<String> skipPaths,
Locale sourceLocale) {
if (elementPath.contains("/")) {
String parentPath = CmsXmlUtils.removeLastXpathElement(elementPath);
List<I_CmsXmlContentValue> paren... | [
"private",
"void",
"synchronizeElement",
"(",
"CmsObject",
"cms",
",",
"String",
"elementPath",
",",
"Collection",
"<",
"String",
">",
"skipPaths",
",",
"Locale",
"sourceLocale",
")",
"{",
"if",
"(",
"elementPath",
".",
"contains",
"(",
"\"/\"",
")",
")",
"{... | Synchronizes the values for the given element path.<p>
@param cms the cms context
@param elementPath the element path
@param skipPaths the paths to skip
@param sourceLocale the source locale | [
"Synchronizes",
"the",
"values",
"for",
"the",
"given",
"element",
"path",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsXmlContent.java#L1163-L1219 | train | Synchronizes the element with the content. | Of course, here is the Java code you requested:
```java
private void synchronizeElement(
CmsObject cms,
String elementPath,
Collection<String> skipPaths,
Locale sourceLocale) {
if (elementPath.contains("/")) {
String parentPath = CmsXmlUtils.removeLastXpathElement(e... |
skuzzle/jeve | jeve/src/main/java/de/skuzzle/jeve/Event.java | Event.getValueAs | public <E> Optional<E> getValueAs(String key, Class<E> type) {
if (this.properties == null) {
return Optional.empty();
}
return Optional.ofNullable(type.cast(getProperties().get(key)));
} | java | public <E> Optional<E> getValueAs(String key, Class<E> type) {
if (this.properties == null) {
return Optional.empty();
}
return Optional.ofNullable(type.cast(getProperties().get(key)));
} | [
"public",
"<",
"E",
">",
"Optional",
"<",
"E",
">",
"getValueAs",
"(",
"String",
"key",
",",
"Class",
"<",
"E",
">",
"type",
")",
"{",
"if",
"(",
"this",
".",
"properties",
"==",
"null",
")",
"{",
"return",
"Optional",
".",
"empty",
"(",
")",
";"... | Returns a value that has been stored using
{@link #setValue(String, Object)}. The value will be casted to the given
type.
@param <E> Type of the resulting value.
@param key The key of the value to retrieve.
@param type The type that the value will be casted to.
@return The value or an empty optional if the value does ... | [
"Returns",
"a",
"value",
"that",
"has",
"been",
"stored",
"using",
"{",
"@link",
"#setValue",
"(",
"String",
"Object",
")",
"}",
".",
"The",
"value",
"will",
"be",
"casted",
"to",
"the",
"given",
"type",
"."
] | 42cc18947c9c8596c34410336e4e375e9fcd7c47 | https://github.com/skuzzle/jeve/blob/42cc18947c9c8596c34410336e4e375e9fcd7c47/jeve/src/main/java/de/skuzzle/jeve/Event.java#L139-L144 | train | Gets the value as Optional. | Of course, here is the Java code you requested:
```java
public <E> Optional<E> getValueAs(String key, Class<E> type) {
if (this.properties == null) {
return Optional.empty();
}
return Optional.ofNullable(type.cast(getProperties().get(key)));
}
```
Hope this helps! |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.