repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.installFeature | public void installFeature(Collection<String> featureIds, File fromDir, String toExtension, boolean acceptLicense, boolean offlineOnly) throws InstallException {
"""
Installs the features found in the inputed featureIds collection
@param featureIds the feature ids
@param fromDir where the features are located
... | java | public void installFeature(Collection<String> featureIds, File fromDir, String toExtension, boolean acceptLicense, boolean offlineOnly) throws InstallException {
//fireProgressEvent(InstallProgressEvent.CHECK, 1, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_CHECKING"));
this.installAssets = new... | [
"public",
"void",
"installFeature",
"(",
"Collection",
"<",
"String",
">",
"featureIds",
",",
"File",
"fromDir",
",",
"String",
"toExtension",
",",
"boolean",
"acceptLicense",
",",
"boolean",
"offlineOnly",
")",
"throws",
"InstallException",
"{",
"//fireProgressEven... | Installs the features found in the inputed featureIds collection
@param featureIds the feature ids
@param fromDir where the features are located
@param toExtension location of a product extension
@param acceptLicense if license is accepted
@param offlineOnly if features should be installed from local source only
@thro... | [
"Installs",
"the",
"features",
"found",
"in",
"the",
"inputed",
"featureIds",
"collection"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L421-L439 |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/FastaWriterHelper.java | FastaWriterHelper.writeGeneSequence | public static void writeGeneSequence(File file, Collection<GeneSequence> geneSequences,boolean showExonUppercase) throws Exception {
"""
Write a collection of GeneSequences to a file where if the gene is negative strand it will flip and complement the sequence
@param file
@param geneSequences
@throws Exception
... | java | public static void writeGeneSequence(File file, Collection<GeneSequence> geneSequences,boolean showExonUppercase) throws Exception {
FileOutputStream outputStream = new FileOutputStream(file);
BufferedOutputStream bo = new BufferedOutputStream(outputStream);
writeGeneSequence(bo, geneSequences,showExonUppercase);... | [
"public",
"static",
"void",
"writeGeneSequence",
"(",
"File",
"file",
",",
"Collection",
"<",
"GeneSequence",
">",
"geneSequences",
",",
"boolean",
"showExonUppercase",
")",
"throws",
"Exception",
"{",
"FileOutputStream",
"outputStream",
"=",
"new",
"FileOutputStream"... | Write a collection of GeneSequences to a file where if the gene is negative strand it will flip and complement the sequence
@param file
@param geneSequences
@throws Exception | [
"Write",
"a",
"collection",
"of",
"GeneSequences",
"to",
"a",
"file",
"where",
"if",
"the",
"gene",
"is",
"negative",
"strand",
"it",
"will",
"flip",
"and",
"complement",
"the",
"sequence"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/FastaWriterHelper.java#L88-L94 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/utils/ZipUtil.java | ZipUtil.extractZip | public static void extractZip(final String path, final File dest, final String prefix, final renamer rename,
final streamCopier copier) throws IOException {
"""
Extract the zip file to the destination, optionally only the matching files and renaming the files
@param path zip ... | java | public static void extractZip(final String path, final File dest, final String prefix, final renamer rename,
final streamCopier copier) throws IOException {
FilenameFilter filter = null;
if (null != prefix) {
filter = new FilenameFilter() {
p... | [
"public",
"static",
"void",
"extractZip",
"(",
"final",
"String",
"path",
",",
"final",
"File",
"dest",
",",
"final",
"String",
"prefix",
",",
"final",
"renamer",
"rename",
",",
"final",
"streamCopier",
"copier",
")",
"throws",
"IOException",
"{",
"FilenameFil... | Extract the zip file to the destination, optionally only the matching files and renaming the files
@param path zip file path
@param dest destination directory to contain files
@param prefix match files within the zip if they have this prefix path, or null selects all files
@param rename renamer instance
@param cop... | [
"Extract",
"the",
"zip",
"file",
"to",
"the",
"destination",
"optionally",
"only",
"the",
"matching",
"files",
"and",
"renaming",
"the",
"files"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/utils/ZipUtil.java#L124-L136 |
square/mortar | mortar-sample/src/main/java/com/example/mortar/screen/Layouts.java | Layouts.createView | public static android.view.View createView(Context context, Object screen) {
"""
Create an instance of the view specified in a {@link Layout} annotation.
"""
return createView(context, screen.getClass());
} | java | public static android.view.View createView(Context context, Object screen) {
return createView(context, screen.getClass());
} | [
"public",
"static",
"android",
".",
"view",
".",
"View",
"createView",
"(",
"Context",
"context",
",",
"Object",
"screen",
")",
"{",
"return",
"createView",
"(",
"context",
",",
"screen",
".",
"getClass",
"(",
")",
")",
";",
"}"
] | Create an instance of the view specified in a {@link Layout} annotation. | [
"Create",
"an",
"instance",
"of",
"the",
"view",
"specified",
"in",
"a",
"{"
] | train | https://github.com/square/mortar/blob/c968b99eb96ba56c47e29912c07841be8e2cf97a/mortar-sample/src/main/java/com/example/mortar/screen/Layouts.java#L24-L26 |
davidmoten/geo | geo-mem/src/main/java/com/github/davidmoten/geo/mem/Geomem.java | Geomem.createRegionFilter | @VisibleForTesting
Predicate<Info<T, R>> createRegionFilter(final double topLeftLat, final double topLeftLon,
final double bottomRightLat, final double bottomRightLon) {
"""
Returns a {@link Predicate} that returns true if and only if a point is
within the bounding box, exclusive of the top (north... | java | @VisibleForTesting
Predicate<Info<T, R>> createRegionFilter(final double topLeftLat, final double topLeftLon,
final double bottomRightLat, final double bottomRightLon) {
return new Predicate<Info<T, R>>() {
@Override
public boolean apply(Info<T, R> info) {
... | [
"@",
"VisibleForTesting",
"Predicate",
"<",
"Info",
"<",
"T",
",",
"R",
">",
">",
"createRegionFilter",
"(",
"final",
"double",
"topLeftLat",
",",
"final",
"double",
"topLeftLon",
",",
"final",
"double",
"bottomRightLat",
",",
"final",
"double",
"bottomRightLon"... | Returns a {@link Predicate} that returns true if and only if a point is
within the bounding box, exclusive of the top (north) and left (west)
edges.
@param topLeftLat
latitude of top left point (north west)
@param topLeftLon
longitude of top left point (north west)
@param bottomRightLat
latitude of bottom right point ... | [
"Returns",
"a",
"{",
"@link",
"Predicate",
"}",
"that",
"returns",
"true",
"if",
"and",
"only",
"if",
"a",
"point",
"is",
"within",
"the",
"bounding",
"box",
"exclusive",
"of",
"the",
"top",
"(",
"north",
")",
"and",
"left",
"(",
"west",
")",
"edges",
... | train | https://github.com/davidmoten/geo/blob/e90d2f406133cd9b60d54a3e6bdb7423d7fcce37/geo-mem/src/main/java/com/github/davidmoten/geo/mem/Geomem.java#L119-L130 |
phxql/argon2-jvm | src/main/java/de/mkammerer/argon2/Argon2Factory.java | Argon2Factory.createAdvanced | public static Argon2Advanced createAdvanced(Argon2Types type) {
"""
Creates a new {@link Argon2Advanced} instance with the given type.
@param type Argon2 type.
@return Argon2Advanced instance.
"""
return createInternal(type, Argon2Constants.DEFAULT_SALT_LENGTH, Argon2Constants.DEFAULT_HASH_LENGTH);... | java | public static Argon2Advanced createAdvanced(Argon2Types type) {
return createInternal(type, Argon2Constants.DEFAULT_SALT_LENGTH, Argon2Constants.DEFAULT_HASH_LENGTH);
} | [
"public",
"static",
"Argon2Advanced",
"createAdvanced",
"(",
"Argon2Types",
"type",
")",
"{",
"return",
"createInternal",
"(",
"type",
",",
"Argon2Constants",
".",
"DEFAULT_SALT_LENGTH",
",",
"Argon2Constants",
".",
"DEFAULT_HASH_LENGTH",
")",
";",
"}"
] | Creates a new {@link Argon2Advanced} instance with the given type.
@param type Argon2 type.
@return Argon2Advanced instance. | [
"Creates",
"a",
"new",
"{",
"@link",
"Argon2Advanced",
"}",
"instance",
"with",
"the",
"given",
"type",
"."
] | train | https://github.com/phxql/argon2-jvm/blob/27a13907729e67e98cca53eba279e109b60f04f1/src/main/java/de/mkammerer/argon2/Argon2Factory.java#L71-L73 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/CharsetMatch.java | CharsetMatch.getReader | public Reader getReader() {
"""
Create a java.io.Reader for reading the Unicode character data corresponding
to the original byte data supplied to the Charset detect operation.
<p>
CAUTION: if the source of the byte data was an InputStream, a Reader
can be created for only one matching char set using this met... | java | public Reader getReader() {
InputStream inputStream = fInputStream;
if (inputStream == null) {
inputStream = new ByteArrayInputStream(fRawInput, 0, fRawLength);
}
try {
inputStream.reset();
return new InputStreamReader(inputStream, getName());
... | [
"public",
"Reader",
"getReader",
"(",
")",
"{",
"InputStream",
"inputStream",
"=",
"fInputStream",
";",
"if",
"(",
"inputStream",
"==",
"null",
")",
"{",
"inputStream",
"=",
"new",
"ByteArrayInputStream",
"(",
"fRawInput",
",",
"0",
",",
"fRawLength",
")",
"... | Create a java.io.Reader for reading the Unicode character data corresponding
to the original byte data supplied to the Charset detect operation.
<p>
CAUTION: if the source of the byte data was an InputStream, a Reader
can be created for only one matching char set using this method. If more
than one charset needs to b... | [
"Create",
"a",
"java",
".",
"io",
".",
"Reader",
"for",
"reading",
"the",
"Unicode",
"character",
"data",
"corresponding",
"to",
"the",
"original",
"byte",
"data",
"supplied",
"to",
"the",
"Charset",
"detect",
"operation",
".",
"<p",
">",
"CAUTION",
":",
"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/CharsetMatch.java#L46-L59 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/media/MediaClient.java | MediaClient.createJob | @Deprecated
public CreateJobResponse createJob(String pipelineName, String sourceKey, String targetKey, String presetName) {
"""
Creates a new transcoder job which converts media files in BOS buckets with specified preset.
@param pipelineName The name of pipeline used by this job.
@param sourceKey The k... | java | @Deprecated
public CreateJobResponse createJob(String pipelineName, String sourceKey, String targetKey, String presetName) {
CreateJobRequest request = new CreateJobRequest();
request.setPipelineName(pipelineName);
Source source = new Source();
source.setSourceKey(sourceKey);
... | [
"@",
"Deprecated",
"public",
"CreateJobResponse",
"createJob",
"(",
"String",
"pipelineName",
",",
"String",
"sourceKey",
",",
"String",
"targetKey",
",",
"String",
"presetName",
")",
"{",
"CreateJobRequest",
"request",
"=",
"new",
"CreateJobRequest",
"(",
")",
";... | Creates a new transcoder job which converts media files in BOS buckets with specified preset.
@param pipelineName The name of pipeline used by this job.
@param sourceKey The key of the source media file in the bucket specified in the pipeline.
@param targetKey The key of the target media file in the bucket speci... | [
"Creates",
"a",
"new",
"transcoder",
"job",
"which",
"converts",
"media",
"files",
"in",
"BOS",
"buckets",
"with",
"specified",
"preset",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/media/MediaClient.java#L182-L195 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java | JDBCStorageConnection.getItemByIdentifier | protected ItemData getItemByIdentifier(String cid) throws RepositoryException, IllegalStateException {
"""
Get Item By Identifier.
@param cid
Item id (container internal)
@return ItemData
@throws RepositoryException
Repository error
@throws IllegalStateException
if connection is closed
"""
check... | java | protected ItemData getItemByIdentifier(String cid) throws RepositoryException, IllegalStateException
{
checkIfOpened();
try
{
ResultSet item = findItemByIdentifier(cid);
try
{
if (item.next())
{
return itemData(null, item, item.getIn... | [
"protected",
"ItemData",
"getItemByIdentifier",
"(",
"String",
"cid",
")",
"throws",
"RepositoryException",
",",
"IllegalStateException",
"{",
"checkIfOpened",
"(",
")",
";",
"try",
"{",
"ResultSet",
"item",
"=",
"findItemByIdentifier",
"(",
"cid",
")",
";",
"try"... | Get Item By Identifier.
@param cid
Item id (container internal)
@return ItemData
@throws RepositoryException
Repository error
@throws IllegalStateException
if connection is closed | [
"Get",
"Item",
"By",
"Identifier",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java#L1687-L1721 |
jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.readPrimitiveField | public static Object readPrimitiveField(CodedInputStream input, final WireFormat.FieldType type, boolean checkUtf8)
throws IOException {
"""
Read a field of any primitive type for immutable messages from a CodedInputStream. Enums, groups, and embedded
messages are not handled by this method.
@para... | java | public static Object readPrimitiveField(CodedInputStream input, final WireFormat.FieldType type, boolean checkUtf8)
throws IOException {
switch (type) {
case DOUBLE:
return input.readDouble();
case FLOAT:
return input.readFloat();
... | [
"public",
"static",
"Object",
"readPrimitiveField",
"(",
"CodedInputStream",
"input",
",",
"final",
"WireFormat",
".",
"FieldType",
"type",
",",
"boolean",
"checkUtf8",
")",
"throws",
"IOException",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"DOUBLE",
":",
... | Read a field of any primitive type for immutable messages from a CodedInputStream. Enums, groups, and embedded
messages are not handled by this method.
@param input The stream from which to read.
@param type Declared type of the field.
@param checkUtf8 When true, check that the input is valid utf8.
@return An object r... | [
"Read",
"a",
"field",
"of",
"any",
"primitive",
"type",
"for",
"immutable",
"messages",
"from",
"a",
"CodedInputStream",
".",
"Enums",
"groups",
"and",
"embedded",
"messages",
"are",
"not",
"handled",
"by",
"this",
"method",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L1104-L1153 |
elki-project/elki | elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/FastMultidimensionalScalingTransform.java | FastMultidimensionalScalingTransform.updateEigenvector | protected double updateEigenvector(double[] in, double[] out, double l) {
"""
Compute the change in the eigenvector, and normalize the output vector
while doing so.
@param in Input vector
@param out Output vector
@param l Eigenvalue
@return Change
"""
double s = 1. / (l > 0. ? l : l < 0. ? -l : 1.);... | java | protected double updateEigenvector(double[] in, double[] out, double l) {
double s = 1. / (l > 0. ? l : l < 0. ? -l : 1.);
s = (in[0] > 0.) ? s : -s; // Reduce flipping vectors
double diff = 0.;
for(int d = 0; d < in.length; d++) {
in[d] *= s; // Scale to unit length
// Compute change from p... | [
"protected",
"double",
"updateEigenvector",
"(",
"double",
"[",
"]",
"in",
",",
"double",
"[",
"]",
"out",
",",
"double",
"l",
")",
"{",
"double",
"s",
"=",
"1.",
"/",
"(",
"l",
">",
"0.",
"?",
"l",
":",
"l",
"<",
"0.",
"?",
"-",
"l",
":",
"1... | Compute the change in the eigenvector, and normalize the output vector
while doing so.
@param in Input vector
@param out Output vector
@param l Eigenvalue
@return Change | [
"Compute",
"the",
"change",
"in",
"the",
"eigenvector",
"and",
"normalize",
"the",
"output",
"vector",
"while",
"doing",
"so",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/FastMultidimensionalScalingTransform.java#L260-L272 |
TheHortonMachine/hortonmachine | gui/src/main/java/org/hortonmachine/gui/spatialtoolbox/core/ParametersPanel.java | ParametersPanel.isAtLeastOneAssignable | private boolean isAtLeastOneAssignable( String main, Class< ? >... classes ) {
"""
Checks if one class is assignable from at least one of the others.
@param main the canonical name of class to check.
@param classes the other classes.
@return true if at least one of the other classes match.
"""
for... | java | private boolean isAtLeastOneAssignable( String main, Class< ? >... classes ) {
for( Class< ? > clazz : classes ) {
if (clazz.getCanonicalName().equals(main)) {
return true;
}
}
return false;
} | [
"private",
"boolean",
"isAtLeastOneAssignable",
"(",
"String",
"main",
",",
"Class",
"<",
"?",
">",
"...",
"classes",
")",
"{",
"for",
"(",
"Class",
"<",
"?",
">",
"clazz",
":",
"classes",
")",
"{",
"if",
"(",
"clazz",
".",
"getCanonicalName",
"(",
")"... | Checks if one class is assignable from at least one of the others.
@param main the canonical name of class to check.
@param classes the other classes.
@return true if at least one of the other classes match. | [
"Checks",
"if",
"one",
"class",
"is",
"assignable",
"from",
"at",
"least",
"one",
"of",
"the",
"others",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gui/src/main/java/org/hortonmachine/gui/spatialtoolbox/core/ParametersPanel.java#L548-L555 |
cdk/cdk | tool/tautomer/src/main/java/org/openscience/cdk/tautomers/InChITautomerGenerator.java | InChITautomerGenerator.getTautomers | @Deprecated
public List<IAtomContainer> getTautomers(IAtomContainer mol, String inchi) throws CDKException, CloneNotSupportedException {
"""
This method is slower than recalculating the InChI with {@link #getTautomers(IAtomContainer)} as the mapping
between the two can be found more efficiently.
@param mol... | java | @Deprecated
public List<IAtomContainer> getTautomers(IAtomContainer mol, String inchi) throws CDKException, CloneNotSupportedException {
return getTautomers(mol, inchi, null);
} | [
"@",
"Deprecated",
"public",
"List",
"<",
"IAtomContainer",
">",
"getTautomers",
"(",
"IAtomContainer",
"mol",
",",
"String",
"inchi",
")",
"throws",
"CDKException",
",",
"CloneNotSupportedException",
"{",
"return",
"getTautomers",
"(",
"mol",
",",
"inchi",
",",
... | This method is slower than recalculating the InChI with {@link #getTautomers(IAtomContainer)} as the mapping
between the two can be found more efficiently.
@param mol
@param inchi
@return
@throws CDKException
@throws CloneNotSupportedException
@deprecated use {@link #getTautomers(IAtomContainer)} directly | [
"This",
"method",
"is",
"slower",
"than",
"recalculating",
"the",
"InChI",
"with",
"{",
"@link",
"#getTautomers",
"(",
"IAtomContainer",
")",
"}",
"as",
"the",
"mapping",
"between",
"the",
"two",
"can",
"be",
"found",
"more",
"efficiently",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/tautomer/src/main/java/org/openscience/cdk/tautomers/InChITautomerGenerator.java#L134-L137 |
mbeiter/util | db/src/main/java/org/beiter/michael/db/DataSourceFactory.java | DataSourceFactory.getPoolingDataSource | private static PoolingDataSource<PoolableConnection> getPoolingDataSource(final String url,
final ConcurrentMap<String, String> properties,
final ConnectionProperti... | java | private static PoolingDataSource<PoolableConnection> getPoolingDataSource(final String url,
final ConcurrentMap<String, String> properties,
final ConnectionProperti... | [
"private",
"static",
"PoolingDataSource",
"<",
"PoolableConnection",
">",
"getPoolingDataSource",
"(",
"final",
"String",
"url",
",",
"final",
"ConcurrentMap",
"<",
"String",
",",
"String",
">",
"properties",
",",
"final",
"ConnectionProperties",
"poolSpec",
")",
"{... | Get a pooled data source for the provided connection parameters.
@param url The JDBC database URL of the form <code>jdbc:subprotocol:subname</code>
@param properties A list of key/value configuration parameters to pass as connection arguments. Normally at
least a "user" and "password" property should be include... | [
"Get",
"a",
"pooled",
"data",
"source",
"for",
"the",
"provided",
"connection",
"parameters",
"."
] | train | https://github.com/mbeiter/util/blob/490fcebecb936e00c2f2ce2096b679b2fd10865e/db/src/main/java/org/beiter/michael/db/DataSourceFactory.java#L237-L283 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/interceptor/action/ActionInterceptor.java | ActionInterceptor.preInvoke | public void preInvoke( InterceptorContext context, InterceptorChain chain ) throws InterceptorException {
"""
Callback invoked before the action is processed. {@link #preAction} may be used instead.
"""
preAction( ( ActionInterceptorContext ) context, chain );
} | java | public void preInvoke( InterceptorContext context, InterceptorChain chain ) throws InterceptorException
{
preAction( ( ActionInterceptorContext ) context, chain );
} | [
"public",
"void",
"preInvoke",
"(",
"InterceptorContext",
"context",
",",
"InterceptorChain",
"chain",
")",
"throws",
"InterceptorException",
"{",
"preAction",
"(",
"(",
"ActionInterceptorContext",
")",
"context",
",",
"chain",
")",
";",
"}"
] | Callback invoked before the action is processed. {@link #preAction} may be used instead. | [
"Callback",
"invoked",
"before",
"the",
"action",
"is",
"processed",
".",
"{"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/interceptor/action/ActionInterceptor.java#L92-L95 |
h2oai/h2o-3 | h2o-core/src/main/java/jsr166y/ForkJoinTask.java | ForkJoinTask.invokeAll | public static void invokeAll(ForkJoinTask<?> t1, ForkJoinTask<?> t2) {
"""
Forks the given tasks, returning when {@code isDone} holds for
each task or an (unchecked) exception is encountered, in which
case the exception is rethrown. If more than one task
encounters an exception, then this method throws any one ... | java | public static void invokeAll(ForkJoinTask<?> t1, ForkJoinTask<?> t2) {
int s1, s2;
t2.fork();
if ((s1 = t1.doInvoke() & DONE_MASK) != NORMAL)
t1.reportException(s1);
if ((s2 = t2.doJoin() & DONE_MASK) != NORMAL)
t2.reportException(s2);
} | [
"public",
"static",
"void",
"invokeAll",
"(",
"ForkJoinTask",
"<",
"?",
">",
"t1",
",",
"ForkJoinTask",
"<",
"?",
">",
"t2",
")",
"{",
"int",
"s1",
",",
"s2",
";",
"t2",
".",
"fork",
"(",
")",
";",
"if",
"(",
"(",
"s1",
"=",
"t1",
".",
"doInvok... | Forks the given tasks, returning when {@code isDone} holds for
each task or an (unchecked) exception is encountered, in which
case the exception is rethrown. If more than one task
encounters an exception, then this method throws any one of
these exceptions. If any task encounters an exception, the
other may be cancelle... | [
"Forks",
"the",
"given",
"tasks",
"returning",
"when",
"{",
"@code",
"isDone",
"}",
"holds",
"for",
"each",
"task",
"or",
"an",
"(",
"unchecked",
")",
"exception",
"is",
"encountered",
"in",
"which",
"case",
"the",
"exception",
"is",
"rethrown",
".",
"If",... | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/ForkJoinTask.java#L700-L707 |
windup/windup | rules-java-ee/addon/src/main/java/org/jboss/windup/rules/apps/javaee/service/JNDIResourceService.java | JNDIResourceService.createUnique | public synchronized JNDIResourceModel createUnique(Set<ProjectModel> applications, String jndiName) {
"""
Create unique; if existing convert an existing {@link JNDIResourceModel} if one exists.
"""
JNDIResourceModel jndiResourceModel = getUniqueByProperty(JNDIResourceModel.JNDI_LOCATION, jndiName);
... | java | public synchronized JNDIResourceModel createUnique(Set<ProjectModel> applications, String jndiName)
{
JNDIResourceModel jndiResourceModel = getUniqueByProperty(JNDIResourceModel.JNDI_LOCATION, jndiName);
if (jndiResourceModel == null)
{
jndiResourceModel = super.create();
... | [
"public",
"synchronized",
"JNDIResourceModel",
"createUnique",
"(",
"Set",
"<",
"ProjectModel",
">",
"applications",
",",
"String",
"jndiName",
")",
"{",
"JNDIResourceModel",
"jndiResourceModel",
"=",
"getUniqueByProperty",
"(",
"JNDIResourceModel",
".",
"JNDI_LOCATION",
... | Create unique; if existing convert an existing {@link JNDIResourceModel} if one exists. | [
"Create",
"unique",
";",
"if",
"existing",
"convert",
"an",
"existing",
"{"
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-java-ee/addon/src/main/java/org/jboss/windup/rules/apps/javaee/service/JNDIResourceService.java#L31-L49 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/event/EventNotificationUrl.java | EventNotificationUrl.getEventsUrl | public static MozuUrl getEventsUrl(String filter, Integer pageSize, String responseFields, String sortBy, Integer startIndex) {
"""
Get Resource Url for GetEvents
@param filter A set of filter expressions representing the search parameters for a query. This parameter is optional. Refer to [Sorting and Filtering](... | java | public static MozuUrl getEventsUrl(String filter, Integer pageSize, String responseFields, String sortBy, Integer startIndex)
{
UrlFormatter formatter = new UrlFormatter("/api/event/pull/?startIndex={startIndex}&pageSize={pageSize}&sortBy={sortBy}&filter={filter}&responseFields={responseFields}");
formatter.for... | [
"public",
"static",
"MozuUrl",
"getEventsUrl",
"(",
"String",
"filter",
",",
"Integer",
"pageSize",
",",
"String",
"responseFields",
",",
"String",
"sortBy",
",",
"Integer",
"startIndex",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\... | Get Resource Url for GetEvents
@param filter A set of filter expressions representing the search parameters for a query. This parameter is optional. Refer to [Sorting and Filtering](../../../../Developer/api-guides/sorting-filtering.htm) for a list of supported filters.
@param pageSize When creating paged results from ... | [
"Get",
"Resource",
"Url",
"for",
"GetEvents"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/event/EventNotificationUrl.java#L25-L34 |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/annotations/Annotations.java | Annotations.processActivation | private InboundResourceAdapter processActivation(AnnotationRepository annotationRepository, ClassLoader classLoader,
ArrayList<ConfigProperty> configProperties,
ArrayList<ConfigProperty> plainConfigProperties)
... | java | private InboundResourceAdapter processActivation(AnnotationRepository annotationRepository, ClassLoader classLoader,
ArrayList<ConfigProperty> configProperties,
ArrayList<ConfigProperty> plainConfigProperties)
... | [
"private",
"InboundResourceAdapter",
"processActivation",
"(",
"AnnotationRepository",
"annotationRepository",
",",
"ClassLoader",
"classLoader",
",",
"ArrayList",
"<",
"ConfigProperty",
">",
"configProperties",
",",
"ArrayList",
"<",
"ConfigProperty",
">",
"plainConfigProper... | Process: @Activation
@param annotationRepository The annotation repository
@param classLoader The class loader
@param configProperties The config properties
@param plainConfigProperties The plain config properties
@return The updated metadata
@exception Exception Thrown if an error occurs | [
"Process",
":"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/annotations/Annotations.java#L1034-L1051 |
apache/spark | common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalShuffleBlockResolver.java | ExternalShuffleBlockResolver.deleteNonShuffleFiles | private void deleteNonShuffleFiles(String[] dirs) {
"""
Synchronously deletes non-shuffle files in each directory recursively.
Should be executed in its own thread, as this may take a long time.
"""
FilenameFilter filter = new FilenameFilter() {
@Override
public boolean accept(File dir, String... | java | private void deleteNonShuffleFiles(String[] dirs) {
FilenameFilter filter = new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
// Don't delete shuffle data or shuffle index files.
return !name.endsWith(".index") && !name.endsWith(".data");
}
};
... | [
"private",
"void",
"deleteNonShuffleFiles",
"(",
"String",
"[",
"]",
"dirs",
")",
"{",
"FilenameFilter",
"filter",
"=",
"new",
"FilenameFilter",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"accept",
"(",
"File",
"dir",
",",
"String",
"name",
")",
... | Synchronously deletes non-shuffle files in each directory recursively.
Should be executed in its own thread, as this may take a long time. | [
"Synchronously",
"deletes",
"non",
"-",
"shuffle",
"files",
"in",
"each",
"directory",
"recursively",
".",
"Should",
"be",
"executed",
"in",
"its",
"own",
"thread",
"as",
"this",
"may",
"take",
"a",
"long",
"time",
"."
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalShuffleBlockResolver.java#L258-L275 |
s1-platform/s1 | s1-core/src/java/org/s1/weboperation/UploadWebOperation.java | UploadWebOperation.downloadAsFile | @WebOperationMethod
public Map<String,Object> downloadAsFile(Map<String, Object> params, HttpServletRequest request, HttpServletResponse response) throws Exception {
"""
Download file from storage with content-disposition
@param params {group:"...default is GROUP...", id:"...", name:"...default will be ta... | java | @WebOperationMethod
public Map<String,Object> downloadAsFile(Map<String, Object> params, HttpServletRequest request, HttpServletResponse response) throws Exception {
String database = Objects.get(params, "database");
String collection = Objects.get(params, "collection", COLLECTION);
String i... | [
"@",
"WebOperationMethod",
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"downloadAsFile",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"Exception",
"{... | Download file from storage with content-disposition
@param params {group:"...default is GROUP...", id:"...", name:"...default will be taken from FileMetaBean.name ..."}
@param response | [
"Download",
"file",
"from",
"storage",
"with",
"content",
"-",
"disposition"
] | train | https://github.com/s1-platform/s1/blob/370101c13fef01af524bc171bcc1a97e5acc76e8/s1-core/src/java/org/s1/weboperation/UploadWebOperation.java#L176-L206 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/OrientedBox3f.java | OrientedBox3f.setSecondAxis | @Override
public void setSecondAxis(double x, double y, double z) {
"""
Set the second axis of the box.
The third axis is updated to be perpendicular to the two other axis.
@param x - the new values for the second axis.
@param y - the new values for the second axis.
@param z - the new values for the second ... | java | @Override
public void setSecondAxis(double x, double y, double z) {
setSecondAxis(x, y, z, getSecondAxisExtent());
} | [
"@",
"Override",
"public",
"void",
"setSecondAxis",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
")",
"{",
"setSecondAxis",
"(",
"x",
",",
"y",
",",
"z",
",",
"getSecondAxisExtent",
"(",
")",
")",
";",
"}"
] | Set the second axis of the box.
The third axis is updated to be perpendicular to the two other axis.
@param x - the new values for the second axis.
@param y - the new values for the second axis.
@param z - the new values for the second axis. | [
"Set",
"the",
"second",
"axis",
"of",
"the",
"box",
".",
"The",
"third",
"axis",
"is",
"updated",
"to",
"be",
"perpendicular",
"to",
"the",
"two",
"other",
"axis",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/OrientedBox3f.java#L493-L496 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java | MultiIndex.createIndex | private void createIndex(final Queue<Callable<Void>> tasks, final NodeDataIndexingIterator iterator,
final NodeData rootNode, final AtomicLong count, final AtomicLong processing) throws IOException,
RepositoryException, InterruptedException {
"""
Creates an index.
@param tasks
the queue of existing... | java | private void createIndex(final Queue<Callable<Void>> tasks, final NodeDataIndexingIterator iterator,
final NodeData rootNode, final AtomicLong count, final AtomicLong processing) throws IOException,
RepositoryException, InterruptedException
{
while (iterator.hasNext())
{
Callable<Vo... | [
"private",
"void",
"createIndex",
"(",
"final",
"Queue",
"<",
"Callable",
"<",
"Void",
">",
">",
"tasks",
",",
"final",
"NodeDataIndexingIterator",
"iterator",
",",
"final",
"NodeData",
"rootNode",
",",
"final",
"AtomicLong",
"count",
",",
"final",
"AtomicLong",... | Creates an index.
@param tasks
the queue of existing indexing tasks
@param rootNode
the root node of the index
@param iterator
the NodeDataIndexing iterator
@param count
the number of nodes already indexed.
@throws IOException
if an error occurs while writing to the index.
@throws RepositoryException
if any other erro... | [
"Creates",
"an",
"index",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java#L2199-L2221 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/util/PersistentLongFile.java | PersistentLongFile.writeFile | public static void writeFile(File file, long val) throws IOException {
"""
Atomically write the given value to the given file, including fsyncing.
@param file destination file
@param val value to write
@throws IOException if the file cannot be written
"""
AtomicFileOutputStream fos = new AtomicFileOut... | java | public static void writeFile(File file, long val) throws IOException {
AtomicFileOutputStream fos = new AtomicFileOutputStream(file);
try {
fos.write(String.valueOf(val).getBytes(Charsets.UTF_8));
fos.write('\n');
fos.close();
fos = null;
} finally {
if (fos != null) {
... | [
"public",
"static",
"void",
"writeFile",
"(",
"File",
"file",
",",
"long",
"val",
")",
"throws",
"IOException",
"{",
"AtomicFileOutputStream",
"fos",
"=",
"new",
"AtomicFileOutputStream",
"(",
"file",
")",
";",
"try",
"{",
"fos",
".",
"write",
"(",
"String",... | Atomically write the given value to the given file, including fsyncing.
@param file destination file
@param val value to write
@throws IOException if the file cannot be written | [
"Atomically",
"write",
"the",
"given",
"value",
"to",
"the",
"given",
"file",
"including",
"fsyncing",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/util/PersistentLongFile.java#L77-L89 |
aoindustries/semanticcms-core-model | src/main/java/com/semanticcms/core/model/PageRef.java | PageRef.setPath | public PageRef setPath(Path newPath) {
"""
Sets the path.
@return this object if path unchanged or a new object representing the new path
"""
if(newPath.equals(path)) {
return this;
} else {
return new PageRef(bookRef, newPath);
}
} | java | public PageRef setPath(Path newPath) {
if(newPath.equals(path)) {
return this;
} else {
return new PageRef(bookRef, newPath);
}
} | [
"public",
"PageRef",
"setPath",
"(",
"Path",
"newPath",
")",
"{",
"if",
"(",
"newPath",
".",
"equals",
"(",
"path",
")",
")",
"{",
"return",
"this",
";",
"}",
"else",
"{",
"return",
"new",
"PageRef",
"(",
"bookRef",
",",
"newPath",
")",
";",
"}",
"... | Sets the path.
@return this object if path unchanged or a new object representing the new path | [
"Sets",
"the",
"path",
"."
] | train | https://github.com/aoindustries/semanticcms-core-model/blob/14bdbe3f3d69b2b337129c5b1afcaa9e87cb5624/src/main/java/com/semanticcms/core/model/PageRef.java#L79-L85 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.accessRestriction_u2f_POST | public OvhU2FRegisterChallenge accessRestriction_u2f_POST() throws IOException {
"""
Add a U2F access restriction
REST: POST /me/accessRestriction/u2f
"""
String qPath = "/me/accessRestriction/u2f";
StringBuilder sb = path(qPath);
String resp = exec(qPath, "POST", sb.toString(), null);
return conver... | java | public OvhU2FRegisterChallenge accessRestriction_u2f_POST() throws IOException {
String qPath = "/me/accessRestriction/u2f";
StringBuilder sb = path(qPath);
String resp = exec(qPath, "POST", sb.toString(), null);
return convertTo(resp, OvhU2FRegisterChallenge.class);
} | [
"public",
"OvhU2FRegisterChallenge",
"accessRestriction_u2f_POST",
"(",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/accessRestriction/u2f\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
"String",
"resp",
"=",
"exec",
"(",
... | Add a U2F access restriction
REST: POST /me/accessRestriction/u2f | [
"Add",
"a",
"U2F",
"access",
"restriction"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L4166-L4171 |
google/closure-compiler | src/com/google/javascript/jscomp/InlineSimpleMethods.java | InlineSimpleMethods.inlinePropertyReturn | private void inlinePropertyReturn(Node parent, Node call, Node returnedValue) {
"""
Replace the provided method call with the tree specified in returnedValue
Parse tree of a call is
name
call
getprop
obj
string
"""
Node getProp = returnedValue.cloneTree();
replaceThis(getProp, call.getFirstChil... | java | private void inlinePropertyReturn(Node parent, Node call, Node returnedValue) {
Node getProp = returnedValue.cloneTree();
replaceThis(getProp, call.getFirstChild().removeFirstChild());
parent.replaceChild(call, getProp);
compiler.reportChangeToEnclosingScope(getProp);
} | [
"private",
"void",
"inlinePropertyReturn",
"(",
"Node",
"parent",
",",
"Node",
"call",
",",
"Node",
"returnedValue",
")",
"{",
"Node",
"getProp",
"=",
"returnedValue",
".",
"cloneTree",
"(",
")",
";",
"replaceThis",
"(",
"getProp",
",",
"call",
".",
"getFirs... | Replace the provided method call with the tree specified in returnedValue
Parse tree of a call is
name
call
getprop
obj
string | [
"Replace",
"the",
"provided",
"method",
"call",
"with",
"the",
"tree",
"specified",
"in",
"returnedValue"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/InlineSimpleMethods.java#L220-L225 |
fabric8io/kubernetes-client | kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/OperationSupport.java | OperationSupport.handleReplace | protected <T> T handleReplace(T updated, Class<T> type) throws ExecutionException, InterruptedException, KubernetesClientException, IOException {
"""
Replace a resource.
@param updated updated object
@param type type of the object provided
@param <T> template argument provided
@return returns de-serialized... | java | protected <T> T handleReplace(T updated, Class<T> type) throws ExecutionException, InterruptedException, KubernetesClientException, IOException {
return handleReplace(updated, type, Collections.<String, String>emptyMap());
} | [
"protected",
"<",
"T",
">",
"T",
"handleReplace",
"(",
"T",
"updated",
",",
"Class",
"<",
"T",
">",
"type",
")",
"throws",
"ExecutionException",
",",
"InterruptedException",
",",
"KubernetesClientException",
",",
"IOException",
"{",
"return",
"handleReplace",
"(... | Replace a resource.
@param updated updated object
@param type type of the object provided
@param <T> template argument provided
@return returns de-serialized version of api server response
@throws ExecutionException Execution Exception
@throws InterruptedException Interrupted Exception
@throws KubernetesClientExcepti... | [
"Replace",
"a",
"resource",
"."
] | train | https://github.com/fabric8io/kubernetes-client/blob/141668a882ed8e902c045a5cd0a80f14bd17d132/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/OperationSupport.java#L251-L253 |
Azure/azure-sdk-for-java | streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/InputsInner.java | InputsInner.updateAsync | public Observable<InputInner> updateAsync(String resourceGroupName, String jobName, String inputName, InputInner input) {
"""
Updates an existing input under an existing streaming job. This can be used to partially update (ie. update one or two properties) an input without affecting the rest the job or input defin... | java | public Observable<InputInner> updateAsync(String resourceGroupName, String jobName, String inputName, InputInner input) {
return updateWithServiceResponseAsync(resourceGroupName, jobName, inputName, input).map(new Func1<ServiceResponseWithHeaders<InputInner, InputsUpdateHeaders>, InputInner>() {
@Ov... | [
"public",
"Observable",
"<",
"InputInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"jobName",
",",
"String",
"inputName",
",",
"InputInner",
"input",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Updates an existing input under an existing streaming job. This can be used to partially update (ie. update one or two properties) an input without affecting the rest the job or input definition.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azur... | [
"Updates",
"an",
"existing",
"input",
"under",
"an",
"existing",
"streaming",
"job",
".",
"This",
"can",
"be",
"used",
"to",
"partially",
"update",
"(",
"ie",
".",
"update",
"one",
"or",
"two",
"properties",
")",
"an",
"input",
"without",
"affecting",
"the... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/InputsInner.java#L351-L358 |
CenturyLinkCloud/mdw | mdw-services/src/com/centurylink/mdw/services/task/factory/TaskInstanceStrategyFactory.java | TaskInstanceStrategyFactory.getSubTaskStrategy | public static SubTaskStrategy getSubTaskStrategy(String attributeValue, Long processInstanceId) throws StrategyException {
"""
Returns a subtask strategy instance based on an attribute value and bundle spec
which can consist of either the subtask strategy logical name, or an xml document.
@param attributeValue
... | java | public static SubTaskStrategy getSubTaskStrategy(String attributeValue, Long processInstanceId) throws StrategyException {
Package packageVO = processInstanceId == null ? null : getPackage(processInstanceId);
TaskInstanceStrategyFactory factory = getInstance();
String className = factory.getStra... | [
"public",
"static",
"SubTaskStrategy",
"getSubTaskStrategy",
"(",
"String",
"attributeValue",
",",
"Long",
"processInstanceId",
")",
"throws",
"StrategyException",
"{",
"Package",
"packageVO",
"=",
"processInstanceId",
"==",
"null",
"?",
"null",
":",
"getPackage",
"("... | Returns a subtask strategy instance based on an attribute value and bundle spec
which can consist of either the subtask strategy logical name, or an xml document.
@param attributeValue
@return the subtask strategy implementor instance | [
"Returns",
"a",
"subtask",
"strategy",
"instance",
"based",
"on",
"an",
"attribute",
"value",
"and",
"bundle",
"spec",
"which",
"can",
"consist",
"of",
"either",
"the",
"subtask",
"strategy",
"logical",
"name",
"or",
"an",
"xml",
"document",
"."
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-services/src/com/centurylink/mdw/services/task/factory/TaskInstanceStrategyFactory.java#L98-L104 |
aws/aws-sdk-java | aws-java-sdk-sns/src/main/java/com/amazonaws/services/sns/message/SignatureVerifier.java | SignatureVerifier.verifyHostname | private void verifyHostname(X509Certificate cer) {
"""
Verifies the hostname in the certificate matches {@link #expectedCertCommonName}.
@param cer Certificate to validate.
"""
try {
hostnameVerifier.verify(expectedCertCommonName, cer);
} catch (SSLException e) {
thro... | java | private void verifyHostname(X509Certificate cer) {
try {
hostnameVerifier.verify(expectedCertCommonName, cer);
} catch (SSLException e) {
throw new SdkClientException("Certificate does not match expected common name: " + expectedCertCommonName, e);
}
} | [
"private",
"void",
"verifyHostname",
"(",
"X509Certificate",
"cer",
")",
"{",
"try",
"{",
"hostnameVerifier",
".",
"verify",
"(",
"expectedCertCommonName",
",",
"cer",
")",
";",
"}",
"catch",
"(",
"SSLException",
"e",
")",
"{",
"throw",
"new",
"SdkClientExcept... | Verifies the hostname in the certificate matches {@link #expectedCertCommonName}.
@param cer Certificate to validate. | [
"Verifies",
"the",
"hostname",
"in",
"the",
"certificate",
"matches",
"{",
"@link",
"#expectedCertCommonName",
"}",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sns/src/main/java/com/amazonaws/services/sns/message/SignatureVerifier.java#L227-L233 |
tbrooks8/Precipice | precipice-core/src/main/java/net/uncontended/precipice/GuardRail.java | GuardRail.releasePermits | public void releasePermits(ExecutionContext context, Result result) {
"""
Release acquired permits with known result. Since there is a known result the result
count object and latency will be updated.
@param context context of the task execution
@param result of the execution
"""
releasePermits(c... | java | public void releasePermits(ExecutionContext context, Result result) {
releasePermits(context.permitCount(), result, context.startNanos(), clock.nanoTime());
} | [
"public",
"void",
"releasePermits",
"(",
"ExecutionContext",
"context",
",",
"Result",
"result",
")",
"{",
"releasePermits",
"(",
"context",
".",
"permitCount",
"(",
")",
",",
"result",
",",
"context",
".",
"startNanos",
"(",
")",
",",
"clock",
".",
"nanoTim... | Release acquired permits with known result. Since there is a known result the result
count object and latency will be updated.
@param context context of the task execution
@param result of the execution | [
"Release",
"acquired",
"permits",
"with",
"known",
"result",
".",
"Since",
"there",
"is",
"a",
"known",
"result",
"the",
"result",
"count",
"object",
"and",
"latency",
"will",
"be",
"updated",
"."
] | train | https://github.com/tbrooks8/Precipice/blob/97fae467fd676b16a96b8d88b02569d8fc1f2681/precipice-core/src/main/java/net/uncontended/precipice/GuardRail.java#L115-L117 |
baratine/baratine | core/src/main/java/com/caucho/v5/amp/stub/StubClass.java | StubClass.createPin | private MethodAmp createPin(MethodAmp delegate,
Parameter result) {
"""
/*
private MethodAmp createCopyShim(MethodAmp delegate,
Parameter result)
{
TypeRef resultRef = TypeRef.of(result.getParameterizedType());
TypeRef transferRef = resultRef.to(Result.class).param(0);
ShimCon... | java | private MethodAmp createPin(MethodAmp delegate,
Parameter result)
{
Class<?> api = TypeRef.of(result.getParameterizedType())
.to(ResultChain.class)
.param(0)
.rawClass();
return new MethodStubResul... | [
"private",
"MethodAmp",
"createPin",
"(",
"MethodAmp",
"delegate",
",",
"Parameter",
"result",
")",
"{",
"Class",
"<",
"?",
">",
"api",
"=",
"TypeRef",
".",
"of",
"(",
"result",
".",
"getParameterizedType",
"(",
")",
")",
".",
"to",
"(",
"ResultChain",
"... | /*
private MethodAmp createCopyShim(MethodAmp delegate,
Parameter result)
{
TypeRef resultRef = TypeRef.of(result.getParameterizedType());
TypeRef transferRef = resultRef.to(Result.class).param(0);
ShimConverter<?,?> shim = new ShimConverter(_type, transferRef.rawClass());
return new MethodStubResultCopy(delegate, sh... | [
"/",
"*",
"private",
"MethodAmp",
"createCopyShim",
"(",
"MethodAmp",
"delegate",
"Parameter",
"result",
")",
"{",
"TypeRef",
"resultRef",
"=",
"TypeRef",
".",
"of",
"(",
"result",
".",
"getParameterizedType",
"()",
")",
";",
"TypeRef",
"transferRef",
"=",
"re... | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/amp/stub/StubClass.java#L650-L659 |
yangjm/winlet | utils/src/main/java/com/aggrepoint/utils/StringUtils.java | StringUtils.fixDBString | public static String fixDBString(String str, int dbLen, int n) {
"""
将超出长度的字符截去。
@param str
String 要处理的字符串
@param dbLen
int 长度
@param n
int 每个非拉丁字符在数据库中占据的字节数
"""
if (str == null) {
return "";
}
char[] chars = str.toCharArray();
int len = 0;
StringBuffer sb = new StringBuffer();
for (i... | java | public static String fixDBString(String str, int dbLen, int n) {
if (str == null) {
return "";
}
char[] chars = str.toCharArray();
int len = 0;
StringBuffer sb = new StringBuffer();
for (int i = 0; i < chars.length; i++) {
if (Character.UnicodeBlock.of(chars[i]) == Character.UnicodeBlock.BASIC_LATIN... | [
"public",
"static",
"String",
"fixDBString",
"(",
"String",
"str",
",",
"int",
"dbLen",
",",
"int",
"n",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"char",
"[",
"]",
"chars",
"=",
"str",
".",
"toCharArray",
"(",... | 将超出长度的字符截去。
@param str
String 要处理的字符串
@param dbLen
int 长度
@param n
int 每个非拉丁字符在数据库中占据的字节数 | [
"将超出长度的字符截去。"
] | train | https://github.com/yangjm/winlet/blob/2126236f56858e283fa6ad69fe9279ee30f47b67/utils/src/main/java/com/aggrepoint/utils/StringUtils.java#L174-L196 |
craftercms/commons | utilities/src/main/java/org/craftercms/commons/zip/ZipUtils.java | ZipUtils.unZipFiles | public static void unZipFiles(InputStream inputStream, File outputFolder) throws IOException {
"""
Unzips a zip from an input stream into an output folder.
@param inputStream the zip input stream
@param outputFolder the output folder where the files
@throws IOException
"""
ZipInputStream zis = ne... | java | public static void unZipFiles(InputStream inputStream, File outputFolder) throws IOException {
ZipInputStream zis = new ZipInputStream(inputStream);
ZipEntry ze = zis.getNextEntry();
while (ze != null) {
File file = new File(outputFolder, ze.getName());
OutputStream os =... | [
"public",
"static",
"void",
"unZipFiles",
"(",
"InputStream",
"inputStream",
",",
"File",
"outputFolder",
")",
"throws",
"IOException",
"{",
"ZipInputStream",
"zis",
"=",
"new",
"ZipInputStream",
"(",
"inputStream",
")",
";",
"ZipEntry",
"ze",
"=",
"zis",
".",
... | Unzips a zip from an input stream into an output folder.
@param inputStream the zip input stream
@param outputFolder the output folder where the files
@throws IOException | [
"Unzips",
"a",
"zip",
"from",
"an",
"input",
"stream",
"into",
"an",
"output",
"folder",
"."
] | train | https://github.com/craftercms/commons/blob/3074fe49e56c2a4aae0832f40b17ae563335dc83/utilities/src/main/java/org/craftercms/commons/zip/ZipUtils.java#L91-L108 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java | ScopedServletUtils.renameScope | public static void renameScope( Object oldScopeKey, Object newScopeKey, HttpServletRequest request ) {
"""
Find all scoped objects ({@link ScopedRequest}, {@link ScopedResponse})
which have a certain scope-key, replaces this scope-key with the new one, and re-caches the objects
the new scope-key.
@param oldScop... | java | public static void renameScope( Object oldScopeKey, Object newScopeKey, HttpServletRequest request )
{
assert ! ( request instanceof ScopedRequest );
String requestAttr = getScopedName( OVERRIDE_REQUEST_ATTR, oldScopeKey );
String responseAttr = getScopedName( OVERRIDE_RESPONSE_ATTR... | [
"public",
"static",
"void",
"renameScope",
"(",
"Object",
"oldScopeKey",
",",
"Object",
"newScopeKey",
",",
"HttpServletRequest",
"request",
")",
"{",
"assert",
"!",
"(",
"request",
"instanceof",
"ScopedRequest",
")",
";",
"String",
"requestAttr",
"=",
"getScopedN... | Find all scoped objects ({@link ScopedRequest}, {@link ScopedResponse})
which have a certain scope-key, replaces this scope-key with the new one, and re-caches the objects
the new scope-key.
@param oldScopeKey
@param newScopeKey
@param request the real (outer) request, where the scoped objects are cached. | [
"Find",
"all",
"scoped",
"objects",
"(",
"{"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java#L147-L174 |
integration-technology/amazon-mws-orders | src/main/java/com/amazonservices/mws/client/MwsUtl.java | MwsUtl.signParameters | static String signParameters(URI serviceUri, String signatureVersion, String signatureMethod,
Map<String, String> parameters, String aswSecretKey) {
"""
Computes RFC 2104-compliant HMAC signature for request parameters
Implements AWS Signature, as per following spec:
If Signature Version is 0, it s... | java | static String signParameters(URI serviceUri, String signatureVersion, String signatureMethod,
Map<String, String> parameters, String aswSecretKey) {
parameters.put("SignatureVersion", signatureVersion);
String algorithm = "HmacSHA1";
String stringToSign = null;
if ("0".equals... | [
"static",
"String",
"signParameters",
"(",
"URI",
"serviceUri",
",",
"String",
"signatureVersion",
",",
"String",
"signatureMethod",
",",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
",",
"String",
"aswSecretKey",
")",
"{",
"parameters",
".",
"put",
... | Computes RFC 2104-compliant HMAC signature for request parameters
Implements AWS Signature, as per following spec:
If Signature Version is 0, it signs concatenated Action and Timestamp
If Signature Version is 1, it performs the following:
Sorts all parameters (including SignatureVersion and excluding Signature,
the ... | [
"Computes",
"RFC",
"2104",
"-",
"compliant",
"HMAC",
"signature",
"for",
"request",
"parameters",
"Implements",
"AWS",
"Signature",
"as",
"per",
"following",
"spec",
":"
] | train | https://github.com/integration-technology/amazon-mws-orders/blob/042e8cd5b10588a30150222bf9c91faf4f130b3c/src/main/java/com/amazonservices/mws/client/MwsUtl.java#L436-L453 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/SLINK.java | SLINK.slinkstep3 | private void slinkstep3(DBIDRef id, DBIDArrayIter it, int n, WritableDBIDDataStore pi, WritableDoubleDataStore lambda, WritableDoubleDataStore m) {
"""
Third step: Determine the values for P and L
@param id the id of the object to be inserted into the pointer
representation
@param it array iterator
@param n ... | java | private void slinkstep3(DBIDRef id, DBIDArrayIter it, int n, WritableDBIDDataStore pi, WritableDoubleDataStore lambda, WritableDoubleDataStore m) {
DBIDVar p_i = DBIDUtil.newVar();
// for i = 1..n
for(it.seek(0); it.getOffset() < n; it.advance()) {
double l_i = lambda.doubleValue(it);
double m_i... | [
"private",
"void",
"slinkstep3",
"(",
"DBIDRef",
"id",
",",
"DBIDArrayIter",
"it",
",",
"int",
"n",
",",
"WritableDBIDDataStore",
"pi",
",",
"WritableDoubleDataStore",
"lambda",
",",
"WritableDoubleDataStore",
"m",
")",
"{",
"DBIDVar",
"p_i",
"=",
"DBIDUtil",
".... | Third step: Determine the values for P and L
@param id the id of the object to be inserted into the pointer
representation
@param it array iterator
@param n Last object to process at this run
@param pi Pi data store
@param lambda Lambda data store
@param m Data store | [
"Third",
"step",
":",
"Determine",
"the",
"values",
"for",
"P",
"and",
"L"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/SLINK.java#L216-L245 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java | NetworkWatchersInner.getVMSecurityRulesAsync | public Observable<SecurityGroupViewResultInner> getVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) {
"""
Gets the configured and effective security group rules on the specified VM.
@param resourceGroupName The name of the resource group.
@param networkWatcherN... | java | public Observable<SecurityGroupViewResultInner> getVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) {
return getVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1<ServiceResponse<SecurityGroupViewResult... | [
"public",
"Observable",
"<",
"SecurityGroupViewResultInner",
">",
"getVMSecurityRulesAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"String",
"targetResourceId",
")",
"{",
"return",
"getVMSecurityRulesWithServiceResponseAsync",
"(",
"res... | Gets the configured and effective security group rules on the specified VM.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher.
@param targetResourceId ID of the target VM.
@throws IllegalArgumentException thrown if parameters fail the validation
@return ... | [
"Gets",
"the",
"configured",
"and",
"effective",
"security",
"group",
"rules",
"on",
"the",
"specified",
"VM",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java#L1321-L1328 |
OpenCompare/OpenCompare | org.opencompare/api-java/src/main/java/org/opencompare/api/java/PCMMetadata.java | PCMMetadata.getFeaturePosition | public int getFeaturePosition(AbstractFeature feature) {
"""
Returns the absolute position of the feature or create if not exists
@param feature
@return the absolution position of 'feature' or -1 if it is not specified
"""
AbstractFeature result = feature;
if (!featurePositions.containsKey(fe... | java | public int getFeaturePosition(AbstractFeature feature) {
AbstractFeature result = feature;
if (!featurePositions.containsKey(feature)) {
if (feature instanceof FeatureGroup) {
FeatureGroup featureGroup = (FeatureGroup) feature;
List<Feature> features = feature... | [
"public",
"int",
"getFeaturePosition",
"(",
"AbstractFeature",
"feature",
")",
"{",
"AbstractFeature",
"result",
"=",
"feature",
";",
"if",
"(",
"!",
"featurePositions",
".",
"containsKey",
"(",
"feature",
")",
")",
"{",
"if",
"(",
"feature",
"instanceof",
"Fe... | Returns the absolute position of the feature or create if not exists
@param feature
@return the absolution position of 'feature' or -1 if it is not specified | [
"Returns",
"the",
"absolute",
"position",
"of",
"the",
"feature",
"or",
"create",
"if",
"not",
"exists"
] | train | https://github.com/OpenCompare/OpenCompare/blob/6cd776466b375cb8ecca08fcd94e573d65e20b14/org.opencompare/api-java/src/main/java/org/opencompare/api/java/PCMMetadata.java#L68-L86 |
mijecu25/dsa | src/main/java/com/mijecu25/dsa/algorithms/search/logarithmic/BinarySearch.java | BinarySearch.searchDescending | public static int searchDescending(double[] doubleArray, double value) {
"""
Search for the value in the reverse sorted double array and return the index.
@param doubleArray array that we are searching in.
@param value value that is being searched in the array.
@return the index where the value is found in ... | java | public static int searchDescending(double[] doubleArray, double value) {
int start = 0;
int end = doubleArray.length - 1;
int middle = 0;
while(start <= end) {
middle = (start + end) >> 1;
if(value == doubleArray[middle]) {
retur... | [
"public",
"static",
"int",
"searchDescending",
"(",
"double",
"[",
"]",
"doubleArray",
",",
"double",
"value",
")",
"{",
"int",
"start",
"=",
"0",
";",
"int",
"end",
"=",
"doubleArray",
".",
"length",
"-",
"1",
";",
"int",
"middle",
"=",
"0",
";",
"w... | Search for the value in the reverse sorted double array and return the index.
@param doubleArray array that we are searching in.
@param value value that is being searched in the array.
@return the index where the value is found in the array, else -1. | [
"Search",
"for",
"the",
"value",
"in",
"the",
"reverse",
"sorted",
"double",
"array",
"and",
"return",
"the",
"index",
"."
] | train | https://github.com/mijecu25/dsa/blob/a22971b746833e78a3939ae4de65e8f6bf2e3fd4/src/main/java/com/mijecu25/dsa/algorithms/search/logarithmic/BinarySearch.java#L601-L623 |
cerner/beadledom | client/resteasy-client/src/main/java/com/cerner/beadledom/client/resteasy/BeadledomResteasyClientBuilder.java | BeadledomResteasyClientBuilder.setTtl | @Override
public BeadledomResteasyClientBuilder setTtl(int ttl, TimeUnit timeUnit) {
"""
Sets the default TTL to be used if a {@link ClientHttpEngine} isn't
specified via {@link #setHttpEngine(ClientHttpEngine)}.
<p>If a {@link ClientHttpEngine} is specified via {@link #setHttpEngine(ClientHttpEngine)},
the... | java | @Override
public BeadledomResteasyClientBuilder setTtl(int ttl, TimeUnit timeUnit) {
long millis = timeUnit.toMillis(ttl);
if (millis > Integer.MAX_VALUE || millis < 0) {
throw new IllegalArgumentException(
"TTL must be smaller than Integer.MAX_VALUE when converted to milliseconds");
}
... | [
"@",
"Override",
"public",
"BeadledomResteasyClientBuilder",
"setTtl",
"(",
"int",
"ttl",
",",
"TimeUnit",
"timeUnit",
")",
"{",
"long",
"millis",
"=",
"timeUnit",
".",
"toMillis",
"(",
"ttl",
")",
";",
"if",
"(",
"millis",
">",
"Integer",
".",
"MAX_VALUE",
... | Sets the default TTL to be used if a {@link ClientHttpEngine} isn't
specified via {@link #setHttpEngine(ClientHttpEngine)}.
<p>If a {@link ClientHttpEngine} is specified via {@link #setHttpEngine(ClientHttpEngine)},
then this property will be ignored.
@return this builder | [
"Sets",
"the",
"default",
"TTL",
"to",
"be",
"used",
"if",
"a",
"{",
"@link",
"ClientHttpEngine",
"}",
"isn",
"t",
"specified",
"via",
"{",
"@link",
"#setHttpEngine",
"(",
"ClientHttpEngine",
")",
"}",
"."
] | train | https://github.com/cerner/beadledom/blob/75435bced5187d5455b46518fadf85c93cf32014/client/resteasy-client/src/main/java/com/cerner/beadledom/client/resteasy/BeadledomResteasyClientBuilder.java#L190-L200 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/AbstractAttributeDefinitionBuilder.java | AbstractAttributeDefinitionBuilder.addArbitraryDescriptor | @SuppressWarnings("deprecation")
public BUILDER addArbitraryDescriptor(String arbitraryDescriptor, ModelNode value) {
"""
Adds {@link AttributeDefinition#getArbitraryDescriptors() arbitrary descriptor}.
@param arbitraryDescriptor the arbitrary descriptor name.
@param value the value of the arbitrary descript... | java | @SuppressWarnings("deprecation")
public BUILDER addArbitraryDescriptor(String arbitraryDescriptor, ModelNode value) {
if (this.arbitraryDescriptors == null) {
this.arbitraryDescriptors = Collections.singletonMap(arbitraryDescriptor, value);
} else {
if (this.arbitraryDescript... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"BUILDER",
"addArbitraryDescriptor",
"(",
"String",
"arbitraryDescriptor",
",",
"ModelNode",
"value",
")",
"{",
"if",
"(",
"this",
".",
"arbitraryDescriptors",
"==",
"null",
")",
"{",
"this",
".",
"... | Adds {@link AttributeDefinition#getArbitraryDescriptors() arbitrary descriptor}.
@param arbitraryDescriptor the arbitrary descriptor name.
@param value the value of the arbitrary descriptor.
@return a builder that can be used to continue building the attribute definition | [
"Adds",
"{"
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AbstractAttributeDefinitionBuilder.java#L458-L469 |
landawn/AbacusUtil | src/com/landawn/abacus/util/IntList.java | IntList.allMatch | public <E extends Exception> boolean allMatch(Try.IntPredicate<E> filter) throws E {
"""
Returns whether all elements of this List match the provided predicate.
@param filter
@return
"""
return allMatch(0, size(), filter);
} | java | public <E extends Exception> boolean allMatch(Try.IntPredicate<E> filter) throws E {
return allMatch(0, size(), filter);
} | [
"public",
"<",
"E",
"extends",
"Exception",
">",
"boolean",
"allMatch",
"(",
"Try",
".",
"IntPredicate",
"<",
"E",
">",
"filter",
")",
"throws",
"E",
"{",
"return",
"allMatch",
"(",
"0",
",",
"size",
"(",
")",
",",
"filter",
")",
";",
"}"
] | Returns whether all elements of this List match the provided predicate.
@param filter
@return | [
"Returns",
"whether",
"all",
"elements",
"of",
"this",
"List",
"match",
"the",
"provided",
"predicate",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/IntList.java#L987-L989 |
Jasig/uPortal | uPortal-api/uPortal-api-internal/src/main/java/org/apereo/portal/portlets/localization/UserLocaleHelper.java | UserLocaleHelper.getLocales | public List<LocaleBean> getLocales(Locale currentLocale) {
"""
Return a list of LocaleBeans matching the currently available locales for the portal.
@param currentLocale
@return
"""
List<LocaleBean> locales = new ArrayList<>();
// get the array of locales available from the portal
... | java | public List<LocaleBean> getLocales(Locale currentLocale) {
List<LocaleBean> locales = new ArrayList<>();
// get the array of locales available from the portal
List<Locale> portalLocales = localeManagerFactory.getPortalLocales();
for (Locale locale : portalLocales) {
if (curr... | [
"public",
"List",
"<",
"LocaleBean",
">",
"getLocales",
"(",
"Locale",
"currentLocale",
")",
"{",
"List",
"<",
"LocaleBean",
">",
"locales",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"// get the array of locales available from the portal",
"List",
"<",
"Locale... | Return a list of LocaleBeans matching the currently available locales for the portal.
@param currentLocale
@return | [
"Return",
"a",
"list",
"of",
"LocaleBeans",
"matching",
"the",
"currently",
"available",
"locales",
"for",
"the",
"portal",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-api/uPortal-api-internal/src/main/java/org/apereo/portal/portlets/localization/UserLocaleHelper.java#L77-L92 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.ip_game_ipOnGame_rule_POST | public OvhGameMitigationRule ip_game_ipOnGame_rule_POST(String ip, String ipOnGame, OvhRange<Long> ports, OvhGameMitigationRuleProtocolEnum protocol) throws IOException {
"""
Add new rule on your IP
REST: POST /ip/{ip}/game/{ipOnGame}/rule
@param protocol [required] The protocol running behind the given port
... | java | public OvhGameMitigationRule ip_game_ipOnGame_rule_POST(String ip, String ipOnGame, OvhRange<Long> ports, OvhGameMitigationRuleProtocolEnum protocol) throws IOException {
String qPath = "/ip/{ip}/game/{ipOnGame}/rule";
StringBuilder sb = path(qPath, ip, ipOnGame);
HashMap<String, Object>o = new HashMap<String, Ob... | [
"public",
"OvhGameMitigationRule",
"ip_game_ipOnGame_rule_POST",
"(",
"String",
"ip",
",",
"String",
"ipOnGame",
",",
"OvhRange",
"<",
"Long",
">",
"ports",
",",
"OvhGameMitigationRuleProtocolEnum",
"protocol",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"="... | Add new rule on your IP
REST: POST /ip/{ip}/game/{ipOnGame}/rule
@param protocol [required] The protocol running behind the given port
@param ports [required] The UDP port range to apply the rule on
@param ip [required]
@param ipOnGame [required] | [
"Add",
"new",
"rule",
"on",
"your",
"IP"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L374-L382 |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/server/FactoryFinder.java | FactoryFinder.newInstance | private static Object newInstance(final String className, ClassLoader cl, final boolean doFallback) throws ConfigurationError {
"""
Create an instance of a class using the specified ClassLoader and optionally fall back to the
current ClassLoader if not found.
@param className Name of the concrete class corresp... | java | private static Object newInstance(final String className, ClassLoader cl, final boolean doFallback) throws ConfigurationError {
try {
Class<?> providerClass;
if (cl == null) {
// If classloader is null Use the bootstrap ClassLoader.
// Thus Class.forName(... | [
"private",
"static",
"Object",
"newInstance",
"(",
"final",
"String",
"className",
",",
"ClassLoader",
"cl",
",",
"final",
"boolean",
"doFallback",
")",
"throws",
"ConfigurationError",
"{",
"try",
"{",
"Class",
"<",
"?",
">",
"providerClass",
";",
"if",
"(",
... | Create an instance of a class using the specified ClassLoader and optionally fall back to the
current ClassLoader if not found.
@param className Name of the concrete class corresponding to the service provider
@param cl ClassLoader to use to load the class, null means to use the bootstrap ClassLoader
@param doFallba... | [
"Create",
"an",
"instance",
"of",
"a",
"class",
"using",
"the",
"specified",
"ClassLoader",
"and",
"optionally",
"fall",
"back",
"to",
"the",
"current",
"ClassLoader",
"if",
"not",
"found",
"."
] | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/server/FactoryFinder.java#L58-L89 |
andkulikov/Transitions-Everywhere | library(1.x)/src/main/java/com/transitionseverywhere/Transition.java | Transition.excludeTarget | @NonNull
public Transition excludeTarget(@Nullable String targetName, boolean exclude) {
"""
Whether to add the given transitionName to the list of target transitionNames to exclude
from this transition. The <code>exclude</code> parameter specifies whether the target
should be added to or removed from the ex... | java | @NonNull
public Transition excludeTarget(@Nullable String targetName, boolean exclude) {
mTargetNameExcludes = excludeObject(mTargetNameExcludes, targetName, exclude);
return this;
} | [
"@",
"NonNull",
"public",
"Transition",
"excludeTarget",
"(",
"@",
"Nullable",
"String",
"targetName",
",",
"boolean",
"exclude",
")",
"{",
"mTargetNameExcludes",
"=",
"excludeObject",
"(",
"mTargetNameExcludes",
",",
"targetName",
",",
"exclude",
")",
";",
"retur... | Whether to add the given transitionName to the list of target transitionNames to exclude
from this transition. The <code>exclude</code> parameter specifies whether the target
should be added to or removed from the excluded list.
<p>Excluding targets is a general mechanism for allowing transitions to run on
a view hier... | [
"Whether",
"to",
"add",
"the",
"given",
"transitionName",
"to",
"the",
"list",
"of",
"target",
"transitionNames",
"to",
"exclude",
"from",
"this",
"transition",
".",
"The",
"<code",
">",
"exclude<",
"/",
"code",
">",
"parameter",
"specifies",
"whether",
"the",... | train | https://github.com/andkulikov/Transitions-Everywhere/blob/828efe5f152a2f05e2bfeee6254b74ad2269d4f1/library(1.x)/src/main/java/com/transitionseverywhere/Transition.java#L1167-L1171 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF3.java | CommonOps_DDF3.subtractEquals | public static void subtractEquals( DMatrix3 a , DMatrix3 b ) {
"""
<p>Performs the following operation:<br>
<br>
a = a - b <br>
a<sub>i</sub> = a<sub>i</sub> - b<sub>i</sub> <br>
</p>
@param a A Vector. Modified.
@param b A Vector. Not modified.
"""
a.a1 -= b.a1;
a.a2 -= b.a2;
a... | java | public static void subtractEquals( DMatrix3 a , DMatrix3 b ) {
a.a1 -= b.a1;
a.a2 -= b.a2;
a.a3 -= b.a3;
} | [
"public",
"static",
"void",
"subtractEquals",
"(",
"DMatrix3",
"a",
",",
"DMatrix3",
"b",
")",
"{",
"a",
".",
"a1",
"-=",
"b",
".",
"a1",
";",
"a",
".",
"a2",
"-=",
"b",
".",
"a2",
";",
"a",
".",
"a3",
"-=",
"b",
".",
"a3",
";",
"}"
] | <p>Performs the following operation:<br>
<br>
a = a - b <br>
a<sub>i</sub> = a<sub>i</sub> - b<sub>i</sub> <br>
</p>
@param a A Vector. Modified.
@param b A Vector. Not modified. | [
"<p",
">",
"Performs",
"the",
"following",
"operation",
":",
"<br",
">",
"<br",
">",
"a",
"=",
"a",
"-",
"b",
"<br",
">",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"=",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"-",
"b<sub",
">",
"i<",
"/",
"sub",
">",... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF3.java#L198-L202 |
icode/ameba | src/main/java/ameba/websocket/internal/LocalizationMessages.java | LocalizationMessages.ENDPOINT_MULTIPLE_METHODS | public static String ENDPOINT_MULTIPLE_METHODS(Object arg0, Object arg1, Object arg2, Object arg3) {
"""
Multiple methods using {0} annotation in class {1}: {2} and {3}. The latter will be ignored.
"""
return localizer.localize(localizableENDPOINT_MULTIPLE_METHODS(arg0, arg1, arg2, arg3));
} | java | public static String ENDPOINT_MULTIPLE_METHODS(Object arg0, Object arg1, Object arg2, Object arg3) {
return localizer.localize(localizableENDPOINT_MULTIPLE_METHODS(arg0, arg1, arg2, arg3));
} | [
"public",
"static",
"String",
"ENDPOINT_MULTIPLE_METHODS",
"(",
"Object",
"arg0",
",",
"Object",
"arg1",
",",
"Object",
"arg2",
",",
"Object",
"arg3",
")",
"{",
"return",
"localizer",
".",
"localize",
"(",
"localizableENDPOINT_MULTIPLE_METHODS",
"(",
"arg0",
",",
... | Multiple methods using {0} annotation in class {1}: {2} and {3}. The latter will be ignored. | [
"Multiple",
"methods",
"using",
"{",
"0",
"}",
"annotation",
"in",
"class",
"{",
"1",
"}",
":",
"{",
"2",
"}",
"and",
"{",
"3",
"}",
".",
"The",
"latter",
"will",
"be",
"ignored",
"."
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/websocket/internal/LocalizationMessages.java#L55-L57 |
mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.getTopScopeValue | public static Object getTopScopeValue(Scriptable scope, Object key) {
"""
Get arbitrary application-specific value associated with the top scope
of the given scope.
The method first calls {@link #getTopLevelScope(Scriptable scope)}
and then searches the prototype chain of the top scope for the first
object con... | java | public static Object getTopScopeValue(Scriptable scope, Object key)
{
scope = ScriptableObject.getTopLevelScope(scope);
for (;;) {
if (scope instanceof ScriptableObject) {
ScriptableObject so = (ScriptableObject)scope;
Object value = so.getAssociatedValue(... | [
"public",
"static",
"Object",
"getTopScopeValue",
"(",
"Scriptable",
"scope",
",",
"Object",
"key",
")",
"{",
"scope",
"=",
"ScriptableObject",
".",
"getTopLevelScope",
"(",
"scope",
")",
";",
"for",
"(",
";",
";",
")",
"{",
"if",
"(",
"scope",
"instanceof... | Get arbitrary application-specific value associated with the top scope
of the given scope.
The method first calls {@link #getTopLevelScope(Scriptable scope)}
and then searches the prototype chain of the top scope for the first
object containing the associated value with the given key.
@param scope the starting scope.
... | [
"Get",
"arbitrary",
"application",
"-",
"specific",
"value",
"associated",
"with",
"the",
"top",
"scope",
"of",
"the",
"given",
"scope",
".",
"The",
"method",
"first",
"calls",
"{",
"@link",
"#getTopLevelScope",
"(",
"Scriptable",
"scope",
")",
"}",
"and",
"... | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L2752-L2768 |
bohnman/squiggly-java | src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java | SquigglyUtils.collectify | public static Collection<Map<String, Object>> collectify(ObjectMapper mapper, Object source, Class<? extends Collection> targetCollectionType) {
"""
Convert an object to a collection of maps.
@param mapper the object mapper
@param source the source object
@param targetCollectionTyp... | java | public static Collection<Map<String, Object>> collectify(ObjectMapper mapper, Object source, Class<? extends Collection> targetCollectionType) {
return collectify(mapper, source, targetCollectionType, String.class, Object.class);
} | [
"public",
"static",
"Collection",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"collectify",
"(",
"ObjectMapper",
"mapper",
",",
"Object",
"source",
",",
"Class",
"<",
"?",
"extends",
"Collection",
">",
"targetCollectionType",
")",
"{",
"return",
"col... | Convert an object to a collection of maps.
@param mapper the object mapper
@param source the source object
@param targetCollectionType the target collection type
@return collection | [
"Convert",
"an",
"object",
"to",
"a",
"collection",
"of",
"maps",
"."
] | train | https://github.com/bohnman/squiggly-java/blob/ba0c0b924ab718225d1ad180273ee63ea6c4f55a/src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java#L32-L34 |
LearnLib/automatalib | visualization/dot-visualizer/src/main/java/net/automatalib/visualization/dot/DOT.java | DOT.runDOT | public static void runDOT(Reader r, String format, File out) throws IOException {
"""
Invokes the GraphVIZ DOT utility for rendering graphs, writing output to the specified file.
@param r
the reader from which the GraphVIZ description is read.
@param format
the output format to produce.
@param out
the file... | java | public static void runDOT(Reader r, String format, File out) throws IOException {
String[] dotCommand = buildDOTCommand(format, "-o" + out.getAbsolutePath());
try {
ProcessUtil.invokeProcess(dotCommand, r, LOGGER::warn);
} catch (InterruptedException ex) {
LOGGER.error("... | [
"public",
"static",
"void",
"runDOT",
"(",
"Reader",
"r",
",",
"String",
"format",
",",
"File",
"out",
")",
"throws",
"IOException",
"{",
"String",
"[",
"]",
"dotCommand",
"=",
"buildDOTCommand",
"(",
"format",
",",
"\"-o\"",
"+",
"out",
".",
"getAbsoluteP... | Invokes the GraphVIZ DOT utility for rendering graphs, writing output to the specified file.
@param r
the reader from which the GraphVIZ description is read.
@param format
the output format to produce.
@param out
the file to which the output is written.
@throws IOException
if an I/O error occurs reading from the give... | [
"Invokes",
"the",
"GraphVIZ",
"DOT",
"utility",
"for",
"rendering",
"graphs",
"writing",
"output",
"to",
"the",
"specified",
"file",
"."
] | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/visualization/dot-visualizer/src/main/java/net/automatalib/visualization/dot/DOT.java#L174-L182 |
apache/groovy | src/main/java/org/codehaus/groovy/vmplugin/v7/TypeTransformers.java | TypeTransformers.createSAMTransform | private static MethodHandle createSAMTransform(Object arg, Class parameter) {
"""
creates a method handle able to transform the given Closure into a SAM type
if the given parameter is a SAM type
"""
Method method = CachedSAMClass.getSAMMethod(parameter);
if (method == null) return null;
... | java | private static MethodHandle createSAMTransform(Object arg, Class parameter) {
Method method = CachedSAMClass.getSAMMethod(parameter);
if (method == null) return null;
// TODO: have to think about how to optimize this!
if (parameter.isInterface()) {
if (Traits.isTrait(paramete... | [
"private",
"static",
"MethodHandle",
"createSAMTransform",
"(",
"Object",
"arg",
",",
"Class",
"parameter",
")",
"{",
"Method",
"method",
"=",
"CachedSAMClass",
".",
"getSAMMethod",
"(",
"parameter",
")",
";",
"if",
"(",
"method",
"==",
"null",
")",
"return",
... | creates a method handle able to transform the given Closure into a SAM type
if the given parameter is a SAM type | [
"creates",
"a",
"method",
"handle",
"able",
"to",
"transform",
"the",
"given",
"Closure",
"into",
"a",
"SAM",
"type",
"if",
"the",
"given",
"parameter",
"is",
"a",
"SAM",
"type"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/vmplugin/v7/TypeTransformers.java#L145-L191 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/factory/feature/associate/FactoryAssociation.java | FactoryAssociation.kdRandomForest | public static AssociateDescription<TupleDesc_F64> kdRandomForest( ConfigAssociateNearestNeighbor configNN ,
int dimension,
int maxNodesSearched ,
int numTrees ,
int numConsiderSplit ,
long randomSeed) {
"""
Approximate a... | java | public static AssociateDescription<TupleDesc_F64> kdRandomForest( ConfigAssociateNearestNeighbor configNN ,
int dimension,
int maxNodesSearched ,
int numTrees ,
int numConsiderSplit ,
long randomSeed) {
NearestNeighbor nn =... | [
"public",
"static",
"AssociateDescription",
"<",
"TupleDesc_F64",
">",
"kdRandomForest",
"(",
"ConfigAssociateNearestNeighbor",
"configNN",
",",
"int",
"dimension",
",",
"int",
"maxNodesSearched",
",",
"int",
"numTrees",
",",
"int",
"numConsiderSplit",
",",
"long",
"r... | Approximate association using multiple random K-D trees (random forest) for descriptors with a high degree of
freedom, e.g. > 20
@see AssociateNearestNeighbor_ST
@see org.ddogleg.nn.wrap.KdForestBbfSearch
@param dimension Number of elements in the feature vector
@param maxNodesSearched Maximum number of nodes it ... | [
"Approximate",
"association",
"using",
"multiple",
"random",
"K",
"-",
"D",
"trees",
"(",
"random",
"forest",
")",
"for",
"descriptors",
"with",
"a",
"high",
"degree",
"of",
"freedom",
"e",
".",
"g",
".",
">",
";",
"20"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/feature/associate/FactoryAssociation.java#L101-L112 |
VoltDB/voltdb | src/frontend/org/voltdb/expressions/ExpressionUtil.java | ExpressionUtil.guessParameterType | private static String guessParameterType(Database db, VoltXMLElement elm) {
"""
Guess from a parent node what are the parameter type of its child node, should one of its child node
contain parameter.
@param db catalog
@param elm node under inspection
@return string representation of the type of its child node.... | java | private static String guessParameterType(Database db, VoltXMLElement elm) {
if (! isParameterized(elm) || ! elm.name.equals("operation")) {
return "";
} else {
final ExpressionType op = mapOfVoltXMLOpType.get(elm.attributes.get("optype"));
assert op != null;
... | [
"private",
"static",
"String",
"guessParameterType",
"(",
"Database",
"db",
",",
"VoltXMLElement",
"elm",
")",
"{",
"if",
"(",
"!",
"isParameterized",
"(",
"elm",
")",
"||",
"!",
"elm",
".",
"name",
".",
"equals",
"(",
"\"operation\"",
")",
")",
"{",
"re... | Guess from a parent node what are the parameter type of its child node, should one of its child node
contain parameter.
@param db catalog
@param elm node under inspection
@return string representation of the type of its child node. | [
"Guess",
"from",
"a",
"parent",
"node",
"what",
"are",
"the",
"parameter",
"type",
"of",
"its",
"child",
"node",
"should",
"one",
"of",
"its",
"child",
"node",
"contain",
"parameter",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/expressions/ExpressionUtil.java#L149-L185 |
google/error-prone | check_api/src/main/java/com/google/errorprone/matchers/Matchers.java | Matchers.hasModifier | public static <T extends Tree> Matcher<T> hasModifier(final Modifier modifier) {
"""
Returns true if the Tree node has the expected {@code Modifier}.
"""
return new Matcher<T>() {
@Override
public boolean matches(T tree, VisitorState state) {
Symbol sym = ASTHelpers.getSymbol(tree);
... | java | public static <T extends Tree> Matcher<T> hasModifier(final Modifier modifier) {
return new Matcher<T>() {
@Override
public boolean matches(T tree, VisitorState state) {
Symbol sym = ASTHelpers.getSymbol(tree);
return sym != null && sym.getModifiers().contains(modifier);
}
};
... | [
"public",
"static",
"<",
"T",
"extends",
"Tree",
">",
"Matcher",
"<",
"T",
">",
"hasModifier",
"(",
"final",
"Modifier",
"modifier",
")",
"{",
"return",
"new",
"Matcher",
"<",
"T",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"matches",
"(... | Returns true if the Tree node has the expected {@code Modifier}. | [
"Returns",
"true",
"if",
"the",
"Tree",
"node",
"has",
"the",
"expected",
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/matchers/Matchers.java#L1151-L1159 |
jcuda/jcusparse | JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java | JCusparse.cusparseSgthr | public static int cusparseSgthr(
cusparseHandle handle,
int nnz,
Pointer y,
Pointer xVal,
Pointer xInd,
int idxBase) {
"""
Description: Gather of non-zero elements from dense vector y into
sparse vector x.
"""
return checkResult(cusparseSgthr... | java | public static int cusparseSgthr(
cusparseHandle handle,
int nnz,
Pointer y,
Pointer xVal,
Pointer xInd,
int idxBase)
{
return checkResult(cusparseSgthrNative(handle, nnz, y, xVal, xInd, idxBase));
} | [
"public",
"static",
"int",
"cusparseSgthr",
"(",
"cusparseHandle",
"handle",
",",
"int",
"nnz",
",",
"Pointer",
"y",
",",
"Pointer",
"xVal",
",",
"Pointer",
"xInd",
",",
"int",
"idxBase",
")",
"{",
"return",
"checkResult",
"(",
"cusparseSgthrNative",
"(",
"h... | Description: Gather of non-zero elements from dense vector y into
sparse vector x. | [
"Description",
":",
"Gather",
"of",
"non",
"-",
"zero",
"elements",
"from",
"dense",
"vector",
"y",
"into",
"sparse",
"vector",
"x",
"."
] | train | https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L856-L865 |
line/armeria | zipkin/src/main/java/com/linecorp/armeria/client/tracing/HttpTracingClient.java | HttpTracingClient.newDecorator | public static Function<Client<HttpRequest, HttpResponse>, HttpTracingClient> newDecorator(Tracing tracing) {
"""
Creates a new tracing {@link Client} decorator using the specified {@link Tracing} instance.
"""
return newDecorator(tracing, null);
} | java | public static Function<Client<HttpRequest, HttpResponse>, HttpTracingClient> newDecorator(Tracing tracing) {
return newDecorator(tracing, null);
} | [
"public",
"static",
"Function",
"<",
"Client",
"<",
"HttpRequest",
",",
"HttpResponse",
">",
",",
"HttpTracingClient",
">",
"newDecorator",
"(",
"Tracing",
"tracing",
")",
"{",
"return",
"newDecorator",
"(",
"tracing",
",",
"null",
")",
";",
"}"
] | Creates a new tracing {@link Client} decorator using the specified {@link Tracing} instance. | [
"Creates",
"a",
"new",
"tracing",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/zipkin/src/main/java/com/linecorp/armeria/client/tracing/HttpTracingClient.java#L60-L62 |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java | MarkLogicRepositoryConnection.addWithoutCommit | @Override
protected void addWithoutCommit(Resource subject, URI predicate, Value object, Resource... contexts) throws RepositoryException {
"""
add without commit
note- supplied to honor interface
@param subject
@param predicate
@param object
@param contexts
@throws RepositoryException
"""
... | java | @Override
protected void addWithoutCommit(Resource subject, URI predicate, Value object, Resource... contexts) throws RepositoryException {
add(subject, predicate, object, contexts);
} | [
"@",
"Override",
"protected",
"void",
"addWithoutCommit",
"(",
"Resource",
"subject",
",",
"URI",
"predicate",
",",
"Value",
"object",
",",
"Resource",
"...",
"contexts",
")",
"throws",
"RepositoryException",
"{",
"add",
"(",
"subject",
",",
"predicate",
",",
... | add without commit
note- supplied to honor interface
@param subject
@param predicate
@param object
@param contexts
@throws RepositoryException | [
"add",
"without",
"commit"
] | train | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java#L1204-L1207 |
sjamesr/jfreesane | src/main/java/au/com/southsky/jfreesane/SaneSession.java | SaneSession.withRemoteSane | public static SaneSession withRemoteSane(
InetAddress saneAddress,
int port,
long timeout,
TimeUnit timeUnit,
long soTimeout,
TimeUnit soTimeUnit)
throws IOException {
"""
Establishes a connection to the SANE daemon running on the given host on the given port. If the
conn... | java | public static SaneSession withRemoteSane(
InetAddress saneAddress,
int port,
long timeout,
TimeUnit timeUnit,
long soTimeout,
TimeUnit soTimeUnit)
throws IOException {
long millis = timeUnit.toMillis(timeout);
Preconditions.checkArgument(
millis >= 0 && millis <... | [
"public",
"static",
"SaneSession",
"withRemoteSane",
"(",
"InetAddress",
"saneAddress",
",",
"int",
"port",
",",
"long",
"timeout",
",",
"TimeUnit",
"timeUnit",
",",
"long",
"soTimeout",
",",
"TimeUnit",
"soTimeUnit",
")",
"throws",
"IOException",
"{",
"long",
"... | Establishes a connection to the SANE daemon running on the given host on the given port. If the
connection cannot be established within the given timeout,
{@link java.net.SocketTimeoutException} is thrown.
@param saneAddress
@param port
@param timeout Connection timeout
@param timeUnit Connection timeout unit
@param s... | [
"Establishes",
"a",
"connection",
"to",
"the",
"SANE",
"daemon",
"running",
"on",
"the",
"given",
"host",
"on",
"the",
"given",
"port",
".",
"If",
"the",
"connection",
"cannot",
"be",
"established",
"within",
"the",
"given",
"timeout",
"{",
"@link",
"java",
... | train | https://github.com/sjamesr/jfreesane/blob/15ad0f73df0a8d0efec5167a2141cbd53afd862d/src/main/java/au/com/southsky/jfreesane/SaneSession.java#L104-L139 |
chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/util/jaxb/JaxbUtils.java | JaxbUtils.unmarshalCollection | public static <T> List<T> unmarshalCollection(Class<T> cl, InputStream s) throws JAXBException {
"""
Converts the contents of the InputStream to a List with objects of the given class.
@param cl Type to be used
@param s Input
@return List with objects of the given type
"""
return unmarshalCollection(... | java | public static <T> List<T> unmarshalCollection(Class<T> cl, InputStream s) throws JAXBException {
return unmarshalCollection(cl, new StreamSource(s));
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"unmarshalCollection",
"(",
"Class",
"<",
"T",
">",
"cl",
",",
"InputStream",
"s",
")",
"throws",
"JAXBException",
"{",
"return",
"unmarshalCollection",
"(",
"cl",
",",
"new",
"StreamSource",
"(",
... | Converts the contents of the InputStream to a List with objects of the given class.
@param cl Type to be used
@param s Input
@return List with objects of the given type | [
"Converts",
"the",
"contents",
"of",
"the",
"InputStream",
"to",
"a",
"List",
"with",
"objects",
"of",
"the",
"given",
"class",
"."
] | train | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/util/jaxb/JaxbUtils.java#L321-L323 |
OpenLiberty/open-liberty | dev/com.ibm.ws.session.store/src/com/ibm/ws/session/store/common/BackedStore.java | BackedStore.createSession | public ISession createSession(String sessionId, boolean newId) {
"""
/*
createSession - ensures that a newly generated id is not a duplicate and
also ensures if another thread just created the session, we return it rather
than creating another.
"""
//create local variable - JIT performance improveme... | java | public ISession createSession(String sessionId, boolean newId) {
//create local variable - JIT performance improvement
final boolean isTraceOn = com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled();
//need some way to checkForDuplicateCreatedIds or synchronize on some object or something .... | [
"public",
"ISession",
"createSession",
"(",
"String",
"sessionId",
",",
"boolean",
"newId",
")",
"{",
"//create local variable - JIT performance improvement",
"final",
"boolean",
"isTraceOn",
"=",
"com",
".",
"ibm",
".",
"websphere",
".",
"ras",
".",
"TraceComponent",... | /*
createSession - ensures that a newly generated id is not a duplicate and
also ensures if another thread just created the session, we return it rather
than creating another. | [
"/",
"*",
"createSession",
"-",
"ensures",
"that",
"a",
"newly",
"generated",
"id",
"is",
"not",
"a",
"duplicate",
"and",
"also",
"ensures",
"if",
"another",
"thread",
"just",
"created",
"the",
"session",
"we",
"return",
"it",
"rather",
"than",
"creating",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session.store/src/com/ibm/ws/session/store/common/BackedStore.java#L229-L257 |
thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/keycolumnvalue/KCVSUtil.java | KCVSUtil.get | public static StaticBuffer get(KeyColumnValueStore store, StaticBuffer key, StaticBuffer column, StoreTransaction txh) throws BackendException {
"""
Retrieves the value for the specified column and key under the given transaction
from the store if such exists, otherwise returns NULL
@param store Store
@param... | java | public static StaticBuffer get(KeyColumnValueStore store, StaticBuffer key, StaticBuffer column, StoreTransaction txh) throws BackendException {
KeySliceQuery query = new KeySliceQuery(key, column, BufferUtil.nextBiggerBuffer(column)).setLimit(2);
List<Entry> result = store.getSlice(query, txh);
... | [
"public",
"static",
"StaticBuffer",
"get",
"(",
"KeyColumnValueStore",
"store",
",",
"StaticBuffer",
"key",
",",
"StaticBuffer",
"column",
",",
"StoreTransaction",
"txh",
")",
"throws",
"BackendException",
"{",
"KeySliceQuery",
"query",
"=",
"new",
"KeySliceQuery",
... | Retrieves the value for the specified column and key under the given transaction
from the store if such exists, otherwise returns NULL
@param store Store
@param key Key
@param column Column
@param txh Transaction
@return Value for key and column or NULL if such does not exist | [
"Retrieves",
"the",
"value",
"for",
"the",
"specified",
"column",
"and",
"key",
"under",
"the",
"given",
"transaction",
"from",
"the",
"store",
"if",
"such",
"exists",
"otherwise",
"returns",
"NULL"
] | train | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/keycolumnvalue/KCVSUtil.java#L37-L46 |
apiman/apiman | gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/GatewayServlet.java | GatewayServlet.writeError | protected void writeError(final ApiRequest request, final HttpServletResponse resp, final Throwable error) {
"""
Writes an error to the servlet response object.
@param request
@param resp
@param error
"""
getErrorWriter().write(request, error, new IApiClientResponse() {
@Override
... | java | protected void writeError(final ApiRequest request, final HttpServletResponse resp, final Throwable error) {
getErrorWriter().write(request, error, new IApiClientResponse() {
@Override
public void write(StringBuffer buffer) {
write(buffer.toString());
}
... | [
"protected",
"void",
"writeError",
"(",
"final",
"ApiRequest",
"request",
",",
"final",
"HttpServletResponse",
"resp",
",",
"final",
"Throwable",
"error",
")",
"{",
"getErrorWriter",
"(",
")",
".",
"write",
"(",
"request",
",",
"error",
",",
"new",
"IApiClient... | Writes an error to the servlet response object.
@param request
@param resp
@param error | [
"Writes",
"an",
"error",
"to",
"the",
"servlet",
"response",
"object",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/GatewayServlet.java#L349-L384 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/KeyTable.java | KeyTable.getNodeSetDTMByKey | public XNodeSet getNodeSetDTMByKey(QName name, XMLString ref) {
"""
Given a valid element key, return the corresponding node list.
@param name The name of the key, which must match the 'name' attribute on xsl:key.
@param ref The value that must match the value found by the 'match' attribute on xsl:key.
@retur... | java | public XNodeSet getNodeSetDTMByKey(QName name, XMLString ref)
{
XNodeSet refNodes = (XNodeSet) getRefsTable().get(ref);
// clone wiht reset the node set
try
{
if (refNodes != null)
{
refNodes = (XNodeSet) refNodes.cloneWithReset();
}
}
catch (CloneNotSupportedExcept... | [
"public",
"XNodeSet",
"getNodeSetDTMByKey",
"(",
"QName",
"name",
",",
"XMLString",
"ref",
")",
"{",
"XNodeSet",
"refNodes",
"=",
"(",
"XNodeSet",
")",
"getRefsTable",
"(",
")",
".",
"get",
"(",
"ref",
")",
";",
"// clone wiht reset the node set",
"try",
"{",
... | Given a valid element key, return the corresponding node list.
@param name The name of the key, which must match the 'name' attribute on xsl:key.
@param ref The value that must match the value found by the 'match' attribute on xsl:key.
@return a set of nodes referenced by the key named <CODE>name</CODE> and the refere... | [
"Given",
"a",
"valid",
"element",
"key",
"return",
"the",
"corresponding",
"node",
"list",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/KeyTable.java#L115-L145 |
virgo47/javasimon | console-embed/src/main/java/org/javasimon/console/html/HtmlBuilder.java | HtmlBuilder.simonTypeImg | public T simonTypeImg(SimonType simonType, String rootPath) throws IOException {
"""
Icon image representing Simon Type.
@param simonType Simon Type
@param rootPath Path to root of Simon Console resources
"""
String image = null;
switch (simonType) {
case COUNTER:
image = "TypeCounter.png";
... | java | public T simonTypeImg(SimonType simonType, String rootPath) throws IOException {
String image = null;
switch (simonType) {
case COUNTER:
image = "TypeCounter.png";
break;
case STOPWATCH:
image = "TypeStopwatch.png";
break;
case UNKNOWN:
image = "TypeUnknown.png";
break;
... | [
"public",
"T",
"simonTypeImg",
"(",
"SimonType",
"simonType",
",",
"String",
"rootPath",
")",
"throws",
"IOException",
"{",
"String",
"image",
"=",
"null",
";",
"switch",
"(",
"simonType",
")",
"{",
"case",
"COUNTER",
":",
"image",
"=",
"\"TypeCounter.png\"",
... | Icon image representing Simon Type.
@param simonType Simon Type
@param rootPath Path to root of Simon Console resources | [
"Icon",
"image",
"representing",
"Simon",
"Type",
"."
] | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/console-embed/src/main/java/org/javasimon/console/html/HtmlBuilder.java#L223-L242 |
elki-project/elki | elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/query/range/LinearScanPrimitiveSimilarityRangeQuery.java | LinearScanPrimitiveSimilarityRangeQuery.linearScan | private void linearScan(Relation<? extends O> relation, DBIDIter iter, O obj, double range, ModifiableDoubleDBIDList result) {
"""
Main loop for linear scan,
@param relation Data relation
@param iter Iterator
@param obj Query object
@param range Query radius
@param result Output data structure
"""
w... | java | private void linearScan(Relation<? extends O> relation, DBIDIter iter, O obj, double range, ModifiableDoubleDBIDList result) {
while(iter.valid()) {
final double similarity = rawsim.similarity(obj, relation.get(iter));
if(similarity >= range) {
result.add(similarity, iter);
}
iter.ad... | [
"private",
"void",
"linearScan",
"(",
"Relation",
"<",
"?",
"extends",
"O",
">",
"relation",
",",
"DBIDIter",
"iter",
",",
"O",
"obj",
",",
"double",
"range",
",",
"ModifiableDoubleDBIDList",
"result",
")",
"{",
"while",
"(",
"iter",
".",
"valid",
"(",
"... | Main loop for linear scan,
@param relation Data relation
@param iter Iterator
@param obj Query object
@param range Query radius
@param result Output data structure | [
"Main",
"loop",
"for",
"linear",
"scan"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/query/range/LinearScanPrimitiveSimilarityRangeQuery.java#L98-L106 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java | CPDefinitionOptionRelPersistenceImpl.removeByUUID_G | @Override
public CPDefinitionOptionRel removeByUUID_G(String uuid, long groupId)
throws NoSuchCPDefinitionOptionRelException {
"""
Removes the cp definition option rel where uuid = ? and groupId = ? from the database.
@param uuid the uuid
@param groupId the group ID
@return the cp definition option... | java | @Override
public CPDefinitionOptionRel removeByUUID_G(String uuid, long groupId)
throws NoSuchCPDefinitionOptionRelException {
CPDefinitionOptionRel cpDefinitionOptionRel = findByUUID_G(uuid, groupId);
return remove(cpDefinitionOptionRel);
} | [
"@",
"Override",
"public",
"CPDefinitionOptionRel",
"removeByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchCPDefinitionOptionRelException",
"{",
"CPDefinitionOptionRel",
"cpDefinitionOptionRel",
"=",
"findByUUID_G",
"(",
"uuid",
",",
"group... | Removes the cp definition option rel where uuid = ? and groupId = ? from the database.
@param uuid the uuid
@param groupId the group ID
@return the cp definition option rel that was removed | [
"Removes",
"the",
"cp",
"definition",
"option",
"rel",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java#L817-L823 |
Azure/azure-sdk-for-java | batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/ClustersInner.java | ClustersInner.createAsync | public Observable<ClusterInner> createAsync(String resourceGroupName, String workspaceName, String clusterName, ClusterCreateParameters parameters) {
"""
Creates a Cluster in the given Workspace.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The name of... | java | public Observable<ClusterInner> createAsync(String resourceGroupName, String workspaceName, String clusterName, ClusterCreateParameters parameters) {
return createWithServiceResponseAsync(resourceGroupName, workspaceName, clusterName, parameters).map(new Func1<ServiceResponse<ClusterInner>, ClusterInner>() {
... | [
"public",
"Observable",
"<",
"ClusterInner",
">",
"createAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"workspaceName",
",",
"String",
"clusterName",
",",
"ClusterCreateParameters",
"parameters",
")",
"{",
"return",
"createWithServiceResponseAsync",
"(",
"r... | Creates a Cluster in the given Workspace.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through ... | [
"Creates",
"a",
"Cluster",
"in",
"the",
"given",
"Workspace",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/ClustersInner.java#L625-L632 |
apiman/apiman | manager/api/beans/src/main/java/io/apiman/manager/api/beans/search/SearchCriteriaBean.java | SearchCriteriaBean.addFilter | public void addFilter(String name, String value, SearchCriteriaFilterOperator operator) {
"""
Adds a single filter to the criteria.
@param name the filter name
@param value the filter value
@param operator the operator type
"""
SearchCriteriaFilterBean filter = new SearchCriteriaFilterBean();
... | java | public void addFilter(String name, String value, SearchCriteriaFilterOperator operator) {
SearchCriteriaFilterBean filter = new SearchCriteriaFilterBean();
filter.setName(name);
filter.setValue(value);
filter.setOperator(operator);
filters.add(filter);
} | [
"public",
"void",
"addFilter",
"(",
"String",
"name",
",",
"String",
"value",
",",
"SearchCriteriaFilterOperator",
"operator",
")",
"{",
"SearchCriteriaFilterBean",
"filter",
"=",
"new",
"SearchCriteriaFilterBean",
"(",
")",
";",
"filter",
".",
"setName",
"(",
"na... | Adds a single filter to the criteria.
@param name the filter name
@param value the filter value
@param operator the operator type | [
"Adds",
"a",
"single",
"filter",
"to",
"the",
"criteria",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/beans/src/main/java/io/apiman/manager/api/beans/search/SearchCriteriaBean.java#L47-L53 |
lucee/Lucee | core/src/main/java/lucee/commons/io/compress/CompressUtil.java | CompressUtil.compressTBZ2 | private static void compressTBZ2(Resource[] sources, Resource target, int mode) throws IOException {
"""
compress a source file/directory to a tar/bzip2 file
@param sources
@param target
@param mode
@throws IOException
"""
// File tmpTarget = File.createTempFile("_temp","tmp");
ByteArrayOutputStream ba... | java | private static void compressTBZ2(Resource[] sources, Resource target, int mode) throws IOException {
// File tmpTarget = File.createTempFile("_temp","tmp");
ByteArrayOutputStream baos = new ByteArrayOutputStream();
compressTar(sources, baos, mode);
_compressBZip2(new ByteArrayInputStream(baos.toByteArray()), target... | [
"private",
"static",
"void",
"compressTBZ2",
"(",
"Resource",
"[",
"]",
"sources",
",",
"Resource",
"target",
",",
"int",
"mode",
")",
"throws",
"IOException",
"{",
"// File tmpTarget = File.createTempFile(\"_temp\",\"tmp\");",
"ByteArrayOutputStream",
"baos",
"=",
"new... | compress a source file/directory to a tar/bzip2 file
@param sources
@param target
@param mode
@throws IOException | [
"compress",
"a",
"source",
"file",
"/",
"directory",
"to",
"a",
"tar",
"/",
"bzip2",
"file"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/compress/CompressUtil.java#L396-L402 |
sdl/environment-api | src/main/java/com/fredhopper/lifecycle/AbstractLifeCycle.java | AbstractLifeCycle.publishState | protected void publishState(State from, State to) throws Exception {
"""
Propagates a change of {@link State} to all the
{@link StateListener}registered with this life cycle
object.
@see #changeState(State, State)
@param from the old state
@param to the new state
@throws Exception if a listener fails to ... | java | protected void publishState(State from, State to) throws Exception {
final Collection<StateListener> listeners = getStateListeners();
synchronized (listeners) {
for (StateListener listener : listeners) {
listener.stateChanged(from, to);
}
}
} | [
"protected",
"void",
"publishState",
"(",
"State",
"from",
",",
"State",
"to",
")",
"throws",
"Exception",
"{",
"final",
"Collection",
"<",
"StateListener",
">",
"listeners",
"=",
"getStateListeners",
"(",
")",
";",
"synchronized",
"(",
"listeners",
")",
"{",
... | Propagates a change of {@link State} to all the
{@link StateListener}registered with this life cycle
object.
@see #changeState(State, State)
@param from the old state
@param to the new state
@throws Exception if a listener fails to accept the change | [
"Propagates",
"a",
"change",
"of",
"{",
"@link",
"State",
"}",
"to",
"all",
"the",
"{",
"@link",
"StateListener",
"}",
"registered",
"with",
"this",
"life",
"cycle",
"object",
"."
] | train | https://github.com/sdl/environment-api/blob/7ec346022675a21fec301f88ab2856acd1201f7d/src/main/java/com/fredhopper/lifecycle/AbstractLifeCycle.java#L110-L117 |
UrielCh/ovh-java-sdk | ovh-java-sdk-vps/src/main/java/net/minidev/ovh/api/ApiOvhVps.java | ApiOvhVps.serviceName_models_GET | public ArrayList<OvhModel> serviceName_models_GET(String serviceName) throws IOException {
"""
Return all models for the range of the virtual server
REST: GET /vps/{serviceName}/models
@param serviceName [required] The internal name of your VPS offer
"""
String qPath = "/vps/{serviceName}/models";
Stri... | java | public ArrayList<OvhModel> serviceName_models_GET(String serviceName) throws IOException {
String qPath = "/vps/{serviceName}/models";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t6);
} | [
"public",
"ArrayList",
"<",
"OvhModel",
">",
"serviceName_models_GET",
"(",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/vps/{serviceName}/models\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"serviceName"... | Return all models for the range of the virtual server
REST: GET /vps/{serviceName}/models
@param serviceName [required] The internal name of your VPS offer | [
"Return",
"all",
"models",
"for",
"the",
"range",
"of",
"the",
"virtual",
"server"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-vps/src/main/java/net/minidev/ovh/api/ApiOvhVps.java#L1023-L1028 |
sarxos/webcam-capture | webcam-capture/src/main/java/com/github/sarxos/webcam/WebcamMotionDetectorDefaultAlgorithm.java | WebcamMotionDetectorDefaultAlgorithm.isInDoNotEngageZone | private boolean isInDoNotEngageZone(final int x, final int y) {
"""
Return true if point identified by x and y coordinates is in one of the do-not-engage zones.
Return false otherwise.
@param x the x coordinate of a point
@param y the y coordinate of a point
@return True if point is in one of do-not-engage z... | java | private boolean isInDoNotEngageZone(final int x, final int y) {
for (final Rectangle zone : doNotEnganeZones) {
if (zone.contains(x, y)) {
return true;
}
}
return false;
} | [
"private",
"boolean",
"isInDoNotEngageZone",
"(",
"final",
"int",
"x",
",",
"final",
"int",
"y",
")",
"{",
"for",
"(",
"final",
"Rectangle",
"zone",
":",
"doNotEnganeZones",
")",
"{",
"if",
"(",
"zone",
".",
"contains",
"(",
"x",
",",
"y",
")",
")",
... | Return true if point identified by x and y coordinates is in one of the do-not-engage zones.
Return false otherwise.
@param x the x coordinate of a point
@param y the y coordinate of a point
@return True if point is in one of do-not-engage zones, false otherwise | [
"Return",
"true",
"if",
"point",
"identified",
"by",
"x",
"and",
"y",
"coordinates",
"is",
"in",
"one",
"of",
"the",
"do",
"-",
"not",
"-",
"engage",
"zones",
".",
"Return",
"false",
"otherwise",
"."
] | train | https://github.com/sarxos/webcam-capture/blob/efbdae04f9ba48db9ec621e94a9bcd6f031882c8/webcam-capture/src/main/java/com/github/sarxos/webcam/WebcamMotionDetectorDefaultAlgorithm.java#L182-L189 |
bbossgroups/bboss-elasticsearch | bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/BucketPath.java | BucketPath.replaceShorthand | @Deprecated
public static String replaceShorthand(char c, Map<String, String> headers) {
"""
Hardcoded lookups for %x style escape replacement. Add your own!
All shorthands are Date format strings, currently.
Returns the empty string if an escape is not recognized.
Dates follow the same format as unix d... | java | @Deprecated
public static String replaceShorthand(char c, Map<String, String> headers) {
return replaceShorthand(c, headers, false, 0, 0);
} | [
"@",
"Deprecated",
"public",
"static",
"String",
"replaceShorthand",
"(",
"char",
"c",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
")",
"{",
"return",
"replaceShorthand",
"(",
"c",
",",
"headers",
",",
"false",
",",
"0",
",",
"0",
")",
";... | Hardcoded lookups for %x style escape replacement. Add your own!
All shorthands are Date format strings, currently.
Returns the empty string if an escape is not recognized.
Dates follow the same format as unix date, with a few exceptions.
<p>This static method will be REMOVED in a future version of Flume</p> | [
"Hardcoded",
"lookups",
"for",
"%x",
"style",
"escape",
"replacement",
".",
"Add",
"your",
"own!"
] | train | https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/BucketPath.java#L124-L127 |
interedition/collatex | collatex-core/src/main/java/eu/interedition/collatex/suffixarray/BPR.java | BPR.computeBucketSize2_SaBucket | private void computeBucketSize2_SaBucket(int leftPtr, int rightPtr, int offset, int q) {
"""
Completely sorts buckets of size 2.
@param leftPtr points to the leftmost suffix of the current bucket.
@param rightPtr points to the rightmost suffix of the current bucket.
@param offset is the length of the commo... | java | private void computeBucketSize2_SaBucket(int leftPtr, int rightPtr, int offset, int q) {
int suffix1 = suffixArray[leftPtr] + offset;
int suffix2 = suffixArray[rightPtr] + offset;
while (sufPtrMap[suffix1] == sufPtrMap[suffix2]) {
suffix1 += q;
suffix2 += q;
}
... | [
"private",
"void",
"computeBucketSize2_SaBucket",
"(",
"int",
"leftPtr",
",",
"int",
"rightPtr",
",",
"int",
"offset",
",",
"int",
"q",
")",
"{",
"int",
"suffix1",
"=",
"suffixArray",
"[",
"leftPtr",
"]",
"+",
"offset",
";",
"int",
"suffix2",
"=",
"suffixA... | Completely sorts buckets of size 2.
@param leftPtr points to the leftmost suffix of the current bucket.
@param rightPtr points to the rightmost suffix of the current bucket.
@param offset is the length of the common prefix of the suffixes rounded down to a
multiple of q.
@param q is the initial prefix length... | [
"Completely",
"sorts",
"buckets",
"of",
"size",
"2",
"."
] | train | https://github.com/interedition/collatex/blob/76dd1fcc36047bc66a87d31142e72e98b5347821/collatex-core/src/main/java/eu/interedition/collatex/suffixarray/BPR.java#L523-L538 |
jboss-integration/fuse-bxms-integ | switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/operation/KnowledgeOperations.java | KnowledgeOperations.getInput | public static Object getInput(Message message, KnowledgeOperation operation, KnowledgeRuntimeEngine runtime) {
"""
Gets the input.
@param message the message
@param operation the operation
@param runtime the runtime engine
@return the input
"""
List<Object> list = getList(message, operation.getIn... | java | public static Object getInput(Message message, KnowledgeOperation operation, KnowledgeRuntimeEngine runtime) {
List<Object> list = getList(message, operation.getInputExpressionMappings());
switch (list.size()) {
case 0:
return filterRemoteDefaultInputContent(message.getContent(), run... | [
"public",
"static",
"Object",
"getInput",
"(",
"Message",
"message",
",",
"KnowledgeOperation",
"operation",
",",
"KnowledgeRuntimeEngine",
"runtime",
")",
"{",
"List",
"<",
"Object",
">",
"list",
"=",
"getList",
"(",
"message",
",",
"operation",
".",
"getInputE... | Gets the input.
@param message the message
@param operation the operation
@param runtime the runtime engine
@return the input | [
"Gets",
"the",
"input",
"."
] | train | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/operation/KnowledgeOperations.java#L172-L182 |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Get.java | Get.tableCell | public Element tableCell(int rowNum, int colNum) {
"""
Retrieves a specific cell from the element. If the element isn't present
or a table, or the row and cell combination doesn't exist, a null value
will be returned.
@param rowNum - the number of the row in the table - note, row numbering
starts at 0
@para... | java | public Element tableCell(int rowNum, int colNum) {
Element row = tableRow(rowNum);
if (row == null || numOfTableColumns() < colNum) {
return null;
}
Element thCells = row.findChild(app.newElement(Locator.TAGNAME, "th"));
Element tdCells = row.findChild(app.newElement(... | [
"public",
"Element",
"tableCell",
"(",
"int",
"rowNum",
",",
"int",
"colNum",
")",
"{",
"Element",
"row",
"=",
"tableRow",
"(",
"rowNum",
")",
";",
"if",
"(",
"row",
"==",
"null",
"||",
"numOfTableColumns",
"(",
")",
"<",
"colNum",
")",
"{",
"return",
... | Retrieves a specific cell from the element. If the element isn't present
or a table, or the row and cell combination doesn't exist, a null value
will be returned.
@param rowNum - the number of the row in the table - note, row numbering
starts at 0
@param colNum - the number of the column in the table - note, column
nu... | [
"Retrieves",
"a",
"specific",
"cell",
"from",
"the",
"element",
".",
"If",
"the",
"element",
"isn",
"t",
"present",
"or",
"a",
"table",
"or",
"the",
"row",
"and",
"cell",
"combination",
"doesn",
"t",
"exist",
"a",
"null",
"value",
"will",
"be",
"returned... | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Get.java#L411-L423 |
BotMill/fb-botmill | src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/ReplyFactory.java | ReplyFactory.getReusableFileAttachment | public static AttachmentMessageBuilder getReusableFileAttachment(String attachmentId) {
"""
Get the reusable file attachment
@param attachmentId
the attachment id generated by the upload api
@return a builder for the response.
@see <a href=
"https://developers.facebook.com/docs/messenger-platform/send-api-r... | java | public static AttachmentMessageBuilder getReusableFileAttachment(String attachmentId) {
AttachmentPayload payload = new AttachmentPayload();
payload.setAttachmentId(attachmentId);
return new AttachmentMessageBuilder(AttachmentType.VIDEO, payload);
} | [
"public",
"static",
"AttachmentMessageBuilder",
"getReusableFileAttachment",
"(",
"String",
"attachmentId",
")",
"{",
"AttachmentPayload",
"payload",
"=",
"new",
"AttachmentPayload",
"(",
")",
";",
"payload",
".",
"setAttachmentId",
"(",
"attachmentId",
")",
";",
"ret... | Get the reusable file attachment
@param attachmentId
the attachment id generated by the upload api
@return a builder for the response.
@see <a href=
"https://developers.facebook.com/docs/messenger-platform/send-api-reference/file-attachment"
> Facebook's Messenger Platform File Attachment Documentation</a> | [
"Get",
"the",
"reusable",
"file",
"attachment"
] | train | https://github.com/BotMill/fb-botmill/blob/d94da3615a7339822c137ef75c92a03d791ee969/src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/ReplyFactory.java#L229-L233 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/authorization/AclsUtil.java | AclsUtil.append | public static Authorization append(Authorization a, Authorization b) {
"""
Merge to authorization resources
@param a authorization
@param b authorization
@return a new Authorization that merges both authorization a and b
"""
if (a instanceof AclRuleSetSource && b instanceof AclRuleSetSource) {
... | java | public static Authorization append(Authorization a, Authorization b) {
if (a instanceof AclRuleSetSource && b instanceof AclRuleSetSource) {
return RuleEvaluator.createRuleEvaluator(
merge((AclRuleSetSource) a, (AclRuleSetSource) b)
);
}
return new Mul... | [
"public",
"static",
"Authorization",
"append",
"(",
"Authorization",
"a",
",",
"Authorization",
"b",
")",
"{",
"if",
"(",
"a",
"instanceof",
"AclRuleSetSource",
"&&",
"b",
"instanceof",
"AclRuleSetSource",
")",
"{",
"return",
"RuleEvaluator",
".",
"createRuleEvalu... | Merge to authorization resources
@param a authorization
@param b authorization
@return a new Authorization that merges both authorization a and b | [
"Merge",
"to",
"authorization",
"resources"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/authorization/AclsUtil.java#L54-L61 |
dnsjava/dnsjava | org/xbill/DNS/Record.java | Record.newRecord | public static Record
newRecord(Name name, int type, int dclass, long ttl) {
"""
Creates a new empty record, with the given parameters.
@param name The owner name of the record.
@param type The record's type.
@param dclass The record's class.
@param ttl The record's time to live.
@return An object of a subclas... | java | public static Record
newRecord(Name name, int type, int dclass, long ttl) {
if (!name.isAbsolute())
throw new RelativeNameException(name);
Type.check(type);
DClass.check(dclass);
TTL.check(ttl);
return getEmptyRecord(name, type, dclass, ttl, false);
} | [
"public",
"static",
"Record",
"newRecord",
"(",
"Name",
"name",
",",
"int",
"type",
",",
"int",
"dclass",
",",
"long",
"ttl",
")",
"{",
"if",
"(",
"!",
"name",
".",
"isAbsolute",
"(",
")",
")",
"throw",
"new",
"RelativeNameException",
"(",
"name",
")",... | Creates a new empty record, with the given parameters.
@param name The owner name of the record.
@param type The record's type.
@param dclass The record's class.
@param ttl The record's time to live.
@return An object of a subclass of Record | [
"Creates",
"a",
"new",
"empty",
"record",
"with",
"the",
"given",
"parameters",
"."
] | train | https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Record.java#L150-L159 |
dbracewell/hermes | hermes-core/src/main/java/com/davidbracewell/hermes/DocumentFactory.java | DocumentFactory.fromTokens | public Document fromTokens(@NonNull Iterable<String> tokens, @NonNull Language language) {
"""
Creates a document from the given tokens. The language parameter controls how the content of the documents is
created. If the language has whitespace tokens are joined with a single space between them, otherwise no spac... | java | public Document fromTokens(@NonNull Iterable<String> tokens, @NonNull Language language) {
StringBuilder content = new StringBuilder();
List<Span> tokenSpans = new ArrayList<>();
for (String token : tokens) {
tokenSpans.add(new Span(content.length(), content.length() + token.length()));
... | [
"public",
"Document",
"fromTokens",
"(",
"@",
"NonNull",
"Iterable",
"<",
"String",
">",
"tokens",
",",
"@",
"NonNull",
"Language",
"language",
")",
"{",
"StringBuilder",
"content",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"List",
"<",
"Span",
">",
"tok... | Creates a document from the given tokens. The language parameter controls how the content of the documents is
created. If the language has whitespace tokens are joined with a single space between them, otherwise no space is
inserted between tokens.
@param tokens the tokens
@param language the language
@return the do... | [
"Creates",
"a",
"document",
"from",
"the",
"given",
"tokens",
".",
"The",
"language",
"parameter",
"controls",
"how",
"the",
"content",
"of",
"the",
"documents",
"is",
"created",
".",
"If",
"the",
"language",
"has",
"whitespace",
"tokens",
"are",
"joined",
"... | train | https://github.com/dbracewell/hermes/blob/9ebefe7ad5dea1b731ae6931a30771eb75325ea3/hermes-core/src/main/java/com/davidbracewell/hermes/DocumentFactory.java#L277-L296 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/transformer/AbstractObservableTransformer.java | AbstractObservableTransformer.onTransformerErrorOccurred | protected void onTransformerErrorOccurred(Source failedObject, Exception exception) {
"""
Called when an exception occurred. Fires the ErrorOccured event.
@param failedObject The input object that caused the error.
@param exception The exception that was thrown by the Transformation.
"""
for (Transf... | java | protected void onTransformerErrorOccurred(Source failedObject, Exception exception) {
for (TransformerEventListener listener : transformerEventListeners)
fireErrorEvent(listener, new TransformerErrorEvent(this, failedObject, exception));
}
/**
* (Re)-fires a preconstructed event.
... | [
"protected",
"void",
"onTransformerErrorOccurred",
"(",
"Source",
"failedObject",
",",
"Exception",
"exception",
")",
"{",
"for",
"(",
"TransformerEventListener",
"listener",
":",
"transformerEventListeners",
")",
"fireErrorEvent",
"(",
"listener",
",",
"new",
"Transfor... | Called when an exception occurred. Fires the ErrorOccured event.
@param failedObject The input object that caused the error.
@param exception The exception that was thrown by the Transformation. | [
"Called",
"when",
"an",
"exception",
"occurred",
".",
"Fires",
"the",
"ErrorOccured",
"event",
"."
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/transformer/AbstractObservableTransformer.java#L67-L99 |
fernandospr/javapns-jdk16 | src/main/java/javapns/Push.java | Push.payloads | public static PushedNotifications payloads(Object keystore, String password, boolean production, int numberOfThreads, Object payloadDevicePairs) throws Exception {
"""
Push a different preformatted payload for each device using multiple simulatenous threads (and connections).
@param keystore a keystore containi... | java | public static PushedNotifications payloads(Object keystore, String password, boolean production, int numberOfThreads, Object payloadDevicePairs) throws Exception {
if (numberOfThreads <= 0) return sendPayloads(keystore, password, production, payloadDevicePairs);
AppleNotificationServer server = new AppleNotificatio... | [
"public",
"static",
"PushedNotifications",
"payloads",
"(",
"Object",
"keystore",
",",
"String",
"password",
",",
"boolean",
"production",
",",
"int",
"numberOfThreads",
",",
"Object",
"payloadDevicePairs",
")",
"throws",
"Exception",
"{",
"if",
"(",
"numberOfThread... | Push a different preformatted payload for each device using multiple simulatenous threads (and connections).
@param keystore a keystore containing your private key and the certificate signed by Apple ({@link java.io.File}, {@link java.io.InputStream}, byte[], {@link java.security.KeyStore} or {@link java.lang.String} ... | [
"Push",
"a",
"different",
"preformatted",
"payload",
"for",
"each",
"device",
"using",
"multiple",
"simulatenous",
"threads",
"(",
"and",
"connections",
")",
"."
] | train | https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/Push.java#L266-L277 |
dbracewell/mango | src/main/java/com/davidbracewell/string/StringUtils.java | StringUtils.randomString | public static String randomString(int length, @NonNull CharMatcher validChar) {
"""
Generates a random string of a given length
@param length The length of the string
@param validChar CharPredicate that must match for a character to be returned in the string
@return A string of random characters
"""
... | java | public static String randomString(int length, @NonNull CharMatcher validChar) {
return randomString(length, 0, Integer.MAX_VALUE, validChar);
} | [
"public",
"static",
"String",
"randomString",
"(",
"int",
"length",
",",
"@",
"NonNull",
"CharMatcher",
"validChar",
")",
"{",
"return",
"randomString",
"(",
"length",
",",
"0",
",",
"Integer",
".",
"MAX_VALUE",
",",
"validChar",
")",
";",
"}"
] | Generates a random string of a given length
@param length The length of the string
@param validChar CharPredicate that must match for a character to be returned in the string
@return A string of random characters | [
"Generates",
"a",
"random",
"string",
"of",
"a",
"given",
"length"
] | train | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/string/StringUtils.java#L388-L390 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.license_plesk_serviceName_upgrade_duration_POST | public OvhOrder license_plesk_serviceName_upgrade_duration_POST(String serviceName, String duration, OvhOrderableAntispamEnum antispam, OvhOrderableAntivirusEnum antivirus, OvhPleskApplicationSetEnum applicationSet, OvhOrderablePleskDomainNumberEnum domainNumber, OvhOrderablePleskLanguagePackEnum languagePackNumber, Bo... | java | public OvhOrder license_plesk_serviceName_upgrade_duration_POST(String serviceName, String duration, OvhOrderableAntispamEnum antispam, OvhOrderableAntivirusEnum antivirus, OvhPleskApplicationSetEnum applicationSet, OvhOrderablePleskDomainNumberEnum domainNumber, OvhOrderablePleskLanguagePackEnum languagePackNumber, Bo... | [
"public",
"OvhOrder",
"license_plesk_serviceName_upgrade_duration_POST",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"OvhOrderableAntispamEnum",
"antispam",
",",
"OvhOrderableAntivirusEnum",
"antivirus",
",",
"OvhPleskApplicationSetEnum",
"applicationSet",
",",
... | Create order
REST: POST /order/license/plesk/{serviceName}/upgrade/{duration}
@param antispam [required] The antispam currently enabled on this Plesk License
@param resellerManagement [required] Reseller management option activation
@param languagePackNumber [required] The amount (between 0 and 5) of language pack num... | [
"Create",
"order"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L1927-L1942 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/ConfigurationUtils.java | ConfigurationUtils.getJobMasterRpcAddresses | public static List<InetSocketAddress> getJobMasterRpcAddresses(AlluxioConfiguration conf) {
"""
Gets the RPC addresses of all job masters based on the configuration.
@param conf the configuration to use
@return the job master rpc addresses
"""
// First check whether job rpc addresses are explicitly con... | java | public static List<InetSocketAddress> getJobMasterRpcAddresses(AlluxioConfiguration conf) {
// First check whether job rpc addresses are explicitly configured.
if (conf.isSet(PropertyKey.JOB_MASTER_RPC_ADDRESSES)) {
return parseInetSocketAddresses(
conf.getList(PropertyKey.JOB_MASTER_RPC_ADDRESS... | [
"public",
"static",
"List",
"<",
"InetSocketAddress",
">",
"getJobMasterRpcAddresses",
"(",
"AlluxioConfiguration",
"conf",
")",
"{",
"// First check whether job rpc addresses are explicitly configured.",
"if",
"(",
"conf",
".",
"isSet",
"(",
"PropertyKey",
".",
"JOB_MASTER... | Gets the RPC addresses of all job masters based on the configuration.
@param conf the configuration to use
@return the job master rpc addresses | [
"Gets",
"the",
"RPC",
"addresses",
"of",
"all",
"job",
"masters",
"based",
"on",
"the",
"configuration",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ConfigurationUtils.java#L153-L171 |
lucee/Lucee | core/src/main/java/lucee/runtime/config/ConfigWebUtil.java | ConfigWebUtil.deployWeb | public static void deployWeb(ConfigServer cs, ConfigWeb cw, boolean throwError) throws IOException {
"""
deploys all content in "web-deployment" to a web context, used for new context mostly or update
existings
@param cs
@param cw
@param throwError
@throws IOException
"""
Resource deploy = cs.getConfig... | java | public static void deployWeb(ConfigServer cs, ConfigWeb cw, boolean throwError) throws IOException {
Resource deploy = cs.getConfigDir().getRealResource("web-deployment"), trg;
if (!deploy.isDirectory()) return;
trg = cw.getRootDirectory();
try {
_deploy(cw, deploy, trg);
}
catch (IOException ioe) {
if... | [
"public",
"static",
"void",
"deployWeb",
"(",
"ConfigServer",
"cs",
",",
"ConfigWeb",
"cw",
",",
"boolean",
"throwError",
")",
"throws",
"IOException",
"{",
"Resource",
"deploy",
"=",
"cs",
".",
"getConfigDir",
"(",
")",
".",
"getRealResource",
"(",
"\"web-dep... | deploys all content in "web-deployment" to a web context, used for new context mostly or update
existings
@param cs
@param cw
@param throwError
@throws IOException | [
"deploys",
"all",
"content",
"in",
"web",
"-",
"deployment",
"to",
"a",
"web",
"context",
"used",
"for",
"new",
"context",
"mostly",
"or",
"update",
"existings"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/ConfigWebUtil.java#L107-L119 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/renderer/animation/transformation/Translation.java | Translation.from | public Translation from(float x, float y, float z) {
"""
Sets the starting point of this {@link Translation}.
@param x the x
@param y the y
@param z the z
@return the translation
"""
fromX = x;
fromY = y;
fromZ = z;
return this;
} | java | public Translation from(float x, float y, float z)
{
fromX = x;
fromY = y;
fromZ = z;
return this;
} | [
"public",
"Translation",
"from",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"fromX",
"=",
"x",
";",
"fromY",
"=",
"y",
";",
"fromZ",
"=",
"z",
";",
"return",
"this",
";",
"}"
] | Sets the starting point of this {@link Translation}.
@param x the x
@param y the y
@param z the z
@return the translation | [
"Sets",
"the",
"starting",
"point",
"of",
"this",
"{",
"@link",
"Translation",
"}",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/animation/transformation/Translation.java#L81-L87 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/util/EventListeners.java | EventListeners.fireEvent | public final void fireEvent(EventObject evt, EventListenerV visitor) {
"""
Fire the event to all listeners by allowing the visitor
to visit each listener. The visitor is responsible for
implementing the actual firing of the event to each listener.
"""
EventListener[] list = getListenerArray();
... | java | public final void fireEvent(EventObject evt, EventListenerV visitor){
EventListener[] list = getListenerArray();
for(int i=0; i<list.length; i++){
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE))
logger.logp(Level.FINE, CLASS_NAME,"fireEvent", ... | [
"public",
"final",
"void",
"fireEvent",
"(",
"EventObject",
"evt",
",",
"EventListenerV",
"visitor",
")",
"{",
"EventListener",
"[",
"]",
"list",
"=",
"getListenerArray",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"list",
".",
"len... | Fire the event to all listeners by allowing the visitor
to visit each listener. The visitor is responsible for
implementing the actual firing of the event to each listener. | [
"Fire",
"the",
"event",
"to",
"all",
"listeners",
"by",
"allowing",
"the",
"visitor",
"to",
"visit",
"each",
"listener",
".",
"The",
"visitor",
"is",
"responsible",
"for",
"implementing",
"the",
"actual",
"firing",
"of",
"the",
"event",
"to",
"each",
"listen... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/util/EventListeners.java#L52-L59 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Table.java | Table.deleteNoCheck | private void deleteNoCheck(Session session, Row row) {
"""
Low level row delete method. Removes the row from the indexes and
from the Cache.
"""
if (row.isDeleted(session)) {
return;
}
session.addDeleteAction(this, row);
} | java | private void deleteNoCheck(Session session, Row row) {
if (row.isDeleted(session)) {
return;
}
session.addDeleteAction(this, row);
} | [
"private",
"void",
"deleteNoCheck",
"(",
"Session",
"session",
",",
"Row",
"row",
")",
"{",
"if",
"(",
"row",
".",
"isDeleted",
"(",
"session",
")",
")",
"{",
"return",
";",
"}",
"session",
".",
"addDeleteAction",
"(",
"this",
",",
"row",
")",
";",
"... | Low level row delete method. Removes the row from the indexes and
from the Cache. | [
"Low",
"level",
"row",
"delete",
"method",
".",
"Removes",
"the",
"row",
"from",
"the",
"indexes",
"and",
"from",
"the",
"Cache",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Table.java#L2451-L2458 |
PureSolTechnologies/parsers | parsers/src/main/java/com/puresoltechnologies/parsers/parser/packrat/PackratMemo.java | PackratMemo.setMemo | void setMemo(String production, int position, int line, final MemoEntry stackElement) {
"""
This method puts memozation elements into the buffer. It is designed in a
way, that entries, once set, are not changed anymore. This is needed not to
break references!
@param production
@param position
@param stackEl... | java | void setMemo(String production, int position, int line, final MemoEntry stackElement) {
Map<String, MemoEntry> map = memo.get(position);
if (map == null) {
map = new HashMap<String, MemoEntry>();
memo.put(position, map);
map.put(production, stackElement);
} else {
if (map.containsKey(production))... | [
"void",
"setMemo",
"(",
"String",
"production",
",",
"int",
"position",
",",
"int",
"line",
",",
"final",
"MemoEntry",
"stackElement",
")",
"{",
"Map",
"<",
"String",
",",
"MemoEntry",
">",
"map",
"=",
"memo",
".",
"get",
"(",
"position",
")",
";",
"if... | This method puts memozation elements into the buffer. It is designed in a
way, that entries, once set, are not changed anymore. This is needed not to
break references!
@param production
@param position
@param stackElement | [
"This",
"method",
"puts",
"memozation",
"elements",
"into",
"the",
"buffer",
".",
"It",
"is",
"designed",
"in",
"a",
"way",
"that",
"entries",
"once",
"set",
"are",
"not",
"changed",
"anymore",
".",
"This",
"is",
"needed",
"not",
"to",
"break",
"references... | train | https://github.com/PureSolTechnologies/parsers/blob/61077223b90d3768ff9445ae13036343c98b63cd/parsers/src/main/java/com/puresoltechnologies/parsers/parser/packrat/PackratMemo.java#L58-L70 |
Syncleus/aparapi | src/main/java/com/aparapi/internal/opencl/OpenCLKernel.java | OpenCLKernel.createKernel | public static OpenCLKernel createKernel(OpenCLProgram _program, String _kernelName, List<OpenCLArgDescriptor> _args) {
"""
This method is used to create a new Kernel from JNI
@param _program
@param _kernelName
@param _args
@return
"""
final OpenCLArgDescriptor[] argArray = _args.toArray(new OpenCLA... | java | public static OpenCLKernel createKernel(OpenCLProgram _program, String _kernelName, List<OpenCLArgDescriptor> _args) {
final OpenCLArgDescriptor[] argArray = _args.toArray(new OpenCLArgDescriptor[0]);
final OpenCLKernel oclk = new OpenCLKernel().createKernelJNI(_program, _kernelName, argArray);
for (f... | [
"public",
"static",
"OpenCLKernel",
"createKernel",
"(",
"OpenCLProgram",
"_program",
",",
"String",
"_kernelName",
",",
"List",
"<",
"OpenCLArgDescriptor",
">",
"_args",
")",
"{",
"final",
"OpenCLArgDescriptor",
"[",
"]",
"argArray",
"=",
"_args",
".",
"toArray",... | This method is used to create a new Kernel from JNI
@param _program
@param _kernelName
@param _args
@return | [
"This",
"method",
"is",
"used",
"to",
"create",
"a",
"new",
"Kernel",
"from",
"JNI"
] | train | https://github.com/Syncleus/aparapi/blob/6d5892c8e69854b3968c541023de37cf4762bd24/src/main/java/com/aparapi/internal/opencl/OpenCLKernel.java#L58-L65 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATConsumer.java | CATConsumer.readSet | public void readSet(int requestNumber, SIMessageHandle[] msgHandles) {
"""
This method should be handled by the appropriate subclass
@param requestNumber
@param msgIds
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "readSet",
... | java | public void readSet(int requestNumber, SIMessageHandle[] msgHandles)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "readSet",
new Object[]{requestNumber, msgHandles});
SIErrorException e = new SIErrorException(
... | [
"public",
"void",
"readSet",
"(",
"int",
"requestNumber",
",",
"SIMessageHandle",
"[",
"]",
"msgHandles",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
... | This method should be handled by the appropriate subclass
@param requestNumber
@param msgIds | [
"This",
"method",
"should",
"be",
"handled",
"by",
"the",
"appropriate",
"subclass"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATConsumer.java#L491-L510 |
overturetool/overture | ide/debug/src/main/java/org/overture/ide/debug/core/launching/VdmLaunchConfigurationDelegate.java | VdmLaunchConfigurationDelegate.prepareCustomOvertureProperties | public static File prepareCustomOvertureProperties(IVdmProject project,
ILaunchConfiguration configuration) throws CoreException {
"""
Create the custom overture.properties file loaded by the debugger
@param project
@param configuration a configuration or null
@return
@throws CoreException
"""
List<St... | java | public static File prepareCustomOvertureProperties(IVdmProject project,
ILaunchConfiguration configuration) throws CoreException
{
List<String> properties = new Vector<String>();
if (VdmDebugPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DBGP_ENABLE_EXPERIMENTAL_MODELCHECKER... | [
"public",
"static",
"File",
"prepareCustomOvertureProperties",
"(",
"IVdmProject",
"project",
",",
"ILaunchConfiguration",
"configuration",
")",
"throws",
"CoreException",
"{",
"List",
"<",
"String",
">",
"properties",
"=",
"new",
"Vector",
"<",
"String",
">",
"(",
... | Create the custom overture.properties file loaded by the debugger
@param project
@param configuration a configuration or null
@return
@throws CoreException | [
"Create",
"the",
"custom",
"overture",
".",
"properties",
"file",
"loaded",
"by",
"the",
"debugger"
] | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/ide/debug/src/main/java/org/overture/ide/debug/core/launching/VdmLaunchConfigurationDelegate.java#L370-L381 |
apereo/cas | api/cas-server-core-api-util/src/main/java/org/apereo/cas/DistributedCacheObject.java | DistributedCacheObject.getProperty | public <T> T getProperty(final String name, final Class<T> clazz) {
"""
Gets property.
@param <T> the type parameter
@param name the name
@param clazz the clazz
@return the property
"""
if (containsProperty(name)) {
val item = this.properties.get(name);
if (item == null... | java | public <T> T getProperty(final String name, final Class<T> clazz) {
if (containsProperty(name)) {
val item = this.properties.get(name);
if (item == null) {
return null;
}
if (!clazz.isAssignableFrom(item.getClass())) {
throw new Cla... | [
"public",
"<",
"T",
">",
"T",
"getProperty",
"(",
"final",
"String",
"name",
",",
"final",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"if",
"(",
"containsProperty",
"(",
"name",
")",
")",
"{",
"val",
"item",
"=",
"this",
".",
"properties",
".",
"ge... | Gets property.
@param <T> the type parameter
@param name the name
@param clazz the clazz
@return the property | [
"Gets",
"property",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/api/cas-server-core-api-util/src/main/java/org/apereo/cas/DistributedCacheObject.java#L44-L56 |
EdwardRaff/JSAT | JSAT/src/jsat/utils/IntPriorityQueue.java | IntPriorityQueue.indexArrayStore | private void indexArrayStore(int e, int i) {
"""
Sets the given index to use the specific value
@param e the value to store the index of
@param i the index of the value
"""
if (valueIndexStore.length < e)
{
int oldLength = valueIndexStore.length;
valueIndexStore = Arra... | java | private void indexArrayStore(int e, int i)
{
if (valueIndexStore.length < e)
{
int oldLength = valueIndexStore.length;
valueIndexStore = Arrays.copyOf(valueIndexStore, e + 2);
Arrays.fill(valueIndexStore, oldLength, valueIndexStore.length, -1);
}
v... | [
"private",
"void",
"indexArrayStore",
"(",
"int",
"e",
",",
"int",
"i",
")",
"{",
"if",
"(",
"valueIndexStore",
".",
"length",
"<",
"e",
")",
"{",
"int",
"oldLength",
"=",
"valueIndexStore",
".",
"length",
";",
"valueIndexStore",
"=",
"Arrays",
".",
"cop... | Sets the given index to use the specific value
@param e the value to store the index of
@param i the index of the value | [
"Sets",
"the",
"given",
"index",
"to",
"use",
"the",
"specific",
"value"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/utils/IntPriorityQueue.java#L214-L223 |
WolfgangFahl/Mediawiki-Japi | src/main/java/com/bitplan/mediawiki/japi/Mediawiki.java | Mediawiki.getActionResult | public Api getActionResult(String action, String params, TokenResult token,
Object pFormData) throws Exception {
"""
get the action result for the default format
@param action
@param params
@param token
@param pFormData
@return - the action result
@throws Exception
"""
return getActionResult(... | java | public Api getActionResult(String action, String params, TokenResult token,
Object pFormData) throws Exception {
return getActionResult(action, params, token, pFormData, format);
} | [
"public",
"Api",
"getActionResult",
"(",
"String",
"action",
",",
"String",
"params",
",",
"TokenResult",
"token",
",",
"Object",
"pFormData",
")",
"throws",
"Exception",
"{",
"return",
"getActionResult",
"(",
"action",
",",
"params",
",",
"token",
",",
"pForm... | get the action result for the default format
@param action
@param params
@param token
@param pFormData
@return - the action result
@throws Exception | [
"get",
"the",
"action",
"result",
"for",
"the",
"default",
"format"
] | train | https://github.com/WolfgangFahl/Mediawiki-Japi/blob/78d0177ebfe02eb05da5550839727861f1e888a5/src/main/java/com/bitplan/mediawiki/japi/Mediawiki.java#L468-L471 |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/resolution/UnresolvedBindingValidator.java | UnresolvedBindingValidator.getInvalidKeys | public InvalidKeys getInvalidKeys(DependencyExplorerOutput output) {
"""
Returns an {@link InvalidKeys} object containing information about all the errors that we
discovered in required keys, and the set of all optional bindings that should be removed from
the graph in order to make it valid.
"""
Map<Key... | java | public InvalidKeys getInvalidKeys(DependencyExplorerOutput output) {
Map<Key<?>, String> allInvalidKeys = getAllInvalidKeys(output);
Set<Key<?>> optionalInvalidKeys = removeOptionalKeys(output, allInvalidKeys);
optionalInvalidKeys = getKeysToRemove(output.getGraph(), optionalInvalidKeys);
return new Inv... | [
"public",
"InvalidKeys",
"getInvalidKeys",
"(",
"DependencyExplorerOutput",
"output",
")",
"{",
"Map",
"<",
"Key",
"<",
"?",
">",
",",
"String",
">",
"allInvalidKeys",
"=",
"getAllInvalidKeys",
"(",
"output",
")",
";",
"Set",
"<",
"Key",
"<",
"?",
">",
">"... | Returns an {@link InvalidKeys} object containing information about all the errors that we
discovered in required keys, and the set of all optional bindings that should be removed from
the graph in order to make it valid. | [
"Returns",
"an",
"{"
] | train | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/resolution/UnresolvedBindingValidator.java#L85-L90 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.