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 |
|---|---|---|---|---|---|---|---|---|---|---|
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java | ClassBuilder.buildClassInfo | public void buildClassInfo(XMLNode node, Content classContentTree) {
"""
Build the class information tree documentation.
@param node the XML element that specifies which components to document
@param classContentTree the content tree to which the documentation will be added
"""
Content classInfoTre... | java | public void buildClassInfo(XMLNode node, Content classContentTree) {
Content classInfoTree = writer.getClassInfoTreeHeader();
buildChildren(node, classInfoTree);
classContentTree.addContent(writer.getClassInfo(classInfoTree));
} | [
"public",
"void",
"buildClassInfo",
"(",
"XMLNode",
"node",
",",
"Content",
"classContentTree",
")",
"{",
"Content",
"classInfoTree",
"=",
"writer",
".",
"getClassInfoTreeHeader",
"(",
")",
";",
"buildChildren",
"(",
"node",
",",
"classInfoTree",
")",
";",
"clas... | Build the class information tree documentation.
@param node the XML element that specifies which components to document
@param classContentTree the content tree to which the documentation will be added | [
"Build",
"the",
"class",
"information",
"tree",
"documentation",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java#L171-L175 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/task/HiveTask.java | HiveTask.addFile | public static void addFile(State state, String file) {
"""
Add the input file to the Hive session before running the task.
"""
state.setProp(ADD_FILES, state.getProp(ADD_FILES, "") + "," + file);
} | java | public static void addFile(State state, String file) {
state.setProp(ADD_FILES, state.getProp(ADD_FILES, "") + "," + file);
} | [
"public",
"static",
"void",
"addFile",
"(",
"State",
"state",
",",
"String",
"file",
")",
"{",
"state",
".",
"setProp",
"(",
"ADD_FILES",
",",
"state",
".",
"getProp",
"(",
"ADD_FILES",
",",
"\"\"",
")",
"+",
"\",\"",
"+",
"file",
")",
";",
"}"
] | Add the input file to the Hive session before running the task. | [
"Add",
"the",
"input",
"file",
"to",
"the",
"Hive",
"session",
"before",
"running",
"the",
"task",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/task/HiveTask.java#L73-L75 |
amplexus/java-flac-encoder | src/main/java/net/sourceforge/javaflacencoder/FLACEncoder.java | FLACEncoder.setOutputStream | public void setOutputStream(FLACOutputStream fos) {
"""
Set the output stream to use. This must not be called while an encode
process is active, or a flac stream is already opened.
@param fos output stream to use. This must not be null.
"""
if(fos == null)
throw new IllegalArgumentException("FLACOu... | java | public void setOutputStream(FLACOutputStream fos) {
if(fos == null)
throw new IllegalArgumentException("FLACOutputStream fos must not be null.");
if(flacWriter == null)
flacWriter = new FLACStreamController(fos,streamConfig);
else
flacWriter.setFLACOutputStream(fos);
} | [
"public",
"void",
"setOutputStream",
"(",
"FLACOutputStream",
"fos",
")",
"{",
"if",
"(",
"fos",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"FLACOutputStream fos must not be null.\"",
")",
";",
"if",
"(",
"flacWriter",
"==",
"null",
")",... | Set the output stream to use. This must not be called while an encode
process is active, or a flac stream is already opened.
@param fos output stream to use. This must not be null. | [
"Set",
"the",
"output",
"stream",
"to",
"use",
".",
"This",
"must",
"not",
"be",
"called",
"while",
"an",
"encode",
"process",
"is",
"active",
"or",
"a",
"flac",
"stream",
"is",
"already",
"opened",
"."
] | train | https://github.com/amplexus/java-flac-encoder/blob/3d536b877dee2a3fd4ab2e0d9569e292cae93bc9/src/main/java/net/sourceforge/javaflacencoder/FLACEncoder.java#L688-L695 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/jboss/logging/Logger.java | Logger.logv | public void logv(Level level, String format, Object... params) {
"""
Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting.
@param level the level
@param format the message format string
@param params the parameters
"""
doLog(level, FQCN, format, params,... | java | public void logv(Level level, String format, Object... params) {
doLog(level, FQCN, format, params, null);
} | [
"public",
"void",
"logv",
"(",
"Level",
"level",
",",
"String",
"format",
",",
"Object",
"...",
"params",
")",
"{",
"doLog",
"(",
"level",
",",
"FQCN",
",",
"format",
",",
"params",
",",
"null",
")",
";",
"}"
] | Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting.
@param level the level
@param format the message format string
@param params the parameters | [
"Issue",
"a",
"log",
"message",
"at",
"the",
"given",
"log",
"level",
"using",
"{",
"@link",
"java",
".",
"text",
".",
"MessageFormat",
"}",
"-",
"style",
"formatting",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/jboss/logging/Logger.java#L2113-L2115 |
j256/ormlite-core | src/main/java/com/j256/ormlite/stmt/QueryBuilder.java | QueryBuilder.matchJoinedFields | private void matchJoinedFields(JoinInfo joinInfo, QueryBuilder<?, ?> joinedQueryBuilder) throws SQLException {
"""
Match up our joined fields so we can throw a nice exception immediately if you can't join with this type.
"""
for (FieldType fieldType : tableInfo.getFieldTypes()) {
// if this is a foreign f... | java | private void matchJoinedFields(JoinInfo joinInfo, QueryBuilder<?, ?> joinedQueryBuilder) throws SQLException {
for (FieldType fieldType : tableInfo.getFieldTypes()) {
// if this is a foreign field and its foreign field is the same as the other's id
FieldType foreignRefField = fieldType.getForeignRefField();
... | [
"private",
"void",
"matchJoinedFields",
"(",
"JoinInfo",
"joinInfo",
",",
"QueryBuilder",
"<",
"?",
",",
"?",
">",
"joinedQueryBuilder",
")",
"throws",
"SQLException",
"{",
"for",
"(",
"FieldType",
"fieldType",
":",
"tableInfo",
".",
"getFieldTypes",
"(",
")",
... | Match up our joined fields so we can throw a nice exception immediately if you can't join with this type. | [
"Match",
"up",
"our",
"joined",
"fields",
"so",
"we",
"can",
"throw",
"a",
"nice",
"exception",
"immediately",
"if",
"you",
"can",
"t",
"join",
"with",
"this",
"type",
"."
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/QueryBuilder.java#L612-L633 |
rolfl/MicroBench | src/main/java/net/tuis/ubench/ScaleDetect.java | ScaleDetect.newtonSolve | private static double[] newtonSolve(Function<double[], double[]> function, double[] initial, double tolerance) {
"""
Finding the best fit using least-squares method for an equation system
@param function Equation system to find fit for. Input: Parameters, Output: Residuals.
@param initial Initial 'guess' for f... | java | private static double[] newtonSolve(Function<double[], double[]> function, double[] initial, double tolerance) {
RealVector dx = new ArrayRealVector(initial.length);
dx.set(tolerance + 1);
int iterations = 0;
int d = initial.length;
double[] values = Arrays.copyOf(initial, initia... | [
"private",
"static",
"double",
"[",
"]",
"newtonSolve",
"(",
"Function",
"<",
"double",
"[",
"]",
",",
"double",
"[",
"]",
">",
"function",
",",
"double",
"[",
"]",
"initial",
",",
"double",
"tolerance",
")",
"{",
"RealVector",
"dx",
"=",
"new",
"Array... | Finding the best fit using least-squares method for an equation system
@param function Equation system to find fit for. Input: Parameters, Output: Residuals.
@param initial Initial 'guess' for function parameters
@param tolerance How much the function parameters may change before a solution is accepted
@return The par... | [
"Finding",
"the",
"best",
"fit",
"using",
"least",
"-",
"squares",
"method",
"for",
"an",
"equation",
"system"
] | train | https://github.com/rolfl/MicroBench/blob/f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce/src/main/java/net/tuis/ubench/ScaleDetect.java#L32-L64 |
sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java | HelperBase.substringBetween | public String substringBetween(String string, String begin, String end, boolean includeBoundaries) {
"""
Gets a substring between the begin and end boundaries
@param string
original string
@param begin
start boundary
@param end
end boundary
@param includeBoundaries
include the boundaries in substring
@r... | java | public String substringBetween(String string, String begin, String end, boolean includeBoundaries) {
if (string == null || begin == null || end == null) {
return null;
}
int startPos = string.indexOf(begin);
if (startPos != -1) {
if (includeBoundaries)
startPos = startPos - begin.length();
int endP... | [
"public",
"String",
"substringBetween",
"(",
"String",
"string",
",",
"String",
"begin",
",",
"String",
"end",
",",
"boolean",
"includeBoundaries",
")",
"{",
"if",
"(",
"string",
"==",
"null",
"||",
"begin",
"==",
"null",
"||",
"end",
"==",
"null",
")",
... | Gets a substring between the begin and end boundaries
@param string
original string
@param begin
start boundary
@param end
end boundary
@param includeBoundaries
include the boundaries in substring
@return substring between boundaries | [
"Gets",
"a",
"substring",
"between",
"the",
"begin",
"and",
"end",
"boundaries"
] | train | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L540-L556 |
couchbase/couchbase-lite-java-core | src/main/java/com/couchbase/lite/View.java | View.setMap | @InterfaceAudience.Public
public boolean setMap(Mapper mapBlock, String version) {
"""
Defines a view that has no reduce function.
See setMapReduce() for more information.
"""
return setMapReduce(mapBlock, null, version);
} | java | @InterfaceAudience.Public
public boolean setMap(Mapper mapBlock, String version) {
return setMapReduce(mapBlock, null, version);
} | [
"@",
"InterfaceAudience",
".",
"Public",
"public",
"boolean",
"setMap",
"(",
"Mapper",
"mapBlock",
",",
"String",
"version",
")",
"{",
"return",
"setMapReduce",
"(",
"mapBlock",
",",
"null",
",",
"version",
")",
";",
"}"
] | Defines a view that has no reduce function.
See setMapReduce() for more information. | [
"Defines",
"a",
"view",
"that",
"has",
"no",
"reduce",
"function",
".",
"See",
"setMapReduce",
"()",
"for",
"more",
"information",
"."
] | train | https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/src/main/java/com/couchbase/lite/View.java#L166-L169 |
CenturyLinkCloud/mdw | mdw-workflow/src/com/centurylink/mdw/workflow/activity/transform/CrossmapActivity.java | CrossmapActivity.runScript | protected void runScript(String mapperScript, Slurper slurper, Builder builder)
throws ActivityException, TransformerException {
"""
Invokes the builder object for creating new output variable value.
"""
CompilerConfiguration compilerConfig = new CompilerConfiguration();
compilerCo... | java | protected void runScript(String mapperScript, Slurper slurper, Builder builder)
throws ActivityException, TransformerException {
CompilerConfiguration compilerConfig = new CompilerConfiguration();
compilerConfig.setScriptBaseClass(CrossmapScript.class.getName());
Binding binding = ... | [
"protected",
"void",
"runScript",
"(",
"String",
"mapperScript",
",",
"Slurper",
"slurper",
",",
"Builder",
"builder",
")",
"throws",
"ActivityException",
",",
"TransformerException",
"{",
"CompilerConfiguration",
"compilerConfig",
"=",
"new",
"CompilerConfiguration",
"... | Invokes the builder object for creating new output variable value. | [
"Invokes",
"the",
"builder",
"object",
"for",
"creating",
"new",
"output",
"variable",
"value",
"."
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-workflow/src/com/centurylink/mdw/workflow/activity/transform/CrossmapActivity.java#L133-L146 |
Fleker/ChannelSurfer | library/src/main/java/com/felkertech/channelsurfer/fileio/FileParser.java | FileParser.parseGenericFileUri | public static void parseGenericFileUri(String uri, FileIdentifier identifier) {
"""
In order to determine the correct file parser, you can provide the URI and this method
will find the appropriate parser to use
@param uri The Uri of the file you are parsing
@param identifier This interface can be generated in o... | java | public static void parseGenericFileUri(String uri, FileIdentifier identifier) {
if(uri.startsWith("file://"))
identifier.onLocalFile();
else if(uri.startsWith("http://"))
identifier.onHttpFile();
else if(uri.startsWith("android.resource://"))
identifier.onAsse... | [
"public",
"static",
"void",
"parseGenericFileUri",
"(",
"String",
"uri",
",",
"FileIdentifier",
"identifier",
")",
"{",
"if",
"(",
"uri",
".",
"startsWith",
"(",
"\"file://\"",
")",
")",
"identifier",
".",
"onLocalFile",
"(",
")",
";",
"else",
"if",
"(",
"... | In order to determine the correct file parser, you can provide the URI and this method
will find the appropriate parser to use
@param uri The Uri of the file you are parsing
@param identifier This interface can be generated in order to handle different actions
based on the source of the file | [
"In",
"order",
"to",
"determine",
"the",
"correct",
"file",
"parser",
"you",
"can",
"provide",
"the",
"URI",
"and",
"this",
"method",
"will",
"find",
"the",
"appropriate",
"parser",
"to",
"use"
] | train | https://github.com/Fleker/ChannelSurfer/blob/f677beae37112f463c0c4783967fdb8fa97eb633/library/src/main/java/com/felkertech/channelsurfer/fileio/FileParser.java#L15-L22 |
Scout24/appmon4j | core/src/main/java/de/is24/util/monitoring/wrapper/GenericMonitoringWrapper.java | GenericMonitoringWrapper.wrapObject | public static <E> E wrapObject(final Class<E> clazz, final Object target) {
"""
Wraps the given object and returns the reporting proxy. Uses the
{@link InApplicationMonitorTimingReporter} to report the timings.
@param <E>
the type of the public interface of the wrapped object
@param clazz
the class object t... | java | public static <E> E wrapObject(final Class<E> clazz, final Object target) {
return wrapObject(clazz, target, new InApplicationMonitorTimingReporter());
} | [
"public",
"static",
"<",
"E",
">",
"E",
"wrapObject",
"(",
"final",
"Class",
"<",
"E",
">",
"clazz",
",",
"final",
"Object",
"target",
")",
"{",
"return",
"wrapObject",
"(",
"clazz",
",",
"target",
",",
"new",
"InApplicationMonitorTimingReporter",
"(",
")"... | Wraps the given object and returns the reporting proxy. Uses the
{@link InApplicationMonitorTimingReporter} to report the timings.
@param <E>
the type of the public interface of the wrapped object
@param clazz
the class object to the interface
@param target
the object to wrap
@return the monitoring wrapper | [
"Wraps",
"the",
"given",
"object",
"and",
"returns",
"the",
"reporting",
"proxy",
".",
"Uses",
"the",
"{",
"@link",
"InApplicationMonitorTimingReporter",
"}",
"to",
"report",
"the",
"timings",
"."
] | train | https://github.com/Scout24/appmon4j/blob/a662e5123805ea455cfd01e1b9ae5d808f83529c/core/src/main/java/de/is24/util/monitoring/wrapper/GenericMonitoringWrapper.java#L68-L70 |
Impetus/Kundera | src/kundera-mongo/src/main/java/com/impetus/client/mongodb/query/MongoDBQuery.java | MongoDBQuery.getKeys | private BasicDBObject getKeys(EntityMetadata m, String[] columns) {
"""
Gets the keys.
@param m
the m
@param columns
the columns
@return the keys
"""
BasicDBObject keys = new BasicDBObject();
if (columns != null && columns.length > 0)
{
MetamodelImpl metaModel = (Meta... | java | private BasicDBObject getKeys(EntityMetadata m, String[] columns)
{
BasicDBObject keys = new BasicDBObject();
if (columns != null && columns.length > 0)
{
MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata()
.getMetamodel(m.getPer... | [
"private",
"BasicDBObject",
"getKeys",
"(",
"EntityMetadata",
"m",
",",
"String",
"[",
"]",
"columns",
")",
"{",
"BasicDBObject",
"keys",
"=",
"new",
"BasicDBObject",
"(",
")",
";",
"if",
"(",
"columns",
"!=",
"null",
"&&",
"columns",
".",
"length",
">",
... | Gets the keys.
@param m
the m
@param columns
the columns
@return the keys | [
"Gets",
"the",
"keys",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-mongo/src/main/java/com/impetus/client/mongodb/query/MongoDBQuery.java#L804-L826 |
buyi/RecyclerViewPagerIndicator | recycler-viewpager-indicator/src/main/java/com/viewpagerindicator/as/library/pageview/RecyclerViewHeader.java | RecyclerViewHeader.attachTo | public void attachTo(RecyclerView recycler, boolean headerAlreadyAligned) {
"""
Attaches <code>RecyclerViewHeader</code> to <code>RecyclerView</code>.
Be sure that <code>setLayoutManager(...)</code> has been called for <code>RecyclerView</code> before calling this method.
Also, if you were planning to use <code>... | java | public void attachTo(RecyclerView recycler, boolean headerAlreadyAligned) {
validateRecycler(recycler, headerAlreadyAligned);
mRecycler = recycler;
mAlreadyAligned = headerAlreadyAligned;
mReversed = isLayoutManagerReversed(recycler);
setupAlignment(recycler);
setupHead... | [
"public",
"void",
"attachTo",
"(",
"RecyclerView",
"recycler",
",",
"boolean",
"headerAlreadyAligned",
")",
"{",
"validateRecycler",
"(",
"recycler",
",",
"headerAlreadyAligned",
")",
";",
"mRecycler",
"=",
"recycler",
";",
"mAlreadyAligned",
"=",
"headerAlreadyAligne... | Attaches <code>RecyclerViewHeader</code> to <code>RecyclerView</code>.
Be sure that <code>setLayoutManager(...)</code> has been called for <code>RecyclerView</code> before calling this method.
Also, if you were planning to use <code>setOnScrollListener(...)</code> method for your <code>RecyclerView</code>, be sure to d... | [
"Attaches",
"<code",
">",
"RecyclerViewHeader<",
"/",
"code",
">",
"to",
"<code",
">",
"RecyclerView<",
"/",
"code",
">",
".",
"Be",
"sure",
"that",
"<code",
">",
"setLayoutManager",
"(",
"...",
")",
"<",
"/",
"code",
">",
"has",
"been",
"called",
"for",... | train | https://github.com/buyi/RecyclerViewPagerIndicator/blob/b3b5283801b60d40f7325c7f590c945262194fad/recycler-viewpager-indicator/src/main/java/com/viewpagerindicator/as/library/pageview/RecyclerViewHeader.java#L109-L125 |
scottbw/spaws | src/main/java/uk/ac/bolton/spaws/ParadataManager.java | ParadataManager.getExternalStats | public List<ISubmission> getExternalStats(String resourceUrl) throws Exception {
"""
Return all stats from other submitters for the resource
@param resourceUrl
@return
@throws Exception
"""
return getExternalSubmissions(resourceUrl, IStats.VERB);
} | java | public List<ISubmission> getExternalStats(String resourceUrl) throws Exception{
return getExternalSubmissions(resourceUrl, IStats.VERB);
} | [
"public",
"List",
"<",
"ISubmission",
">",
"getExternalStats",
"(",
"String",
"resourceUrl",
")",
"throws",
"Exception",
"{",
"return",
"getExternalSubmissions",
"(",
"resourceUrl",
",",
"IStats",
".",
"VERB",
")",
";",
"}"
] | Return all stats from other submitters for the resource
@param resourceUrl
@return
@throws Exception | [
"Return",
"all",
"stats",
"from",
"other",
"submitters",
"for",
"the",
"resource"
] | train | https://github.com/scottbw/spaws/blob/9b1e07453091f6a8d60c6046d194b1a8f1236502/src/main/java/uk/ac/bolton/spaws/ParadataManager.java#L73-L75 |
aws/aws-sdk-java | aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/AddOperations.java | AddOperations.getHttpStatusCode | private Integer getHttpStatusCode(ErrorMap error, Shape shape) {
"""
Get HTTP status code either from error trait on the operation reference or the error trait on the shape.
@param error ErrorMap on operation reference.
@param shape Error shape.
@return HTTP status code or null if not present.
"""
... | java | private Integer getHttpStatusCode(ErrorMap error, Shape shape) {
final Integer httpStatusCode = getHttpStatusCode(error.getErrorTrait());
return httpStatusCode == null ? getHttpStatusCode(shape.getErrorTrait()) : httpStatusCode;
} | [
"private",
"Integer",
"getHttpStatusCode",
"(",
"ErrorMap",
"error",
",",
"Shape",
"shape",
")",
"{",
"final",
"Integer",
"httpStatusCode",
"=",
"getHttpStatusCode",
"(",
"error",
".",
"getErrorTrait",
"(",
")",
")",
";",
"return",
"httpStatusCode",
"==",
"null"... | Get HTTP status code either from error trait on the operation reference or the error trait on the shape.
@param error ErrorMap on operation reference.
@param shape Error shape.
@return HTTP status code or null if not present. | [
"Get",
"HTTP",
"status",
"code",
"either",
"from",
"error",
"trait",
"on",
"the",
"operation",
"reference",
"or",
"the",
"error",
"trait",
"on",
"the",
"shape",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/AddOperations.java#L130-L133 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.replaceEntry | public static boolean replaceEntry(File zip, String path, File file, File destZip) {
"""
Copies an existing ZIP file and replaces a given entry in it.
@param zip
an existing ZIP file (only read).
@param path
new ZIP entry path.
@param file
new entry.
@param destZip
new ZIP file created.
@return <code>tr... | java | public static boolean replaceEntry(File zip, String path, File file, File destZip) {
return replaceEntry(zip, new FileSource(path, file), destZip);
} | [
"public",
"static",
"boolean",
"replaceEntry",
"(",
"File",
"zip",
",",
"String",
"path",
",",
"File",
"file",
",",
"File",
"destZip",
")",
"{",
"return",
"replaceEntry",
"(",
"zip",
",",
"new",
"FileSource",
"(",
"path",
",",
"file",
")",
",",
"destZip"... | Copies an existing ZIP file and replaces a given entry in it.
@param zip
an existing ZIP file (only read).
@param path
new ZIP entry path.
@param file
new entry.
@param destZip
new ZIP file created.
@return <code>true</code> if the entry was replaced. | [
"Copies",
"an",
"existing",
"ZIP",
"file",
"and",
"replaces",
"a",
"given",
"entry",
"in",
"it",
"."
] | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L2502-L2504 |
Azure/azure-sdk-for-java | hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptActionsInner.java | ScriptActionsInner.listByClusterAsync | public Observable<Page<RuntimeScriptActionDetailInner>> listByClusterAsync(final String resourceGroupName, final String clusterName) {
"""
Lists all the persisted script actions for the specified cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@thr... | java | public Observable<Page<RuntimeScriptActionDetailInner>> listByClusterAsync(final String resourceGroupName, final String clusterName) {
return listByClusterWithServiceResponseAsync(resourceGroupName, clusterName)
.map(new Func1<ServiceResponse<Page<RuntimeScriptActionDetailInner>>, Page<RuntimeScript... | [
"public",
"Observable",
"<",
"Page",
"<",
"RuntimeScriptActionDetailInner",
">",
">",
"listByClusterAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"clusterName",
")",
"{",
"return",
"listByClusterWithServiceResponseAsync",
"(",
"resourceGroup... | Lists all the persisted script actions for the specified cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<RuntimeScriptActionDetailInner> ... | [
"Lists",
"all",
"the",
"persisted",
"script",
"actions",
"for",
"the",
"specified",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptActionsInner.java#L220-L228 |
nguyenq/tess4j | src/main/java/net/sourceforge/tess4j/Tesseract.java | Tesseract.getRecognizedWords | private List<Word> getRecognizedWords(int pageIteratorLevel) {
"""
Gets result words at specified page iterator level from recognized pages.
@param pageIteratorLevel TessPageIteratorLevel enum
@return list of <code>Word</code>
"""
List<Word> words = new ArrayList<Word>();
try {
... | java | private List<Word> getRecognizedWords(int pageIteratorLevel) {
List<Word> words = new ArrayList<Word>();
try {
TessResultIterator ri = api.TessBaseAPIGetIterator(handle);
TessPageIterator pi = api.TessResultIteratorGetPageIterator(ri);
api.TessPageIteratorBegin... | [
"private",
"List",
"<",
"Word",
">",
"getRecognizedWords",
"(",
"int",
"pageIteratorLevel",
")",
"{",
"List",
"<",
"Word",
">",
"words",
"=",
"new",
"ArrayList",
"<",
"Word",
">",
"(",
")",
";",
"try",
"{",
"TessResultIterator",
"ri",
"=",
"api",
".",
... | Gets result words at specified page iterator level from recognized pages.
@param pageIteratorLevel TessPageIteratorLevel enum
@return list of <code>Word</code> | [
"Gets",
"result",
"words",
"at",
"specified",
"page",
"iterator",
"level",
"from",
"recognized",
"pages",
"."
] | train | https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/Tesseract.java#L818-L848 |
vincentk/joptimizer | src/main/java/com/joptimizer/functions/SOCPLogarithmicBarrier.java | SOCPLogarithmicBarrier.createPhase1BarrierFunction | @Override
public BarrierFunction createPhase1BarrierFunction() {
"""
Create the barrier function for the Phase I.
It is an instance of this class for the constraints:
<br>||Ai.x+bi|| < ci.x+di+t, i=1,...,m
@see "S.Boyd and L.Vandenberghe, Convex Optimization, 11.6.2"
"""
final int dimPh1 = dim +1;
... | java | @Override
public BarrierFunction createPhase1BarrierFunction(){
final int dimPh1 = dim +1;
List<SOCPConstraintParameters> socpConstraintParametersPh1List = new ArrayList<SOCPConstraintParameters>();
SOCPLogarithmicBarrier bfPh1 = new SOCPLogarithmicBarrier(socpConstraintParametersPh1List, dimPh1);
... | [
"@",
"Override",
"public",
"BarrierFunction",
"createPhase1BarrierFunction",
"(",
")",
"{",
"final",
"int",
"dimPh1",
"=",
"dim",
"+",
"1",
";",
"List",
"<",
"SOCPConstraintParameters",
">",
"socpConstraintParametersPh1List",
"=",
"new",
"ArrayList",
"<",
"SOCPConst... | Create the barrier function for the Phase I.
It is an instance of this class for the constraints:
<br>||Ai.x+bi|| < ci.x+di+t, i=1,...,m
@see "S.Boyd and L.Vandenberghe, Convex Optimization, 11.6.2" | [
"Create",
"the",
"barrier",
"function",
"for",
"the",
"Phase",
"I",
".",
"It",
"is",
"an",
"instance",
"of",
"this",
"class",
"for",
"the",
"constraints",
":",
"<br",
">",
"||Ai",
".",
"x",
"+",
"bi||",
"<",
"ci",
".",
"x",
"+",
"di",
"+",
"t",
"... | train | https://github.com/vincentk/joptimizer/blob/65064c1bb0b26c7261358021e4c93d06dd43564f/src/main/java/com/joptimizer/functions/SOCPLogarithmicBarrier.java#L124-L151 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/TypeFormatter.java | TypeFormatter.formatNameTypeValue | public static String formatNameTypeValue(String name, Object value) {
"""
/*
Formats a name/object pair using the following template:
name(value-type)=value
where vale-type is a String representation of the object type of the
value passed in, and value is a String representation of the value
passed in. B... | java | public static String formatNameTypeValue(String name, Object value) {
StringBuilder sb = new StringBuilder(name);
sb.append('(');
sb.append(getType(value));
sb.append(')');
sb.append('=');
sb.append(formatValue(value));
return sb.toString();
} | [
"public",
"static",
"String",
"formatNameTypeValue",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"name",
")",
";",
"sb",
".",
"append",
"(",
"'",
"'",
")",
";",
"sb",
".",
"append",
... | /*
Formats a name/object pair using the following template:
name(value-type)=value
where vale-type is a String representation of the object type of the
value passed in, and value is a String representation of the value
passed in. Binary arrays are formatted in hex, all other types are
formatted with toString(). | [
"/",
"*",
"Formats",
"a",
"name",
"/",
"object",
"pair",
"using",
"the",
"following",
"template",
":"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/TypeFormatter.java#L82-L91 |
gallandarakhneorg/afc | maven/maventools/src/main/java/org/arakhne/maven/AbstractArakhneMojo.java | AbstractArakhneMojo.fileCopy | public final void fileCopy(URL in, File out) throws IOException {
"""
Copy a file.
@param in input file.
@param out output file.
@throws IOException on error.
"""
assert in != null;
try (InputStream inStream = in.openStream()) {
try (OutputStream outStream = new FileOutputStream(out)) {
final b... | java | public final void fileCopy(URL in, File out) throws IOException {
assert in != null;
try (InputStream inStream = in.openStream()) {
try (OutputStream outStream = new FileOutputStream(out)) {
final byte[] buf = new byte[FILE_BUFFER];
int len;
while ((len = inStream.read(buf)) > 0) {
outStream.wri... | [
"public",
"final",
"void",
"fileCopy",
"(",
"URL",
"in",
",",
"File",
"out",
")",
"throws",
"IOException",
"{",
"assert",
"in",
"!=",
"null",
";",
"try",
"(",
"InputStream",
"inStream",
"=",
"in",
".",
"openStream",
"(",
")",
")",
"{",
"try",
"(",
"O... | Copy a file.
@param in input file.
@param out output file.
@throws IOException on error. | [
"Copy",
"a",
"file",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/maven/maventools/src/main/java/org/arakhne/maven/AbstractArakhneMojo.java#L356-L369 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.updateKey | public KeyBundle updateKey(String vaultBaseUrl, String keyName, String keyVersion, List<JsonWebKeyOperation> keyOps, KeyAttributes keyAttributes, Map<String, String> tags) {
"""
The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure ... | java | public KeyBundle updateKey(String vaultBaseUrl, String keyName, String keyVersion, List<JsonWebKeyOperation> keyOps, KeyAttributes keyAttributes, Map<String, String> tags) {
return updateKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, keyOps, keyAttributes, tags).toBlocking().single().body();
... | [
"public",
"KeyBundle",
"updateKey",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"keyName",
",",
"String",
"keyVersion",
",",
"List",
"<",
"JsonWebKeyOperation",
">",
"keyOps",
",",
"KeyAttributes",
"keyAttributes",
",",
"Map",
"<",
"String",
",",
"String",
">"... | The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault.
In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires... | [
"The",
"update",
"key",
"operation",
"changes",
"specified",
"attributes",
"of",
"a",
"stored",
"key",
"and",
"can",
"be",
"applied",
"to",
"any",
"key",
"type",
"and",
"key",
"version",
"stored",
"in",
"Azure",
"Key",
"Vault",
".",
"In",
"order",
"to",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L1274-L1276 |
eclipse/xtext-core | org.eclipse.xtext.util/src/org/eclipse/xtext/util/MergeableManifest.java | MergeableManifest.write | @Override
public void write(OutputStream out) throws IOException {
"""
/*
Copied from base class to omit the call to make72Safe(..).
"""
DataOutputStream dos = new DataOutputStream(out);
// Write out the main attributes for the manifest
getMainAttributes().myWriteMain(dos);
// Now write out the pre-e... | java | @Override
public void write(OutputStream out) throws IOException {
DataOutputStream dos = new DataOutputStream(out);
// Write out the main attributes for the manifest
getMainAttributes().myWriteMain(dos);
// Now write out the pre-entry attributes
Iterator<Map.Entry<String, Attributes>> it = getEntries().entr... | [
"@",
"Override",
"public",
"void",
"write",
"(",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"DataOutputStream",
"dos",
"=",
"new",
"DataOutputStream",
"(",
"out",
")",
";",
"// Write out the main attributes for the manifest",
"getMainAttributes",
"(",
"... | /*
Copied from base class to omit the call to make72Safe(..). | [
"/",
"*",
"Copied",
"from",
"base",
"class",
"to",
"omit",
"the",
"call",
"to",
"make72Safe",
"(",
"..",
")",
"."
] | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext.util/src/org/eclipse/xtext/util/MergeableManifest.java#L300-L321 |
orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java | SFSUtilities.getResultSetEnvelope | public static Envelope getResultSetEnvelope(ResultSet resultSet) throws SQLException {
"""
Compute the full extend of a ResultSet using the first geometry field. If
the ResultSet does not contain any geometry field throw an exception
@param resultSet ResultSet to analyse
@return The full envelope of the Res... | java | public static Envelope getResultSetEnvelope(ResultSet resultSet) throws SQLException {
List<String> geometryFields = getGeometryFields(resultSet);
if (geometryFields.isEmpty()) {
throw new SQLException("This ResultSet doesn't contain any geometry field.");
} else {
return... | [
"public",
"static",
"Envelope",
"getResultSetEnvelope",
"(",
"ResultSet",
"resultSet",
")",
"throws",
"SQLException",
"{",
"List",
"<",
"String",
">",
"geometryFields",
"=",
"getGeometryFields",
"(",
"resultSet",
")",
";",
"if",
"(",
"geometryFields",
".",
"isEmpt... | Compute the full extend of a ResultSet using the first geometry field. If
the ResultSet does not contain any geometry field throw an exception
@param resultSet ResultSet to analyse
@return The full envelope of the ResultSet
@throws SQLException | [
"Compute",
"the",
"full",
"extend",
"of",
"a",
"ResultSet",
"using",
"the",
"first",
"geometry",
"field",
".",
"If",
"the",
"ResultSet",
"does",
"not",
"contain",
"any",
"geometry",
"field",
"throw",
"an",
"exception"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java#L448-L455 |
elki-project/elki | elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/similarityfunction/kernel/KernelMatrix.java | KernelMatrix.getSquaredDistance | public double getSquaredDistance(final DBIDRef id1, final DBIDRef id2) {
"""
Returns the squared kernel distance between the two specified objects.
@param id1 first ObjectID
@param id2 second ObjectID
@return the distance between the two objects
"""
final int o1 = idmap.getOffset(id1), o2 = idmap.getO... | java | public double getSquaredDistance(final DBIDRef id1, final DBIDRef id2) {
final int o1 = idmap.getOffset(id1), o2 = idmap.getOffset(id2);
return kernel[o1][o1] + kernel[o2][o2] - 2 * kernel[o1][o2];
} | [
"public",
"double",
"getSquaredDistance",
"(",
"final",
"DBIDRef",
"id1",
",",
"final",
"DBIDRef",
"id2",
")",
"{",
"final",
"int",
"o1",
"=",
"idmap",
".",
"getOffset",
"(",
"id1",
")",
",",
"o2",
"=",
"idmap",
".",
"getOffset",
"(",
"id2",
")",
";",
... | Returns the squared kernel distance between the two specified objects.
@param id1 first ObjectID
@param id2 second ObjectID
@return the distance between the two objects | [
"Returns",
"the",
"squared",
"kernel",
"distance",
"between",
"the",
"two",
"specified",
"objects",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/similarityfunction/kernel/KernelMatrix.java#L229-L232 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Utility.java | Utility.lookup | public static int lookup(String source, String[] target) {
"""
Look up a given string in a string array. Returns the index at
which the first occurrence of the string was found in the
array, or -1 if it was not found.
@param source the string to search for
@param target the array of zero or more strings in wh... | java | public static int lookup(String source, String[] target) {
for (int i = 0; i < target.length; ++i) {
if (source.equals(target[i])) return i;
}
return -1;
} | [
"public",
"static",
"int",
"lookup",
"(",
"String",
"source",
",",
"String",
"[",
"]",
"target",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"target",
".",
"length",
";",
"++",
"i",
")",
"{",
"if",
"(",
"source",
".",
"equals",
"... | Look up a given string in a string array. Returns the index at
which the first occurrence of the string was found in the
array, or -1 if it was not found.
@param source the string to search for
@param target the array of zero or more strings in which to
look for source
@return the index of target at which source first... | [
"Look",
"up",
"a",
"given",
"string",
"in",
"a",
"string",
"array",
".",
"Returns",
"the",
"index",
"at",
"which",
"the",
"first",
"occurrence",
"of",
"the",
"string",
"was",
"found",
"in",
"the",
"array",
"or",
"-",
"1",
"if",
"it",
"was",
"not",
"f... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Utility.java#L1112-L1117 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/NumberField.java | NumberField.setState | public int setState(boolean state, boolean bDisplayOption, int moveMode) {
"""
For binary fields, set the current state.
@param state The state to set this field.
@param bDisplayOption Display changed fields if true.
@param iMoveMode The move mode.
@return The error code (or NORMAL_RETURN).
"""
dou... | java | public int setState(boolean state, boolean bDisplayOption, int moveMode)
{
double value = 0;
if (state)
value = 1;
return this.setValue(value, bDisplayOption, moveMode); // Move value to this field
} | [
"public",
"int",
"setState",
"(",
"boolean",
"state",
",",
"boolean",
"bDisplayOption",
",",
"int",
"moveMode",
")",
"{",
"double",
"value",
"=",
"0",
";",
"if",
"(",
"state",
")",
"value",
"=",
"1",
";",
"return",
"this",
".",
"setValue",
"(",
"value"... | For binary fields, set the current state.
@param state The state to set this field.
@param bDisplayOption Display changed fields if true.
@param iMoveMode The move mode.
@return The error code (or NORMAL_RETURN). | [
"For",
"binary",
"fields",
"set",
"the",
"current",
"state",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/NumberField.java#L155-L161 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/record/meta/RecordTypeInfo.java | RecordTypeInfo.getNestedStructTypeInfo | public RecordTypeInfo getNestedStructTypeInfo(String name) {
"""
Return the type info of a nested record. We only consider nesting
to one level.
@param name Name of the nested record
"""
StructTypeID stid = sTid.findStruct(name);
if (null == stid) return null;
return new RecordTypeInfo(name, stid... | java | public RecordTypeInfo getNestedStructTypeInfo(String name) {
StructTypeID stid = sTid.findStruct(name);
if (null == stid) return null;
return new RecordTypeInfo(name, stid);
} | [
"public",
"RecordTypeInfo",
"getNestedStructTypeInfo",
"(",
"String",
"name",
")",
"{",
"StructTypeID",
"stid",
"=",
"sTid",
".",
"findStruct",
"(",
"name",
")",
";",
"if",
"(",
"null",
"==",
"stid",
")",
"return",
"null",
";",
"return",
"new",
"RecordTypeIn... | Return the type info of a nested record. We only consider nesting
to one level.
@param name Name of the nested record | [
"Return",
"the",
"type",
"info",
"of",
"a",
"nested",
"record",
".",
"We",
"only",
"consider",
"nesting",
"to",
"one",
"level",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/record/meta/RecordTypeInfo.java#L109-L113 |
qiujuer/Genius-Android | caprice/kit-cmd/src/main/java/net/qiujuer/genius/kit/cmd/CommandExecutor.java | CommandExecutor.create | protected static CommandExecutor create(int timeout, String param) {
"""
Run
@param param param eg: "/system/bin/ping -c 4 -s 100 www.qiujuer.net"
"""
String[] params = param.split(" ");
CommandExecutor processModel = null;
synchronized (PRC) {
try {
Proce... | java | protected static CommandExecutor create(int timeout, String param) {
String[] params = param.split(" ");
CommandExecutor processModel = null;
synchronized (PRC) {
try {
Process process = PRC.command(params)
.redirectErrorStream(true)
... | [
"protected",
"static",
"CommandExecutor",
"create",
"(",
"int",
"timeout",
",",
"String",
"param",
")",
"{",
"String",
"[",
"]",
"params",
"=",
"param",
".",
"split",
"(",
"\" \"",
")",
";",
"CommandExecutor",
"processModel",
"=",
"null",
";",
"synchronized"... | Run
@param param param eg: "/system/bin/ping -c 4 -s 100 www.qiujuer.net" | [
"Run"
] | train | https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/kit-cmd/src/main/java/net/qiujuer/genius/kit/cmd/CommandExecutor.java#L110-L131 |
Syncleus/aparapi | src/main/java/com/aparapi/internal/model/MethodModel.java | MethodModel.buildBranchGraphs | public void buildBranchGraphs(Map<Integer, Instruction> pcMap) {
"""
Here we connect the branch nodes to the instruction that they branch to.
<p>
Each branch node contains a 'target' field indended to reference the node that the branch targets. Each instruction also contain four seperate lists of branch nodes th... | java | public void buildBranchGraphs(Map<Integer, Instruction> pcMap) {
for (Instruction instruction = pcHead; instruction != null; instruction = instruction.getNextPC()) {
if (instruction.isBranch()) {
final Branch branch = instruction.asBranch();
final Instruction targetInstruction = p... | [
"public",
"void",
"buildBranchGraphs",
"(",
"Map",
"<",
"Integer",
",",
"Instruction",
">",
"pcMap",
")",
"{",
"for",
"(",
"Instruction",
"instruction",
"=",
"pcHead",
";",
"instruction",
"!=",
"null",
";",
"instruction",
"=",
"instruction",
".",
"getNextPC",
... | Here we connect the branch nodes to the instruction that they branch to.
<p>
Each branch node contains a 'target' field indended to reference the node that the branch targets. Each instruction also contain four seperate lists of branch nodes that reference it.
These lists hold forwardConditional, forwardUnconditional, ... | [
"Here",
"we",
"connect",
"the",
"branch",
"nodes",
"to",
"the",
"instruction",
"that",
"they",
"branch",
"to",
".",
"<p",
">",
"Each",
"branch",
"node",
"contains",
"a",
"target",
"field",
"indended",
"to",
"reference",
"the",
"node",
"that",
"the",
"branc... | train | https://github.com/Syncleus/aparapi/blob/6d5892c8e69854b3968c541023de37cf4762bd24/src/main/java/com/aparapi/internal/model/MethodModel.java#L315-L323 |
Netflix/Hystrix | hystrix-core/src/main/java/com/netflix/hystrix/strategy/properties/HystrixPropertiesFactory.java | HystrixPropertiesFactory.getCommandProperties | public static HystrixCommandProperties getCommandProperties(HystrixCommandKey key, HystrixCommandProperties.Setter builder) {
"""
Get an instance of {@link HystrixCommandProperties} with the given factory {@link HystrixPropertiesStrategy} implementation for each {@link HystrixCommand} instance.
@param key
Pass... | java | public static HystrixCommandProperties getCommandProperties(HystrixCommandKey key, HystrixCommandProperties.Setter builder) {
HystrixPropertiesStrategy hystrixPropertiesStrategy = HystrixPlugins.getInstance().getPropertiesStrategy();
String cacheKey = hystrixPropertiesStrategy.getCommandPropertiesCacheK... | [
"public",
"static",
"HystrixCommandProperties",
"getCommandProperties",
"(",
"HystrixCommandKey",
"key",
",",
"HystrixCommandProperties",
".",
"Setter",
"builder",
")",
"{",
"HystrixPropertiesStrategy",
"hystrixPropertiesStrategy",
"=",
"HystrixPlugins",
".",
"getInstance",
"... | Get an instance of {@link HystrixCommandProperties} with the given factory {@link HystrixPropertiesStrategy} implementation for each {@link HystrixCommand} instance.
@param key
Pass-thru to {@link HystrixPropertiesStrategy#getCommandProperties} implementation.
@param builder
Pass-thru to {@link HystrixPropertiesStrate... | [
"Get",
"an",
"instance",
"of",
"{",
"@link",
"HystrixCommandProperties",
"}",
"with",
"the",
"given",
"factory",
"{",
"@link",
"HystrixPropertiesStrategy",
"}",
"implementation",
"for",
"each",
"{",
"@link",
"HystrixCommand",
"}",
"instance",
"."
] | train | https://github.com/Netflix/Hystrix/blob/3cb21589895e9f8f87cfcdbc9d96d9f63d48b848/hystrix-core/src/main/java/com/netflix/hystrix/strategy/properties/HystrixPropertiesFactory.java#L61-L86 |
ops4j/org.ops4j.base | ops4j-base-util/src/main/java/org/ops4j/util/i18n/Resources.java | Resources.getDateTime | public Date getDateTime( String key, Date defaultValue )
throws MissingResourceException {
"""
Retrieve a time from bundle.
@param key the key of resource
@param defaultValue the default value if key is missing
@return the resource time
@throws MissingResourceException if the requested k... | java | public Date getDateTime( String key, Date defaultValue )
throws MissingResourceException
{
try
{
return getDateTime( key );
}
catch( MissingResourceException mre )
{
return defaultValue;
}
} | [
"public",
"Date",
"getDateTime",
"(",
"String",
"key",
",",
"Date",
"defaultValue",
")",
"throws",
"MissingResourceException",
"{",
"try",
"{",
"return",
"getDateTime",
"(",
"key",
")",
";",
"}",
"catch",
"(",
"MissingResourceException",
"mre",
")",
"{",
"retu... | Retrieve a time from bundle.
@param key the key of resource
@param defaultValue the default value if key is missing
@return the resource time
@throws MissingResourceException if the requested key is unknown | [
"Retrieve",
"a",
"time",
"from",
"bundle",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/i18n/Resources.java#L631-L642 |
craftercms/commons | utilities/src/main/java/org/craftercms/commons/crypto/PGPUtils.java | PGPUtils.findSecretKey | protected static PGPPrivateKey findSecretKey(InputStream keyStream, long keyId, char[] password) throws Exception {
"""
Extracts the PGP private key from an encoded stream.
@param keyStream stream providing the encoded private key
@param keyId id of the secret key to extract
@param password passphrase for the s... | java | protected static PGPPrivateKey findSecretKey(InputStream keyStream, long keyId, char[] password) throws Exception {
PGPSecretKeyRingCollection keyRings = new PGPSecretKeyRingCollection(PGPUtil.getDecoderStream(keyStream), new
BcKeyFingerprintCalculator());
PGPSecretKey secretKey = keyRings.g... | [
"protected",
"static",
"PGPPrivateKey",
"findSecretKey",
"(",
"InputStream",
"keyStream",
",",
"long",
"keyId",
",",
"char",
"[",
"]",
"password",
")",
"throws",
"Exception",
"{",
"PGPSecretKeyRingCollection",
"keyRings",
"=",
"new",
"PGPSecretKeyRingCollection",
"(",... | Extracts the PGP private key from an encoded stream.
@param keyStream stream providing the encoded private key
@param keyId id of the secret key to extract
@param password passphrase for the secret key
@return the private key object
@throws IOException if there is an error reading from the stream
@throws PGPException i... | [
"Extracts",
"the",
"PGP",
"private",
"key",
"from",
"an",
"encoded",
"stream",
"."
] | train | https://github.com/craftercms/commons/blob/3074fe49e56c2a4aae0832f40b17ae563335dc83/utilities/src/main/java/org/craftercms/commons/crypto/PGPUtils.java#L228-L239 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/PoolOperations.java | PoolOperations.stopResizePool | public void stopResizePool(String poolId, Iterable<BatchClientBehavior> additionalBehaviors)
throws BatchErrorException, IOException {
"""
Stops a pool resize operation.
@param poolId
The ID of the pool.
@param additionalBehaviors
A collection of {@link BatchClientBehavior} instances that are
ap... | java | public void stopResizePool(String poolId, Iterable<BatchClientBehavior> additionalBehaviors)
throws BatchErrorException, IOException {
PoolStopResizeOptions options = new PoolStopResizeOptions();
BehaviorManager bhMgr = new BehaviorManager(this.customBehaviors(), additionalBehaviors);
... | [
"public",
"void",
"stopResizePool",
"(",
"String",
"poolId",
",",
"Iterable",
"<",
"BatchClientBehavior",
">",
"additionalBehaviors",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"PoolStopResizeOptions",
"options",
"=",
"new",
"PoolStopResizeOptions",
... | Stops a pool resize operation.
@param poolId
The ID of the pool.
@param additionalBehaviors
A collection of {@link BatchClientBehavior} instances that are
applied to the Batch service request.
@throws BatchErrorException
Exception thrown when an error response is received from the
Batch service.
@throws IOException
Ex... | [
"Stops",
"a",
"pool",
"resize",
"operation",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/PoolOperations.java#L649-L656 |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/optional/Html.java | Html.neckoParse | public static Object neckoParse(final ChainedHttpConfig config, final FromServer fromServer) {
"""
Method that provides an HTML parser for response configuration (uses necko parser).
@param config the chained configuration
@param fromServer the server response adapter
@return the parsed HTML content (a {@link... | java | public static Object neckoParse(final ChainedHttpConfig config, final FromServer fromServer) {
try {
final XMLReader p = new org.cyberneko.html.parsers.SAXParser();
p.setEntityResolver(NativeHandlers.Parsers.catalogResolver);
return new XmlSlurper(p).parse(new InputStreamRead... | [
"public",
"static",
"Object",
"neckoParse",
"(",
"final",
"ChainedHttpConfig",
"config",
",",
"final",
"FromServer",
"fromServer",
")",
"{",
"try",
"{",
"final",
"XMLReader",
"p",
"=",
"new",
"org",
".",
"cyberneko",
".",
"html",
".",
"parsers",
".",
"SAXPar... | Method that provides an HTML parser for response configuration (uses necko parser).
@param config the chained configuration
@param fromServer the server response adapter
@return the parsed HTML content (a {@link groovy.util.slurpersupport.GPathResult} object) | [
"Method",
"that",
"provides",
"an",
"HTML",
"parser",
"for",
"response",
"configuration",
"(",
"uses",
"necko",
"parser",
")",
"."
] | train | https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/optional/Html.java#L56-L64 |
fcrepo3/fcrepo | fcrepo-client/fcrepo-client-admin/src/main/java/org/fcrepo/client/Uploader.java | Uploader.main | public static void main(String[] args) {
"""
Test this class by uploading the given file three times. First, with the
provided credentials, as an InputStream. Second, with the provided
credentials, as a File. Third, with bogus credentials, as a File.
"""
try {
if (args.length == 5 || args... | java | public static void main(String[] args) {
try {
if (args.length == 5 || args.length == 6) {
String protocol = args[0];
int port = Integer.parseInt(args[1]);
String user = args[2];
String password = args[3];
String fileNam... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"try",
"{",
"if",
"(",
"args",
".",
"length",
"==",
"5",
"||",
"args",
".",
"length",
"==",
"6",
")",
"{",
"String",
"protocol",
"=",
"args",
"[",
"0",
"]",
";",
"in... | Test this class by uploading the given file three times. First, with the
provided credentials, as an InputStream. Second, with the provided
credentials, as a File. Third, with bogus credentials, as a File. | [
"Test",
"this",
"class",
"by",
"uploading",
"the",
"given",
"file",
"three",
"times",
".",
"First",
"with",
"the",
"provided",
"credentials",
"as",
"an",
"InputStream",
".",
"Second",
"with",
"the",
"provided",
"credentials",
"as",
"a",
"File",
".",
"Third",... | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-client/fcrepo-client-admin/src/main/java/org/fcrepo/client/Uploader.java#L159-L193 |
mozilla/rhino | src/org/mozilla/javascript/NativeJavaObject.java | NativeJavaObject.coerceType | @Deprecated
public static Object coerceType(Class<?> type, Object value) {
"""
Not intended for public use. Callers should use the
public API Context.toType.
@deprecated as of 1.5 Release 4
@see org.mozilla.javascript.Context#jsToJava(Object, Class)
"""
return coerceTypeImpl(type, value);
} | java | @Deprecated
public static Object coerceType(Class<?> type, Object value)
{
return coerceTypeImpl(type, value);
} | [
"@",
"Deprecated",
"public",
"static",
"Object",
"coerceType",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Object",
"value",
")",
"{",
"return",
"coerceTypeImpl",
"(",
"type",
",",
"value",
")",
";",
"}"
] | Not intended for public use. Callers should use the
public API Context.toType.
@deprecated as of 1.5 Release 4
@see org.mozilla.javascript.Context#jsToJava(Object, Class) | [
"Not",
"intended",
"for",
"public",
"use",
".",
"Callers",
"should",
"use",
"the",
"public",
"API",
"Context",
".",
"toType",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/NativeJavaObject.java#L496-L500 |
WolfgangFahl/Mediawiki-Japi | src/main/java/com/bitplan/mediawiki/japi/user/Crypt.java | Crypt.getRandomCrypt | public static Crypt getRandomCrypt() {
"""
get a random Crypt
@return a new crypt with a 32 byte random key and 8byte salt
"""
String lCypher=generateRandomKey(32);
String lSalt=generateRandomKey(8);
Crypt result=new Crypt(lCypher,lSalt);
return result;
} | java | public static Crypt getRandomCrypt() {
String lCypher=generateRandomKey(32);
String lSalt=generateRandomKey(8);
Crypt result=new Crypt(lCypher,lSalt);
return result;
} | [
"public",
"static",
"Crypt",
"getRandomCrypt",
"(",
")",
"{",
"String",
"lCypher",
"=",
"generateRandomKey",
"(",
"32",
")",
";",
"String",
"lSalt",
"=",
"generateRandomKey",
"(",
"8",
")",
";",
"Crypt",
"result",
"=",
"new",
"Crypt",
"(",
"lCypher",
",",
... | get a random Crypt
@return a new crypt with a 32 byte random key and 8byte salt | [
"get",
"a",
"random",
"Crypt"
] | train | https://github.com/WolfgangFahl/Mediawiki-Japi/blob/78d0177ebfe02eb05da5550839727861f1e888a5/src/main/java/com/bitplan/mediawiki/japi/user/Crypt.java#L112-L117 |
trajano/caliper | caliper/src/main/java/com/google/caliper/runner/CaliperMain.java | CaliperMain.main | public static void main(String[] args) {
"""
Entry point for the caliper benchmark runner application; run with {@code --help} for details.
"""
PrintWriter stdout = new PrintWriter(System.out, true);
PrintWriter stderr = new PrintWriter(System.err, true);
int code = 1; // pessimism!
try {
... | java | public static void main(String[] args) {
PrintWriter stdout = new PrintWriter(System.out, true);
PrintWriter stderr = new PrintWriter(System.err, true);
int code = 1; // pessimism!
try {
exitlessMain(args, stdout, stderr);
code = 0;
} catch (InvalidCommandException e) {
e.display... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"PrintWriter",
"stdout",
"=",
"new",
"PrintWriter",
"(",
"System",
".",
"out",
",",
"true",
")",
";",
"PrintWriter",
"stderr",
"=",
"new",
"PrintWriter",
"(",
"System",
".",
... | Entry point for the caliper benchmark runner application; run with {@code --help} for details. | [
"Entry",
"point",
"for",
"the",
"caliper",
"benchmark",
"runner",
"application",
";",
"run",
"with",
"{"
] | train | https://github.com/trajano/caliper/blob/a8bcfd84fa9d7b893b3edfadc3b13240ae5cd658/caliper/src/main/java/com/google/caliper/runner/CaliperMain.java#L73-L102 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbSearch.java | TmdbSearch.searchMulti | public ResultList<MediaBasic> searchMulti(String query, Integer page, String language, Boolean includeAdult) throws MovieDbException {
"""
Search the movie, tv show and person collections with a single query.
Each item returned in the result array has a media_type field that maps to either movie, tv or person.
... | java | public ResultList<MediaBasic> searchMulti(String query, Integer page, String language, Boolean includeAdult) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.QUERY, query);
parameters.add(Param.PAGE, page);
parameters.add(Param.LANGUAGE, la... | [
"public",
"ResultList",
"<",
"MediaBasic",
">",
"searchMulti",
"(",
"String",
"query",
",",
"Integer",
"page",
",",
"String",
"language",
",",
"Boolean",
"includeAdult",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParam... | Search the movie, tv show and person collections with a single query.
Each item returned in the result array has a media_type field that maps to either movie, tv or person.
Each mapped result is the same response you would get from each independent search
@param query
@param page
@param language
@param includeAdult
... | [
"Search",
"the",
"movie",
"tv",
"show",
"and",
"person",
"collections",
"with",
"a",
"single",
"query",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbSearch.java#L173-L192 |
js-lib-com/commons | src/main/java/js/util/Classes.java | Classes.findMethod | public static Method findMethod(Class<?> clazz, String methodName) throws NoSuchMethodException {
"""
Find method with given name and unknown parameter types. Traverses all declared methods from given class and
returns the one with specified name; if none found throws {@link NoSuchMethodException}. If there are o... | java | public static Method findMethod(Class<?> clazz, String methodName) throws NoSuchMethodException
{
for(Method method : clazz.getDeclaredMethods()) {
if(method.getName().equals(methodName)) {
method.setAccessible(true);
return method;
}
}
Class<?> superclass = clazz.get... | [
"public",
"static",
"Method",
"findMethod",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
")",
"throws",
"NoSuchMethodException",
"{",
"for",
"(",
"Method",
"method",
":",
"clazz",
".",
"getDeclaredMethods",
"(",
")",
")",
"{",
"if",
"... | Find method with given name and unknown parameter types. Traverses all declared methods from given class and
returns the one with specified name; if none found throws {@link NoSuchMethodException}. If there are overloaded
methods returns one of them but there is no guarantee which one. Returned method has accessibility... | [
"Find",
"method",
"with",
"given",
"name",
"and",
"unknown",
"parameter",
"types",
".",
"Traverses",
"all",
"declared",
"methods",
"from",
"given",
"class",
"and",
"returns",
"the",
"one",
"with",
"specified",
"name",
";",
"if",
"none",
"found",
"throws",
"{... | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Classes.java#L563-L580 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/dynssl/SslCertificateUtils.java | SslCertificateUtils.containsSection | private static boolean containsSection(String contents, String beginToken, String endToken) {
"""
Tells whether or not the given ({@code .pem} file) contents contain a section with the given begin and end tokens.
@param contents the ({@code .pem} file) contents to check if contains the section.
@param beginTok... | java | private static boolean containsSection(String contents, String beginToken, String endToken) {
int idxToken;
if ((idxToken = contents.indexOf(beginToken)) == -1 || contents.indexOf(endToken) < idxToken) {
return false;
}
return true;
} | [
"private",
"static",
"boolean",
"containsSection",
"(",
"String",
"contents",
",",
"String",
"beginToken",
",",
"String",
"endToken",
")",
"{",
"int",
"idxToken",
";",
"if",
"(",
"(",
"idxToken",
"=",
"contents",
".",
"indexOf",
"(",
"beginToken",
")",
")",
... | Tells whether or not the given ({@code .pem} file) contents contain a section with the given begin and end tokens.
@param contents the ({@code .pem} file) contents to check if contains the section.
@param beginToken the begin token of the section.
@param endToken the end token of the section.
@return {@code true} if t... | [
"Tells",
"whether",
"or",
"not",
"the",
"given",
"(",
"{",
"@code",
".",
"pem",
"}",
"file",
")",
"contents",
"contain",
"a",
"section",
"with",
"the",
"given",
"begin",
"and",
"end",
"tokens",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/dynssl/SslCertificateUtils.java#L253-L259 |
dickschoeller/gedbrowser | geoservice-persistence/src/main/java/org/schoellerfamily/geoservice/model/builder/GeocodeResultBuilder.java | GeocodeResultBuilder.toGeoServiceGeometry | public FeatureCollection toGeoServiceGeometry(final Geometry geometry) {
"""
Create a GeoServiceGeometry from a Geometry.
@param geometry the Geometry
@return the GeoServiceGeometry
"""
if (geometry == null) {
return GeoServiceGeometry.createFeatureCollection(
toLoca... | java | public FeatureCollection toGeoServiceGeometry(final Geometry geometry) {
if (geometry == null) {
return GeoServiceGeometry.createFeatureCollection(
toLocationFeature(new LatLng(Double.NaN, Double.NaN),
LocationType.UNKNOWN),
null, n... | [
"public",
"FeatureCollection",
"toGeoServiceGeometry",
"(",
"final",
"Geometry",
"geometry",
")",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"GeoServiceGeometry",
".",
"createFeatureCollection",
"(",
"toLocationFeature",
"(",
"new",
"LatLng",
"(",... | Create a GeoServiceGeometry from a Geometry.
@param geometry the Geometry
@return the GeoServiceGeometry | [
"Create",
"a",
"GeoServiceGeometry",
"from",
"a",
"Geometry",
"."
] | train | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/geoservice-persistence/src/main/java/org/schoellerfamily/geoservice/model/builder/GeocodeResultBuilder.java#L200-L211 |
EvidentSolutions/dalesbred | dalesbred/src/main/java/org/dalesbred/Database.java | Database.findUnique | public <T> T findUnique(@NotNull Class<T> cl, @NotNull SqlQuery query) {
"""
Finds a unique result from database, converting the database row to given class using default mechanisms.
@throws NonUniqueResultException if there is more then one row
@throws EmptyResultException if there are no rows
"""
... | java | public <T> T findUnique(@NotNull Class<T> cl, @NotNull SqlQuery query) {
return executeQuery(rowMapperForClass(cl).unique(), query);
} | [
"public",
"<",
"T",
">",
"T",
"findUnique",
"(",
"@",
"NotNull",
"Class",
"<",
"T",
">",
"cl",
",",
"@",
"NotNull",
"SqlQuery",
"query",
")",
"{",
"return",
"executeQuery",
"(",
"rowMapperForClass",
"(",
"cl",
")",
".",
"unique",
"(",
")",
",",
"quer... | Finds a unique result from database, converting the database row to given class using default mechanisms.
@throws NonUniqueResultException if there is more then one row
@throws EmptyResultException if there are no rows | [
"Finds",
"a",
"unique",
"result",
"from",
"database",
"converting",
"the",
"database",
"row",
"to",
"given",
"class",
"using",
"default",
"mechanisms",
"."
] | train | https://github.com/EvidentSolutions/dalesbred/blob/713f5b6e152d97e1672ca68b9ff9c7c6c288ceb1/dalesbred/src/main/java/org/dalesbred/Database.java#L352-L354 |
BioPAX/Paxtools | pattern/src/main/java/org/biopax/paxtools/pattern/constraint/OR.java | OR.satisfies | @Override
public boolean satisfies(Match match, int... ind) {
"""
Checks if any of the wrapped constraints satisfy.
@param match current pattern match
@param ind mapped indices
@return true if any of the wrapped constraints satisfy
"""
for (MappedConst mc : con)
{
if (mc.satisfies(match, ind)) retur... | java | @Override
public boolean satisfies(Match match, int... ind)
{
for (MappedConst mc : con)
{
if (mc.satisfies(match, ind)) return true;
}
return false;
} | [
"@",
"Override",
"public",
"boolean",
"satisfies",
"(",
"Match",
"match",
",",
"int",
"...",
"ind",
")",
"{",
"for",
"(",
"MappedConst",
"mc",
":",
"con",
")",
"{",
"if",
"(",
"mc",
".",
"satisfies",
"(",
"match",
",",
"ind",
")",
")",
"return",
"t... | Checks if any of the wrapped constraints satisfy.
@param match current pattern match
@param ind mapped indices
@return true if any of the wrapped constraints satisfy | [
"Checks",
"if",
"any",
"of",
"the",
"wrapped",
"constraints",
"satisfy",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/OR.java#L39-L47 |
molgenis/molgenis | molgenis-r/src/main/java/org/molgenis/r/RScriptExecutor.java | RScriptExecutor.executeScriptGetFileRequest | private void executeScriptGetFileRequest(
String openCpuSessionKey, String scriptOutputFilename, String outputPathname)
throws IOException {
"""
Retrieve R script file response using OpenCPU and write to file
@param openCpuSessionKey OpenCPU session key
@param scriptOutputFilename R script output f... | java | private void executeScriptGetFileRequest(
String openCpuSessionKey, String scriptOutputFilename, String outputPathname)
throws IOException {
URI scriptGetValueResponseUri =
getScriptGetFileResponseUri(openCpuSessionKey, scriptOutputFilename);
HttpGet httpGet = new HttpGet(scriptGetValueRespo... | [
"private",
"void",
"executeScriptGetFileRequest",
"(",
"String",
"openCpuSessionKey",
",",
"String",
"scriptOutputFilename",
",",
"String",
"outputPathname",
")",
"throws",
"IOException",
"{",
"URI",
"scriptGetValueResponseUri",
"=",
"getScriptGetFileResponseUri",
"(",
"ope... | Retrieve R script file response using OpenCPU and write to file
@param openCpuSessionKey OpenCPU session key
@param scriptOutputFilename R script output filename
@param outputPathname Output pathname
@throws IOException if error occured during script response retrieval | [
"Retrieve",
"R",
"script",
"file",
"response",
"using",
"OpenCPU",
"and",
"write",
"to",
"file"
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-r/src/main/java/org/molgenis/r/RScriptExecutor.java#L137-L153 |
qos-ch/slf4j | slf4j-migrator/src/main/java/org/slf4j/migrator/ProjectConverter.java | ProjectConverter.scanFile | private void scanFile(File file) {
"""
Convert the specified file Read each line and ask matcher implementation
for conversion Rewrite the line returned by matcher
@param file
"""
try {
InplaceFileConverter fc = new InplaceFileConverter(ruleSet, progressListener);
fc.convert... | java | private void scanFile(File file) {
try {
InplaceFileConverter fc = new InplaceFileConverter(ruleSet, progressListener);
fc.convert(file);
} catch (IOException exc) {
addException(new ConversionException(exc.toString()));
}
} | [
"private",
"void",
"scanFile",
"(",
"File",
"file",
")",
"{",
"try",
"{",
"InplaceFileConverter",
"fc",
"=",
"new",
"InplaceFileConverter",
"(",
"ruleSet",
",",
"progressListener",
")",
";",
"fc",
".",
"convert",
"(",
"file",
")",
";",
"}",
"catch",
"(",
... | Convert the specified file Read each line and ask matcher implementation
for conversion Rewrite the line returned by matcher
@param file | [
"Convert",
"the",
"specified",
"file",
"Read",
"each",
"line",
"and",
"ask",
"matcher",
"implementation",
"for",
"conversion",
"Rewrite",
"the",
"line",
"returned",
"by",
"matcher"
] | train | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-migrator/src/main/java/org/slf4j/migrator/ProjectConverter.java#L100-L107 |
SeaCloudsEU/SeaCloudsPlatform | sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/AgreementRestEntity.java | AgreementRestEntity.getAgreementsPerTemplateAndConsumer | @GET
@Path("agreementsPerTemplateAndConsumer")
@Deprecated
public List<IAgreement> getAgreementsPerTemplateAndConsumer(
@QueryParam("consumerId") String consumerId,
@QueryParam("templateUUID") String templateUUID) {
"""
Gets a the list of available agreements from where we can g... | java | @GET
@Path("agreementsPerTemplateAndConsumer")
@Deprecated
public List<IAgreement> getAgreementsPerTemplateAndConsumer(
@QueryParam("consumerId") String consumerId,
@QueryParam("templateUUID") String templateUUID) {
logger.debug("StartOf getAgreementsPerTemplateAndConsumer - ... | [
"@",
"GET",
"@",
"Path",
"(",
"\"agreementsPerTemplateAndConsumer\"",
")",
"@",
"Deprecated",
"public",
"List",
"<",
"IAgreement",
">",
"getAgreementsPerTemplateAndConsumer",
"(",
"@",
"QueryParam",
"(",
"\"consumerId\"",
")",
"String",
"consumerId",
",",
"@",
"Quer... | Gets a the list of available agreements from where we can get metrics,
host information, etc.
</pre>
Example:
<li>curl http://localhost:8080/sla-service/agreements</li>
<li>curl http://localhost:8080/sla-service/agreements?consumerId=user-10343</li>
@throws NotFoundException
@throws JAXBException | [
"Gets",
"a",
"the",
"list",
"of",
"available",
"agreements",
"from",
"where",
"we",
"can",
"get",
"metrics",
"host",
"information",
"etc",
"."
] | train | https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/AgreementRestEntity.java#L172-L183 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/jboss/logging/Logger.java | Logger.errorf | public void errorf(Throwable t, String format, Object... params) {
"""
Issue a formatted log message with a level of ERROR.
@param t the throwable
@param format the format string, as per {@link String#format(String, Object...)}
@param params the parameters
"""
doLogf(Level.ERROR, FQCN, format, par... | java | public void errorf(Throwable t, String format, Object... params) {
doLogf(Level.ERROR, FQCN, format, params, t);
} | [
"public",
"void",
"errorf",
"(",
"Throwable",
"t",
",",
"String",
"format",
",",
"Object",
"...",
"params",
")",
"{",
"doLogf",
"(",
"Level",
".",
"ERROR",
",",
"FQCN",
",",
"format",
",",
"params",
",",
"t",
")",
";",
"}"
] | Issue a formatted log message with a level of ERROR.
@param t the throwable
@param format the format string, as per {@link String#format(String, Object...)}
@param params the parameters | [
"Issue",
"a",
"formatted",
"log",
"message",
"with",
"a",
"level",
"of",
"ERROR",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/jboss/logging/Logger.java#L1716-L1718 |
Jasig/uPortal | uPortal-web/src/main/java/org/apereo/portal/portlet/rendering/PortletRendererImpl.java | PortletRendererImpl.constructPortletRenderResult | protected PortletRenderResult constructPortletRenderResult(
HttpServletRequest httpServletRequest, long renderTime) {
"""
Construct a {@link PortletRenderResult} from information in the {@link HttpServletRequest}.
The second argument is how long the render action took.
@param httpServletRequest
@p... | java | protected PortletRenderResult constructPortletRenderResult(
HttpServletRequest httpServletRequest, long renderTime) {
final String title =
(String) httpServletRequest.getAttribute(IPortletRenderer.ATTRIBUTE__PORTLET_TITLE);
final String newItemCountString =
(S... | [
"protected",
"PortletRenderResult",
"constructPortletRenderResult",
"(",
"HttpServletRequest",
"httpServletRequest",
",",
"long",
"renderTime",
")",
"{",
"final",
"String",
"title",
"=",
"(",
"String",
")",
"httpServletRequest",
".",
"getAttribute",
"(",
"IPortletRenderer... | Construct a {@link PortletRenderResult} from information in the {@link HttpServletRequest}.
The second argument is how long the render action took.
@param httpServletRequest
@param renderTime
@return an appropriate {@link PortletRenderResult}, never null | [
"Construct",
"a",
"{",
"@link",
"PortletRenderResult",
"}",
"from",
"information",
"in",
"the",
"{",
"@link",
"HttpServletRequest",
"}",
".",
"The",
"second",
"argument",
"is",
"how",
"long",
"the",
"render",
"action",
"took",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-web/src/main/java/org/apereo/portal/portlet/rendering/PortletRendererImpl.java#L612-L630 |
w3c/epubcheck | src/main/java/org/idpf/epubcheck/util/css/CssParser.java | CssParser.hasRuleSet | private boolean hasRuleSet(CssAtRule atRule, CssTokenIterator iter) {
"""
With iter.last at '{', discover the at-rule type. The
contents is a ruleset if '{' comes before ';' or '}'.
"""
int debugIndex;
if (debug)
{
checkArgument(iter.last.getChar() == '{');
debugIndex = iter.index();
... | java | private boolean hasRuleSet(CssAtRule atRule, CssTokenIterator iter)
{
int debugIndex;
if (debug)
{
checkArgument(iter.last.getChar() == '{');
debugIndex = iter.index();
}
List<CssToken> list = iter.list;
for (int i = iter.index() + 1; i < list.size(); i++)
{
CssToken tk =... | [
"private",
"boolean",
"hasRuleSet",
"(",
"CssAtRule",
"atRule",
",",
"CssTokenIterator",
"iter",
")",
"{",
"int",
"debugIndex",
";",
"if",
"(",
"debug",
")",
"{",
"checkArgument",
"(",
"iter",
".",
"last",
".",
"getChar",
"(",
")",
"==",
"'",
"'",
")",
... | With iter.last at '{', discover the at-rule type. The
contents is a ruleset if '{' comes before ';' or '}'. | [
"With",
"iter",
".",
"last",
"at",
"{",
"discover",
"the",
"at",
"-",
"rule",
"type",
".",
"The",
"contents",
"is",
"a",
"ruleset",
"if",
"{",
"comes",
"before",
";",
"or",
"}",
"."
] | train | https://github.com/w3c/epubcheck/blob/4d5a24d9f2878a2a5497eb11c036cc18fe2c0a78/src/main/java/org/idpf/epubcheck/util/css/CssParser.java#L666-L693 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/LocaleMatcher.java | LocaleMatcher.addLikelySubtags | private ULocale addLikelySubtags(ULocale languageCode) {
"""
We need to add another method to addLikelySubtags that doesn't return
null, but instead substitutes Zzzz and ZZ if unknown. There are also
a few cases where addLikelySubtags needs to have expanded data, to handle
all deprecated codes.
@param language... | java | private ULocale addLikelySubtags(ULocale languageCode) {
// max("und") = "en_Latn_US", and since matching is based on maximized tags, the undefined
// language would normally match English. But that would produce the counterintuitive results
// that getBestMatch("und", LocaleMatcher("it,en")) w... | [
"private",
"ULocale",
"addLikelySubtags",
"(",
"ULocale",
"languageCode",
")",
"{",
"// max(\"und\") = \"en_Latn_US\", and since matching is based on maximized tags, the undefined",
"// language would normally match English. But that would produce the counterintuitive results",
"// that getBest... | We need to add another method to addLikelySubtags that doesn't return
null, but instead substitutes Zzzz and ZZ if unknown. There are also
a few cases where addLikelySubtags needs to have expanded data, to handle
all deprecated codes.
@param languageCode
@return "fixed" addLikelySubtags | [
"We",
"need",
"to",
"add",
"another",
"method",
"to",
"addLikelySubtags",
"that",
"doesn",
"t",
"return",
"null",
"but",
"instead",
"substitutes",
"Zzzz",
"and",
"ZZ",
"if",
"unknown",
".",
"There",
"are",
"also",
"a",
"few",
"cases",
"where",
"addLikelySubt... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/LocaleMatcher.java#L352-L377 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/logging/Logger.java | Logger.getAnonymousLogger | @CallerSensitive
public static Logger getAnonymousLogger(String resourceBundleName) {
"""
adding a new anonymous Logger object is handled by doSetParent().
"""
LogManager manager = LogManager.getLogManager();
// cleanup some Loggers that have been GC'ed
manager.drainLoggerRefQueueBo... | java | @CallerSensitive
public static Logger getAnonymousLogger(String resourceBundleName) {
LogManager manager = LogManager.getLogManager();
// cleanup some Loggers that have been GC'ed
manager.drainLoggerRefQueueBounded();
// Android-changed: Use VMStack.getStackClass1.
/* J2ObjC ... | [
"@",
"CallerSensitive",
"public",
"static",
"Logger",
"getAnonymousLogger",
"(",
"String",
"resourceBundleName",
")",
"{",
"LogManager",
"manager",
"=",
"LogManager",
".",
"getLogManager",
"(",
")",
";",
"// cleanup some Loggers that have been GC'ed",
"manager",
".",
"d... | adding a new anonymous Logger object is handled by doSetParent(). | [
"adding",
"a",
"new",
"anonymous",
"Logger",
"object",
"is",
"handled",
"by",
"doSetParent",
"()",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/logging/Logger.java#L549-L564 |
arquillian/arquillian-recorder | arquillian-recorder/arquillian-recorder-api/src/main/java/org/arquillian/extension/recorder/Configuration.java | Configuration.getProperty | public String getProperty(String name, String defaultValue) throws IllegalStateException {
"""
Gets value of {@code name} property. In case a value for such name does not exist or is a null object or an empty string,
{@code defaultValue} is returned.
@param name name of a property you want to get the value of
... | java | public String getProperty(String name, String defaultValue) throws IllegalStateException {
Validate.notNullOrEmpty(name, "Unable to get the configuration value of null or empty configuration key");
Validate.notNull(defaultValue, "Unable to set configuration value of " + name + " to null object.");
... | [
"public",
"String",
"getProperty",
"(",
"String",
"name",
",",
"String",
"defaultValue",
")",
"throws",
"IllegalStateException",
"{",
"Validate",
".",
"notNullOrEmpty",
"(",
"name",
",",
"\"Unable to get the configuration value of null or empty configuration key\"",
")",
";... | Gets value of {@code name} property. In case a value for such name does not exist or is a null object or an empty string,
{@code defaultValue} is returned.
@param name name of a property you want to get the value of
@param defaultValue value returned in case {@code name} is a null string or it is empty
@return value o... | [
"Gets",
"value",
"of",
"{",
"@code",
"name",
"}",
"property",
".",
"In",
"case",
"a",
"value",
"for",
"such",
"name",
"does",
"not",
"exist",
"or",
"is",
"a",
"null",
"object",
"or",
"an",
"empty",
"string",
"{",
"@code",
"defaultValue",
"}",
"is",
"... | train | https://github.com/arquillian/arquillian-recorder/blob/e3417111deb03a2e2d9b96d38b986db17e2c1d19/arquillian-recorder/arquillian-recorder-api/src/main/java/org/arquillian/extension/recorder/Configuration.java#L65-L75 |
pwall567/jsonutil | src/main/java/net/pwall/json/JSONObject.java | JSONObject.putValue | public JSONObject putValue(String key, double value) {
"""
Add a {@link JSONDouble} representing the supplied {@code double} to the
{@code JSONObject}.
@param key the key to use when storing the value
@param value the value
@return {@code this} (for chaining)
@throws NullPointerE... | java | public JSONObject putValue(String key, double value) {
put(key, JSONDouble.valueOf(value));
return this;
} | [
"public",
"JSONObject",
"putValue",
"(",
"String",
"key",
",",
"double",
"value",
")",
"{",
"put",
"(",
"key",
",",
"JSONDouble",
".",
"valueOf",
"(",
"value",
")",
")",
";",
"return",
"this",
";",
"}"
] | Add a {@link JSONDouble} representing the supplied {@code double} to the
{@code JSONObject}.
@param key the key to use when storing the value
@param value the value
@return {@code this} (for chaining)
@throws NullPointerException if key is {@code null} | [
"Add",
"a",
"{",
"@link",
"JSONDouble",
"}",
"representing",
"the",
"supplied",
"{",
"@code",
"double",
"}",
"to",
"the",
"{",
"@code",
"JSONObject",
"}",
"."
] | train | https://github.com/pwall567/jsonutil/blob/dd5960b9b0bcc9acfe6c52b884fffd9ee5f422fe/src/main/java/net/pwall/json/JSONObject.java#L158-L161 |
google/closure-compiler | src/com/google/javascript/jscomp/Compiler.java | Compiler.resolveSibling | private static String resolveSibling(String fromPath, String toPath) {
"""
Simplistic implementation of the java.nio.file.Path resolveSibling method that works with GWT.
@param fromPath - must be a file (not directory)
@param toPath - must be a file (not directory)
"""
// If the destination is an absol... | java | private static String resolveSibling(String fromPath, String toPath) {
// If the destination is an absolute path, nothing to do.
if (toPath.startsWith("/")) {
return toPath;
}
List<String> fromPathParts = new ArrayList<>(Arrays.asList(fromPath.split("/")));
List<String> toPathParts = new Arra... | [
"private",
"static",
"String",
"resolveSibling",
"(",
"String",
"fromPath",
",",
"String",
"toPath",
")",
"{",
"// If the destination is an absolute path, nothing to do.",
"if",
"(",
"toPath",
".",
"startsWith",
"(",
"\"/\"",
")",
")",
"{",
"return",
"toPath",
";",
... | Simplistic implementation of the java.nio.file.Path resolveSibling method that works with GWT.
@param fromPath - must be a file (not directory)
@param toPath - must be a file (not directory) | [
"Simplistic",
"implementation",
"of",
"the",
"java",
".",
"nio",
".",
"file",
".",
"Path",
"resolveSibling",
"method",
"that",
"works",
"with",
"GWT",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L3618-L3643 |
datacleaner/AnalyzerBeans | core/src/main/java/org/eobjects/analyzer/job/runner/AnalysisRunnerJobDelegate.java | AnalysisRunnerJobDelegate.scheduleRowProcessing | private void scheduleRowProcessing(RowProcessingPublishers publishers, LifeCycleHelper lifeCycleHelper,
JobCompletionTaskListener jobCompletionTaskListener, AnalysisJobMetrics analysisJobMetrics) {
"""
Starts row processing job flows.
@param publishers
@param analysisJobMetrics
@param injectionM... | java | private void scheduleRowProcessing(RowProcessingPublishers publishers, LifeCycleHelper lifeCycleHelper,
JobCompletionTaskListener jobCompletionTaskListener, AnalysisJobMetrics analysisJobMetrics) {
logger.info("Created {} row processor publishers", publishers.size());
final List<TaskRunnab... | [
"private",
"void",
"scheduleRowProcessing",
"(",
"RowProcessingPublishers",
"publishers",
",",
"LifeCycleHelper",
"lifeCycleHelper",
",",
"JobCompletionTaskListener",
"jobCompletionTaskListener",
",",
"AnalysisJobMetrics",
"analysisJobMetrics",
")",
"{",
"logger",
".",
"info",
... | Starts row processing job flows.
@param publishers
@param analysisJobMetrics
@param injectionManager | [
"Starts",
"row",
"processing",
"job",
"flows",
"."
] | train | https://github.com/datacleaner/AnalyzerBeans/blob/f82dae080d80d2a647b706a5fb22b3ea250613b3/core/src/main/java/org/eobjects/analyzer/job/runner/AnalysisRunnerJobDelegate.java#L157-L177 |
DiUS/pact-jvm | pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslJsonArray.java | PactDslJsonArray.maxArrayLike | @Override
public PactDslJsonBody maxArrayLike(Integer size, int numberExamples) {
"""
Element that is an array with a maximum size where each item must match the following example
@param size maximum size of the array
@param numberExamples number of examples to generate
"""
if (numberExamples > siz... | java | @Override
public PactDslJsonBody maxArrayLike(Integer size, int numberExamples) {
if (numberExamples > size) {
throw new IllegalArgumentException(String.format("Number of example %d is more than the maximum size of %d",
numberExamples, size));
}
matchers.addRule(rootPath + append... | [
"@",
"Override",
"public",
"PactDslJsonBody",
"maxArrayLike",
"(",
"Integer",
"size",
",",
"int",
"numberExamples",
")",
"{",
"if",
"(",
"numberExamples",
">",
"size",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
"\"... | Element that is an array with a maximum size where each item must match the following example
@param size maximum size of the array
@param numberExamples number of examples to generate | [
"Element",
"that",
"is",
"an",
"array",
"with",
"a",
"maximum",
"size",
"where",
"each",
"item",
"must",
"match",
"the",
"following",
"example"
] | train | https://github.com/DiUS/pact-jvm/blob/2f447e9dd4ac152a6a36b7fcf8962d07de9ef3ef/pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslJsonArray.java#L209-L219 |
netheosgithub/pcs_api | java/src/main/java/net/netheos/pcsapi/storage/StorageBuilder.java | StorageBuilder.setAppInfoRepository | public StorageBuilder setAppInfoRepository( AppInfoRepository appInfoRepo, String appName ) {
"""
Set the app informations repository. This setter must always be called during the build
@param appInfoRepo The repository to use
@param appName The application name
@return The builder
"""
this.appInf... | java | public StorageBuilder setAppInfoRepository( AppInfoRepository appInfoRepo, String appName )
{
this.appInfoRepo = appInfoRepo;
this.appName = appName;
return this;
} | [
"public",
"StorageBuilder",
"setAppInfoRepository",
"(",
"AppInfoRepository",
"appInfoRepo",
",",
"String",
"appName",
")",
"{",
"this",
".",
"appInfoRepo",
"=",
"appInfoRepo",
";",
"this",
".",
"appName",
"=",
"appName",
";",
"return",
"this",
";",
"}"
] | Set the app informations repository. This setter must always be called during the build
@param appInfoRepo The repository to use
@param appName The application name
@return The builder | [
"Set",
"the",
"app",
"informations",
"repository",
".",
"This",
"setter",
"must",
"always",
"be",
"called",
"during",
"the",
"build"
] | train | https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/storage/StorageBuilder.java#L66-L72 |
bramp/ffmpeg-cli-wrapper | src/main/java/net/bramp/ffmpeg/FFmpegUtils.java | FFmpegUtils.toTimecode | public static String toTimecode(long duration, TimeUnit units) {
"""
Convert the duration to "hh:mm:ss" timecode representation, where ss (seconds) can be decimal.
@param duration the duration.
@param units the unit the duration is in.
@return the timecode representation.
"""
// FIXME Negative duratio... | java | public static String toTimecode(long duration, TimeUnit units) {
// FIXME Negative durations are also supported.
// https://www.ffmpeg.org/ffmpeg-utils.html#Time-duration
checkArgument(duration >= 0, "duration must be positive");
long nanoseconds = units.toNanos(duration); // TODO This will clip at Lon... | [
"public",
"static",
"String",
"toTimecode",
"(",
"long",
"duration",
",",
"TimeUnit",
"units",
")",
"{",
"// FIXME Negative durations are also supported.",
"// https://www.ffmpeg.org/ffmpeg-utils.html#Time-duration",
"checkArgument",
"(",
"duration",
">=",
"0",
",",
"\"durati... | Convert the duration to "hh:mm:ss" timecode representation, where ss (seconds) can be decimal.
@param duration the duration.
@param units the unit the duration is in.
@return the timecode representation. | [
"Convert",
"the",
"duration",
"to",
"hh",
":",
"mm",
":",
"ss",
"timecode",
"representation",
"where",
"ss",
"(",
"seconds",
")",
"can",
"be",
"decimal",
"."
] | train | https://github.com/bramp/ffmpeg-cli-wrapper/blob/3819b155edf9132acc75bb6af66dcef1b98c64b2/src/main/java/net/bramp/ffmpeg/FFmpegUtils.java#L51-L71 |
aol/cyclops | cyclops/src/main/java/com/oath/cyclops/internal/stream/FutureStreamUtils.java | FutureStreamUtils.forEachWithError | public static <T, X extends Throwable> Tuple3<CompletableFuture<Subscription>, Runnable, CompletableFuture<Boolean>> forEachWithError(
final Stream<T> stream, final Consumer<? super T> consumerElement, final Consumer<? super Throwable> consumerError) {
"""
Perform a forEach operation over the Stream ... | java | public static <T, X extends Throwable> Tuple3<CompletableFuture<Subscription>, Runnable, CompletableFuture<Boolean>> forEachWithError(
final Stream<T> stream, final Consumer<? super T> consumerElement, final Consumer<? super Throwable> consumerError) {
return forEachEvent(stream, consumerElement, co... | [
"public",
"static",
"<",
"T",
",",
"X",
"extends",
"Throwable",
">",
"Tuple3",
"<",
"CompletableFuture",
"<",
"Subscription",
">",
",",
"Runnable",
",",
"CompletableFuture",
"<",
"Boolean",
">",
">",
"forEachWithError",
"(",
"final",
"Stream",
"<",
"T",
">",... | Perform a forEach operation over the Stream capturing any elements and errors in the supplied consumers,
<pre>
{@code
Subscription next = StreanUtils.forEach(Stream.of(()->1,()->2,()->throw new RuntimeException(),()->4)
.map(Supplier::getValue),System.out::println, e->e.printStackTrace());
System.out.println("proce... | [
"Perform",
"a",
"forEach",
"operation",
"over",
"the",
"Stream",
"capturing",
"any",
"elements",
"and",
"errors",
"in",
"the",
"supplied",
"consumers",
"<pre",
">",
"{",
"@code",
"Subscription",
"next",
"=",
"StreanUtils",
".",
"forEach",
"(",
"Stream",
".",
... | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/com/oath/cyclops/internal/stream/FutureStreamUtils.java#L198-L203 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/modules/CmsDependenciesEdit.java | CmsDependenciesEdit.getModules | private List getModules() {
"""
Get the list of all modules available.<p>
@return list of module names
"""
List retVal = new ArrayList();
// get all modules
Iterator i = OpenCms.getModuleManager().getModuleNames().iterator();
// add them to the list of modules
while ... | java | private List getModules() {
List retVal = new ArrayList();
// get all modules
Iterator i = OpenCms.getModuleManager().getModuleNames().iterator();
// add them to the list of modules
while (i.hasNext()) {
String moduleName = (String)i.next();
if (moduleNam... | [
"private",
"List",
"getModules",
"(",
")",
"{",
"List",
"retVal",
"=",
"new",
"ArrayList",
"(",
")",
";",
"// get all modules",
"Iterator",
"i",
"=",
"OpenCms",
".",
"getModuleManager",
"(",
")",
".",
"getModuleNames",
"(",
")",
".",
"iterator",
"(",
")",
... | Get the list of all modules available.<p>
@return list of module names | [
"Get",
"the",
"list",
"of",
"all",
"modules",
"available",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/modules/CmsDependenciesEdit.java#L381-L413 |
wildfly/wildfly-core | logging/src/main/java/org/jboss/as/logging/LoggingSubsystemParser.java | LoggingSubsystemParser.parsePropertyElement | static void parsePropertyElement(final ModelNode operation, final XMLExtendedStreamReader reader, final String wrapperName) throws XMLStreamException {
"""
Parses a property element.
<p>
The {@code name} attribute is required. If the {@code value} attribute is not present an
{@linkplain org.jboss.dmr.ModelNod... | java | static void parsePropertyElement(final ModelNode operation, final XMLExtendedStreamReader reader, final String wrapperName) throws XMLStreamException {
while (reader.nextTag() != END_ELEMENT) {
final int cnt = reader.getAttributeCount();
String name = null;
String value = nul... | [
"static",
"void",
"parsePropertyElement",
"(",
"final",
"ModelNode",
"operation",
",",
"final",
"XMLExtendedStreamReader",
"reader",
",",
"final",
"String",
"wrapperName",
")",
"throws",
"XMLStreamException",
"{",
"while",
"(",
"reader",
".",
"nextTag",
"(",
")",
... | Parses a property element.
<p>
The {@code name} attribute is required. If the {@code value} attribute is not present an
{@linkplain org.jboss.dmr.ModelNode UNDEFINED ModelNode} will set on the operation.
</p>
@param operation the operation to add the parsed properties to
@param reader the reader to use
@param ... | [
"Parses",
"a",
"property",
"element",
".",
"<p",
">"
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/logging/src/main/java/org/jboss/as/logging/LoggingSubsystemParser.java#L140-L170 |
Netflix/denominator | route53/src/main/java/denominator/route53/Route53AllProfileResourceRecordSetApi.java | Route53AllProfileResourceRecordSetApi.iterateByName | @Override
public Iterator<ResourceRecordSet<?>> iterateByName(String name) {
"""
lists and lazily transforms all record sets for a name which are not aliases into denominator
format.
"""
Filter<ResourceRecordSet<?>> filter = andNotAlias(nameEqualTo(name));
return lazyIterateRRSets(api.listResourceRe... | java | @Override
public Iterator<ResourceRecordSet<?>> iterateByName(String name) {
Filter<ResourceRecordSet<?>> filter = andNotAlias(nameEqualTo(name));
return lazyIterateRRSets(api.listResourceRecordSets(zoneId, name), filter);
} | [
"@",
"Override",
"public",
"Iterator",
"<",
"ResourceRecordSet",
"<",
"?",
">",
">",
"iterateByName",
"(",
"String",
"name",
")",
"{",
"Filter",
"<",
"ResourceRecordSet",
"<",
"?",
">",
">",
"filter",
"=",
"andNotAlias",
"(",
"nameEqualTo",
"(",
"name",
")... | lists and lazily transforms all record sets for a name which are not aliases into denominator
format. | [
"lists",
"and",
"lazily",
"transforms",
"all",
"record",
"sets",
"for",
"a",
"name",
"which",
"are",
"not",
"aliases",
"into",
"denominator",
"format",
"."
] | train | https://github.com/Netflix/denominator/blob/c565e3b8c6043051252e0947029511f9ac5d306f/route53/src/main/java/denominator/route53/Route53AllProfileResourceRecordSetApi.java#L58-L62 |
JetBrains/xodus | openAPI/src/main/java/jetbrains/exodus/env/EnvironmentConfig.java | EnvironmentConfig.setGcFilesInterval | public EnvironmentConfig setGcFilesInterval(final int files) throws InvalidSettingException {
"""
Sets the number of new {@code Log} files (.xd files) that must be created to trigger if necessary (if database
utilization is not sufficient) the next background cleaning cycle (single run of the database garbage col... | java | public EnvironmentConfig setGcFilesInterval(final int files) throws InvalidSettingException {
if (files < 1) {
throw new InvalidSettingException("Invalid number of files: " + files);
}
return setSetting(GC_FILES_INTERVAL, files);
} | [
"public",
"EnvironmentConfig",
"setGcFilesInterval",
"(",
"final",
"int",
"files",
")",
"throws",
"InvalidSettingException",
"{",
"if",
"(",
"files",
"<",
"1",
")",
"{",
"throw",
"new",
"InvalidSettingException",
"(",
"\"Invalid number of files: \"",
"+",
"files",
"... | Sets the number of new {@code Log} files (.xd files) that must be created to trigger if necessary (if database
utilization is not sufficient) the next background cleaning cycle (single run of the database garbage collector)
after the previous cycle finished. Default value is {@code 3}, i.e. GC can start after each 3 ne... | [
"Sets",
"the",
"number",
"of",
"new",
"{",
"@code",
"Log",
"}",
"files",
"(",
".",
"xd",
"files",
")",
"that",
"must",
"be",
"created",
"to",
"trigger",
"if",
"necessary",
"(",
"if",
"database",
"utilization",
"is",
"not",
"sufficient",
")",
"the",
"ne... | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/openAPI/src/main/java/jetbrains/exodus/env/EnvironmentConfig.java#L1956-L1961 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/capability/RuntimeCapability.java | RuntimeCapability.buildDynamicCapabilityName | public static String buildDynamicCapabilityName(String baseName, String ... dynamicNameElement) {
"""
Constructs a full capability name from a static base name and a dynamic element.
@param baseName the base name. Cannot be {@code null}
@param dynamicNameElement the dynamic portion of the name. Cannot be {@co... | java | public static String buildDynamicCapabilityName(String baseName, String ... dynamicNameElement) {
assert baseName != null;
assert dynamicNameElement != null;
assert dynamicNameElement.length > 0;
StringBuilder sb = new StringBuilder(baseName);
for (String part:dynamicNameElement)... | [
"public",
"static",
"String",
"buildDynamicCapabilityName",
"(",
"String",
"baseName",
",",
"String",
"...",
"dynamicNameElement",
")",
"{",
"assert",
"baseName",
"!=",
"null",
";",
"assert",
"dynamicNameElement",
"!=",
"null",
";",
"assert",
"dynamicNameElement",
"... | Constructs a full capability name from a static base name and a dynamic element.
@param baseName the base name. Cannot be {@code null}
@param dynamicNameElement the dynamic portion of the name. Cannot be {@code null}
@return the full capability name. Will not return {@code null} | [
"Constructs",
"a",
"full",
"capability",
"name",
"from",
"a",
"static",
"base",
"name",
"and",
"a",
"dynamic",
"element",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/capability/RuntimeCapability.java#L63-L72 |
gocd/gocd | common/src/main/java/com/thoughtworks/go/util/URLService.java | URLService.getPropertiesUrl | public String getPropertiesUrl(JobIdentifier jobIdentifier, String propertyName) {
"""
/*
Agent will use this method, the baseUrl will be injected from config xml in agent side.
This is used to fix security issues with the agent uploading artifacts when security is enabled.
"""
return format("%s/%s/%... | java | public String getPropertiesUrl(JobIdentifier jobIdentifier, String propertyName) {
return format("%s/%s/%s/%s",
baseRemotingURL, "remoting", "properties", jobIdentifier.propertyLocator(propertyName));
} | [
"public",
"String",
"getPropertiesUrl",
"(",
"JobIdentifier",
"jobIdentifier",
",",
"String",
"propertyName",
")",
"{",
"return",
"format",
"(",
"\"%s/%s/%s/%s\"",
",",
"baseRemotingURL",
",",
"\"remoting\"",
",",
"\"properties\"",
",",
"jobIdentifier",
".",
"property... | /*
Agent will use this method, the baseUrl will be injected from config xml in agent side.
This is used to fix security issues with the agent uploading artifacts when security is enabled. | [
"/",
"*",
"Agent",
"will",
"use",
"this",
"method",
"the",
"baseUrl",
"will",
"be",
"injected",
"from",
"config",
"xml",
"in",
"agent",
"side",
".",
"This",
"is",
"used",
"to",
"fix",
"security",
"issues",
"with",
"the",
"agent",
"uploading",
"artifacts",
... | train | https://github.com/gocd/gocd/blob/59a8480e23d6c06de39127635108dff57603cb71/common/src/main/java/com/thoughtworks/go/util/URLService.java#L90-L93 |
cdk/cdk | tool/hash/src/main/java/org/openscience/cdk/hash/stereo/GeometricDoubleBondEncoderFactory.java | GeometricDoubleBondEncoderFactory.newEncoder | static StereoEncoder newEncoder(IAtomContainer container, IAtom left, IAtom leftParent, IAtom right,
IAtom rightParent, int[][] graph) {
"""
Create a new encoder for the specified left and right atoms. The parent
is the atom which is connected by a double bond to the left and right
atom. For simple d... | java | static StereoEncoder newEncoder(IAtomContainer container, IAtom left, IAtom leftParent, IAtom right,
IAtom rightParent, int[][] graph) {
List<IBond> leftBonds = container.getConnectedBondsList(left);
List<IBond> rightBonds = container.getConnectedBondsList(right);
// check the left... | [
"static",
"StereoEncoder",
"newEncoder",
"(",
"IAtomContainer",
"container",
",",
"IAtom",
"left",
",",
"IAtom",
"leftParent",
",",
"IAtom",
"right",
",",
"IAtom",
"rightParent",
",",
"int",
"[",
"]",
"[",
"]",
"graph",
")",
"{",
"List",
"<",
"IBond",
">",... | Create a new encoder for the specified left and right atoms. The parent
is the atom which is connected by a double bond to the left and right
atom. For simple double bonds the parent of each is the other atom, in
cumulenes the parents are not the same.
@param container the molecule
@param left the left atom
@... | [
"Create",
"a",
"new",
"encoder",
"for",
"the",
"specified",
"left",
"and",
"right",
"atoms",
".",
"The",
"parent",
"is",
"the",
"atom",
"which",
"is",
"connected",
"by",
"a",
"double",
"bond",
"to",
"the",
"left",
"and",
"right",
"atom",
".",
"For",
"s... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/hash/src/main/java/org/openscience/cdk/hash/stereo/GeometricDoubleBondEncoderFactory.java#L108-L146 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/CertificatesImpl.java | CertificatesImpl.listNextWithServiceResponseAsync | public Observable<ServiceResponseWithHeaders<Page<Certificate>, CertificateListHeaders>> listNextWithServiceResponseAsync(final String nextPageLink, final CertificateListNextOptions certificateListNextOptions) {
"""
Lists all of the certificates that have been added to the specified account.
@param nextPageLink... | java | public Observable<ServiceResponseWithHeaders<Page<Certificate>, CertificateListHeaders>> listNextWithServiceResponseAsync(final String nextPageLink, final CertificateListNextOptions certificateListNextOptions) {
return listNextSinglePageAsync(nextPageLink, certificateListNextOptions)
.concatMap(new ... | [
"public",
"Observable",
"<",
"ServiceResponseWithHeaders",
"<",
"Page",
"<",
"Certificate",
">",
",",
"CertificateListHeaders",
">",
">",
"listNextWithServiceResponseAsync",
"(",
"final",
"String",
"nextPageLink",
",",
"final",
"CertificateListNextOptions",
"certificateList... | Lists all of the certificates that have been added to the specified account.
@param nextPageLink The NextLink from the previous successful call to List operation.
@param certificateListNextOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@return ... | [
"Lists",
"all",
"of",
"the",
"certificates",
"that",
"have",
"been",
"added",
"to",
"the",
"specified",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/CertificatesImpl.java#L1372-L1384 |
gallandarakhneorg/afc | core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java | XMLUtil.getElementFromPath | @Pure
public static Element getElementFromPath(Node document, boolean caseSensitive, String... path) {
"""
Replies the node that corresponds to the specified path.
<p>The path is an ordered list of tag's names and ended by the name of
the desired node.
@param document is the XML document to explore.
@para... | java | @Pure
public static Element getElementFromPath(Node document, boolean caseSensitive, String... path) {
assert document != null : AssertMessages.notNullParameter(0);
return getElementFromPath(document, caseSensitive, 0, path);
} | [
"@",
"Pure",
"public",
"static",
"Element",
"getElementFromPath",
"(",
"Node",
"document",
",",
"boolean",
"caseSensitive",
",",
"String",
"...",
"path",
")",
"{",
"assert",
"document",
"!=",
"null",
":",
"AssertMessages",
".",
"notNullParameter",
"(",
"0",
")... | Replies the node that corresponds to the specified path.
<p>The path is an ordered list of tag's names and ended by the name of
the desired node.
@param document is the XML document to explore.
@param caseSensitive indicates of the {@code path}'s components are case sensitive.
@param path is the list of names.
@retur... | [
"Replies",
"the",
"node",
"that",
"corresponds",
"to",
"the",
"specified",
"path",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java#L1386-L1390 |
arakelian/jackson-utils | src/main/java/com/arakelian/jackson/model/Coordinate.java | Coordinate.equals2D | public boolean equals2D(final Coordinate c, final double tolerance) {
"""
Tests if another coordinate has the same values for the X and Y ordinates. The Z ordinate is
ignored.
@param c
a <code>Coordinate</code> with which to do the 2D comparison.
@param tolerance
margin of error
@return true if <code>other... | java | public boolean equals2D(final Coordinate c, final double tolerance) {
if (!equalsWithTolerance(this.getX(), c.getX(), tolerance)) {
return false;
}
if (!equalsWithTolerance(this.getY(), c.getY(), tolerance)) {
return false;
}
return true;
} | [
"public",
"boolean",
"equals2D",
"(",
"final",
"Coordinate",
"c",
",",
"final",
"double",
"tolerance",
")",
"{",
"if",
"(",
"!",
"equalsWithTolerance",
"(",
"this",
".",
"getX",
"(",
")",
",",
"c",
".",
"getX",
"(",
")",
",",
"tolerance",
")",
")",
"... | Tests if another coordinate has the same values for the X and Y ordinates. The Z ordinate is
ignored.
@param c
a <code>Coordinate</code> with which to do the 2D comparison.
@param tolerance
margin of error
@return true if <code>other</code> is a <code>Coordinate</code> with the same values for X
and Y. | [
"Tests",
"if",
"another",
"coordinate",
"has",
"the",
"same",
"values",
"for",
"the",
"X",
"and",
"Y",
"ordinates",
".",
"The",
"Z",
"ordinate",
"is",
"ignored",
"."
] | train | https://github.com/arakelian/jackson-utils/blob/db0028fe15c55f9dd8272e327bf67f6004011711/src/main/java/com/arakelian/jackson/model/Coordinate.java#L271-L279 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/Password.java | Password.getPassword | public static Password getPassword(String realm,String dft, String promptDft) {
"""
Get a password.
A password is obtained by trying <UL>
<LI>Calling <Code>System.getProperty(realm,dft)</Code>
<LI>Prompting for a password
<LI>Using promptDft if nothing was entered.
</UL>
@param realm The realm name for the p... | java | public static Password getPassword(String realm,String dft, String promptDft)
{
String passwd=System.getProperty(realm,dft);
if (passwd==null || passwd.length()==0)
{
try
{
System.out.print(realm+
((promptDft!=null && p... | [
"public",
"static",
"Password",
"getPassword",
"(",
"String",
"realm",
",",
"String",
"dft",
",",
"String",
"promptDft",
")",
"{",
"String",
"passwd",
"=",
"System",
".",
"getProperty",
"(",
"realm",
",",
"dft",
")",
";",
"if",
"(",
"passwd",
"==",
"null... | Get a password.
A password is obtained by trying <UL>
<LI>Calling <Code>System.getProperty(realm,dft)</Code>
<LI>Prompting for a password
<LI>Using promptDft if nothing was entered.
</UL>
@param realm The realm name for the password, used as a SystemProperty name.
@param dft The default password.
@param promptDft The d... | [
"Get",
"a",
"password",
".",
"A",
"password",
"is",
"obtained",
"by",
"trying",
"<UL",
">",
"<LI",
">",
"Calling",
"<Code",
">",
"System",
".",
"getProperty",
"(",
"realm",
"dft",
")",
"<",
"/",
"Code",
">",
"<LI",
">",
"Prompting",
"for",
"a",
"pass... | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/Password.java#L187-L211 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/FacesImpl.java | FacesImpl.verifyFaceToFaceAsync | public Observable<VerifyResult> verifyFaceToFaceAsync(UUID faceId1, UUID faceId2) {
"""
Verify whether two faces belong to a same person or whether one face belongs to a person.
@param faceId1 FaceId of the first face, comes from Face - Detect
@param faceId2 FaceId of the second face, comes from Face - Detect
... | java | public Observable<VerifyResult> verifyFaceToFaceAsync(UUID faceId1, UUID faceId2) {
return verifyFaceToFaceWithServiceResponseAsync(faceId1, faceId2).map(new Func1<ServiceResponse<VerifyResult>, VerifyResult>() {
@Override
public VerifyResult call(ServiceResponse<VerifyResult> response) ... | [
"public",
"Observable",
"<",
"VerifyResult",
">",
"verifyFaceToFaceAsync",
"(",
"UUID",
"faceId1",
",",
"UUID",
"faceId2",
")",
"{",
"return",
"verifyFaceToFaceWithServiceResponseAsync",
"(",
"faceId1",
",",
"faceId2",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
... | Verify whether two faces belong to a same person or whether one face belongs to a person.
@param faceId1 FaceId of the first face, comes from Face - Detect
@param faceId2 FaceId of the second face, comes from Face - Detect
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable... | [
"Verify",
"whether",
"two",
"faces",
"belong",
"to",
"a",
"same",
"person",
"or",
"whether",
"one",
"face",
"belongs",
"to",
"a",
"person",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/FacesImpl.java#L594-L601 |
mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/utils/IOUtils.java | IOUtils.writeStream | public static boolean writeStream(String filePath, InputStream stream, boolean append) throws IOException {
"""
write file
@param filePath the file to be opened for writing.
@param stream the input stream
@param append if <code>true</code>, then bytes will be written to the end of the file rather than the... | java | public static boolean writeStream(String filePath, InputStream stream, boolean append) throws IOException {
return writeStream(filePath != null ? new File(filePath) : null, stream, append);
} | [
"public",
"static",
"boolean",
"writeStream",
"(",
"String",
"filePath",
",",
"InputStream",
"stream",
",",
"boolean",
"append",
")",
"throws",
"IOException",
"{",
"return",
"writeStream",
"(",
"filePath",
"!=",
"null",
"?",
"new",
"File",
"(",
"filePath",
")"... | write file
@param filePath the file to be opened for writing.
@param stream the input stream
@param append if <code>true</code>, then bytes will be written to the end of the file rather than the beginning
@return return true
@throws IOException if an error occurs while operator FileOutputStream | [
"write",
"file"
] | train | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/IOUtils.java#L1199-L1201 |
Microsoft/malmo | Minecraft/src/main/java/com/microsoft/Malmo/Utils/JSONWorldDataHelper.java | JSONWorldDataHelper.buildLifeStats | public static void buildLifeStats(JsonObject json, EntityPlayerMP player) {
"""
Builds the basic life world data to be used as observation signals by the listener.
@param json a JSON object into which the life stats will be added.
"""
json.addProperty("Life", player.getHealth());
json.addPrope... | java | public static void buildLifeStats(JsonObject json, EntityPlayerMP player)
{
json.addProperty("Life", player.getHealth());
json.addProperty("Score", player.getScore()); // Might always be the same as XP?
json.addProperty("Food", player.getFoodStats().getFoodLevel());
json.addProper... | [
"public",
"static",
"void",
"buildLifeStats",
"(",
"JsonObject",
"json",
",",
"EntityPlayerMP",
"player",
")",
"{",
"json",
".",
"addProperty",
"(",
"\"Life\"",
",",
"player",
".",
"getHealth",
"(",
")",
")",
";",
"json",
".",
"addProperty",
"(",
"\"Score\""... | Builds the basic life world data to be used as observation signals by the listener.
@param json a JSON object into which the life stats will be added. | [
"Builds",
"the",
"basic",
"life",
"world",
"data",
"to",
"be",
"used",
"as",
"observation",
"signals",
"by",
"the",
"listener",
"."
] | train | https://github.com/Microsoft/malmo/blob/4139cd6f3e52f6e893a931a1d4b70d35f8e70e5a/Minecraft/src/main/java/com/microsoft/Malmo/Utils/JSONWorldDataHelper.java#L124-L133 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/QueryTable.java | QueryTable.init | public void init(BaseDatabase database, Record record) {
"""
QueryTable Constructor.
@param database The database for this table.
@param record The queryRecord for this table.
"""
super.init(database, record);
if (((QueryRecord)record).getBaseRecord() != null)
m_tableNext = ((Quer... | java | public void init(BaseDatabase database, Record record)
{
super.init(database, record);
if (((QueryRecord)record).getBaseRecord() != null)
m_tableNext = ((QueryRecord)record).getBaseRecord().getTable(); // Pass most commands thru to the main record's table
} | [
"public",
"void",
"init",
"(",
"BaseDatabase",
"database",
",",
"Record",
"record",
")",
"{",
"super",
".",
"init",
"(",
"database",
",",
"record",
")",
";",
"if",
"(",
"(",
"(",
"QueryRecord",
")",
"record",
")",
".",
"getBaseRecord",
"(",
")",
"!=",
... | QueryTable Constructor.
@param database The database for this table.
@param record The queryRecord for this table. | [
"QueryTable",
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/QueryTable.java#L46-L51 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.unsubscribeAllDeletedResources | public void unsubscribeAllDeletedResources(CmsDbContext dbc, String poolName, long deletedTo) throws CmsException {
"""
Unsubscribes all deleted resources that were deleted before the specified time stamp.<p>
@param dbc the database context
@param poolName the name of the database pool to use
@param deletedTo... | java | public void unsubscribeAllDeletedResources(CmsDbContext dbc, String poolName, long deletedTo) throws CmsException {
getSubscriptionDriver().unsubscribeAllDeletedResources(dbc, poolName, deletedTo);
} | [
"public",
"void",
"unsubscribeAllDeletedResources",
"(",
"CmsDbContext",
"dbc",
",",
"String",
"poolName",
",",
"long",
"deletedTo",
")",
"throws",
"CmsException",
"{",
"getSubscriptionDriver",
"(",
")",
".",
"unsubscribeAllDeletedResources",
"(",
"dbc",
",",
"poolNam... | Unsubscribes all deleted resources that were deleted before the specified time stamp.<p>
@param dbc the database context
@param poolName the name of the database pool to use
@param deletedTo the time stamp to which the resources have been deleted
@throws CmsException if something goes wrong | [
"Unsubscribes",
"all",
"deleted",
"resources",
"that",
"were",
"deleted",
"before",
"the",
"specified",
"time",
"stamp",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L9248-L9251 |
JetBrains/xodus | environment/src/main/java/jetbrains/exodus/env/ReentrantTransactionDispatcher.java | ReentrantTransactionDispatcher.releaseTransaction | void releaseTransaction(@NotNull final Thread thread, final int permits) {
"""
Release transaction that was acquired in a thread with specified permits.
"""
try (CriticalSection ignored = criticalSection.enter()) {
int currentThreadPermits = getThreadPermits(thread);
if (permits... | java | void releaseTransaction(@NotNull final Thread thread, final int permits) {
try (CriticalSection ignored = criticalSection.enter()) {
int currentThreadPermits = getThreadPermits(thread);
if (permits > currentThreadPermits) {
throw new ExodusException("Can't release more pe... | [
"void",
"releaseTransaction",
"(",
"@",
"NotNull",
"final",
"Thread",
"thread",
",",
"final",
"int",
"permits",
")",
"{",
"try",
"(",
"CriticalSection",
"ignored",
"=",
"criticalSection",
".",
"enter",
"(",
")",
")",
"{",
"int",
"currentThreadPermits",
"=",
... | Release transaction that was acquired in a thread with specified permits. | [
"Release",
"transaction",
"that",
"was",
"acquired",
"in",
"a",
"thread",
"with",
"specified",
"permits",
"."
] | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/environment/src/main/java/jetbrains/exodus/env/ReentrantTransactionDispatcher.java#L121-L136 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/asn1/x509/NameConstraints.java | NameConstraints.toASN1Object | public DERObject toASN1Object() {
"""
/*
NameConstraints ::= SEQUENCE {
permittedSubtrees [0] GeneralSubtrees OPTIONAL,
excludedSubtrees [1] GeneralSubtrees OPTIONAL }
"""
ASN1EncodableVector v = new ASN1EncodableVector();
if (permitted != null)
{
... | java | public DERObject toASN1Object()
{
ASN1EncodableVector v = new ASN1EncodableVector();
if (permitted != null)
{
v.add(new DERTaggedObject(false, 0, permitted));
}
if (excluded != null)
{
v.add(new DERTaggedObject(false, 1, excluded));
... | [
"public",
"DERObject",
"toASN1Object",
"(",
")",
"{",
"ASN1EncodableVector",
"v",
"=",
"new",
"ASN1EncodableVector",
"(",
")",
";",
"if",
"(",
"permitted",
"!=",
"null",
")",
"{",
"v",
".",
"add",
"(",
"new",
"DERTaggedObject",
"(",
"false",
",",
"0",
",... | /*
NameConstraints ::= SEQUENCE {
permittedSubtrees [0] GeneralSubtrees OPTIONAL,
excludedSubtrees [1] GeneralSubtrees OPTIONAL } | [
"/",
"*",
"NameConstraints",
"::",
"=",
"SEQUENCE",
"{",
"permittedSubtrees",
"[",
"0",
"]",
"GeneralSubtrees",
"OPTIONAL",
"excludedSubtrees",
"[",
"1",
"]",
"GeneralSubtrees",
"OPTIONAL",
"}"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/asn1/x509/NameConstraints.java#L66-L81 |
aalmiray/Json-lib | src/main/java/net/sf/json/util/JSONUtils.java | JSONUtils.newDynaBean | public static DynaBean newDynaBean( JSONObject jsonObject, JsonConfig jsonConfig ) {
"""
Creates a new MorphDynaBean from a JSONObject. The MorphDynaBean will have
all the properties of the original JSONObject with the most accurate type.
Values of properties are not copied.
"""
Map props = getProperti... | java | public static DynaBean newDynaBean( JSONObject jsonObject, JsonConfig jsonConfig ) {
Map props = getProperties( jsonObject );
for( Iterator entries = props.entrySet()
.iterator(); entries.hasNext(); ){
Map.Entry entry = (Map.Entry) entries.next();
String key = (String) entry.ge... | [
"public",
"static",
"DynaBean",
"newDynaBean",
"(",
"JSONObject",
"jsonObject",
",",
"JsonConfig",
"jsonConfig",
")",
"{",
"Map",
"props",
"=",
"getProperties",
"(",
"jsonObject",
")",
";",
"for",
"(",
"Iterator",
"entries",
"=",
"props",
".",
"entrySet",
"(",... | Creates a new MorphDynaBean from a JSONObject. The MorphDynaBean will have
all the properties of the original JSONObject with the most accurate type.
Values of properties are not copied. | [
"Creates",
"a",
"new",
"MorphDynaBean",
"from",
"a",
"JSONObject",
".",
"The",
"MorphDynaBean",
"will",
"have",
"all",
"the",
"properties",
"of",
"the",
"original",
"JSONObject",
"with",
"the",
"most",
"accurate",
"type",
".",
"Values",
"of",
"properties",
"ar... | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/util/JSONUtils.java#L408-L430 |
threerings/nenya | core/src/main/java/com/threerings/resource/FileResourceBundle.java | FileResourceBundle.getResourceFile | public File getResourceFile (String path)
throws IOException {
"""
Returns a file from which the specified resource can be loaded. This method will unpack the
resource into a temporary directory and return a reference to that file.
@param path the path to the resource in this jar file.
@return a fil... | java | public File getResourceFile (String path)
throws IOException
{
if (resolveJarFile()) {
return null;
}
// if we have been unpacked, return our unpacked file
if (_cache != null) {
File cfile = new File(_cache, path);
if (cfile.exists()) {
... | [
"public",
"File",
"getResourceFile",
"(",
"String",
"path",
")",
"throws",
"IOException",
"{",
"if",
"(",
"resolveJarFile",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"// if we have been unpacked, return our unpacked file",
"if",
"(",
"_cache",
"!=",
"null",
... | Returns a file from which the specified resource can be loaded. This method will unpack the
resource into a temporary directory and return a reference to that file.
@param path the path to the resource in this jar file.
@return a file from which the resource can be loaded or null if no such resource exists. | [
"Returns",
"a",
"file",
"from",
"which",
"the",
"specified",
"resource",
"can",
"be",
"loaded",
".",
"This",
"method",
"will",
"unpack",
"the",
"resource",
"into",
"a",
"temporary",
"directory",
"and",
"return",
"a",
"reference",
"to",
"that",
"file",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/FileResourceBundle.java#L215-L253 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/OrderUrl.java | OrderUrl.deleteOrderDraftUrl | public static MozuUrl deleteOrderDraftUrl(String orderId, String version) {
"""
Get Resource Url for DeleteOrderDraft
@param orderId Unique identifier of the order.
@param version Determines whether or not to check versioning of items for concurrency purposes.
@return String Resource Url
"""
UrlFormatt... | java | public static MozuUrl deleteOrderDraftUrl(String orderId, String version)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/draft?version={version}");
formatter.formatUrl("orderId", orderId);
formatter.formatUrl("version", version);
return new MozuUrl(formatter.getResourceUrl(), ... | [
"public",
"static",
"MozuUrl",
"deleteOrderDraftUrl",
"(",
"String",
"orderId",
",",
"String",
"version",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/orders/{orderId}/draft?version={version}\"",
")",
";",
"formatter",
".",
"f... | Get Resource Url for DeleteOrderDraft
@param orderId Unique identifier of the order.
@param version Determines whether or not to check versioning of items for concurrency purposes.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"DeleteOrderDraft"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/OrderUrl.java#L180-L186 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindContentProviderBuilder.java | BindContentProviderBuilder.defineJavadocForContentUri | private void defineJavadocForContentUri(MethodSpec.Builder builder, SQLiteModelMethod method) {
"""
Define javadoc for content uri.
@param builder
the builder
@param method
the method
"""
String contentUri = method.contentProviderUri().replace("*", "[*]");
classBuilder.addJavadoc("<tr><td><pre>$L</p... | java | private void defineJavadocForContentUri(MethodSpec.Builder builder, SQLiteModelMethod method) {
String contentUri = method.contentProviderUri().replace("*", "[*]");
classBuilder.addJavadoc("<tr><td><pre>$L</pre></td><td>{@link $LImpl#$L}</td></tr>\n", contentUri, method.getParent().getName(), method.contentProvide... | [
"private",
"void",
"defineJavadocForContentUri",
"(",
"MethodSpec",
".",
"Builder",
"builder",
",",
"SQLiteModelMethod",
"method",
")",
"{",
"String",
"contentUri",
"=",
"method",
".",
"contentProviderUri",
"(",
")",
".",
"replace",
"(",
"\"*\"",
",",
"\"[*]\"",
... | Define javadoc for content uri.
@param builder
the builder
@param method
the method | [
"Define",
"javadoc",
"for",
"content",
"uri",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindContentProviderBuilder.java#L489-L495 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/SwingBinderSelectionStrategy.java | SwingBinderSelectionStrategy.getIdBoundBinder | public Binder getIdBoundBinder(String id) {
"""
Try to find a binder with a specified id. If no binder is found, try
to locate it into the application context, check whether it's a binder and
add it to the id bound binder map.
@param id Id of the binder
@return Binder or <code>null</code> if not found.
"... | java | public Binder getIdBoundBinder(String id)
{
Binder binder = idBoundBinders.get(id);
if (binder == null) // try to locate the binder bean
{
Object binderBean = getApplicationContext().getBean(id);
if (binderBean instanceof Binder)
{
if (bin... | [
"public",
"Binder",
"getIdBoundBinder",
"(",
"String",
"id",
")",
"{",
"Binder",
"binder",
"=",
"idBoundBinders",
".",
"get",
"(",
"id",
")",
";",
"if",
"(",
"binder",
"==",
"null",
")",
"// try to locate the binder bean",
"{",
"Object",
"binderBean",
"=",
... | Try to find a binder with a specified id. If no binder is found, try
to locate it into the application context, check whether it's a binder and
add it to the id bound binder map.
@param id Id of the binder
@return Binder or <code>null</code> if not found. | [
"Try",
"to",
"find",
"a",
"binder",
"with",
"a",
"specified",
"id",
".",
"If",
"no",
"binder",
"is",
"found",
"try",
"to",
"locate",
"it",
"into",
"the",
"application",
"context",
"check",
"whether",
"it",
"s",
"a",
"binder",
"and",
"add",
"it",
"to",
... | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/SwingBinderSelectionStrategy.java#L69-L89 |
calimero-project/calimero-core | src/tuwien/auto/calimero/link/medium/RawFrameFactory.java | RawFrameFactory.createTP1 | public static RawFrame createTP1(final byte[] data, final int offset) throws KNXFormatException {
"""
Creates a raw frame out of a byte array for the TP1 communication medium.
@param data byte array containing the TP1 raw frame structure
@param offset start offset of frame structure in <code>data</code>, 0 <... | java | public static RawFrame createTP1(final byte[] data, final int offset) throws KNXFormatException
{
final int ctrl = data[offset] & 0xff;
// parse control field and check if valid
if ((ctrl & 0x10) == 0x10) {
if ((ctrl & 0x40) == 0x00)
return new TP1LData(data, offset);
else if (ctrl == 0xF0)
return ... | [
"public",
"static",
"RawFrame",
"createTP1",
"(",
"final",
"byte",
"[",
"]",
"data",
",",
"final",
"int",
"offset",
")",
"throws",
"KNXFormatException",
"{",
"final",
"int",
"ctrl",
"=",
"data",
"[",
"offset",
"]",
"&",
"0xff",
";",
"// parse control field a... | Creates a raw frame out of a byte array for the TP1 communication medium.
@param data byte array containing the TP1 raw frame structure
@param offset start offset of frame structure in <code>data</code>, 0 <=
offset < <code>data.length</code>
@return the created TP1 raw frame
@throws KNXFormatException on no val... | [
"Creates",
"a",
"raw",
"frame",
"out",
"of",
"a",
"byte",
"array",
"for",
"the",
"TP1",
"communication",
"medium",
"."
] | train | https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/link/medium/RawFrameFactory.java#L91-L103 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/logging/MyfacesLogger.java | MyfacesLogger.exiting | public void exiting(String sourceClass, String sourceMethod, Object result) {
"""
Log a method return, with result object.
<p>
This is a convenience method that can be used to log returning
from a method. A LogRecord with message "RETURN {0}", log level
FINER, and the gives sourceMethod, sourceClass, and resu... | java | public void exiting(String sourceClass, String sourceMethod, Object result)
{
_log.exiting(sourceClass, sourceMethod, result);
} | [
"public",
"void",
"exiting",
"(",
"String",
"sourceClass",
",",
"String",
"sourceMethod",
",",
"Object",
"result",
")",
"{",
"_log",
".",
"exiting",
"(",
"sourceClass",
",",
"sourceMethod",
",",
"result",
")",
";",
"}"
] | Log a method return, with result object.
<p>
This is a convenience method that can be used to log returning
from a method. A LogRecord with message "RETURN {0}", log level
FINER, and the gives sourceMethod, sourceClass, and result
object is logged.
<p>
@param sourceClass name of class that issued the logging requ... | [
"Log",
"a",
"method",
"return",
"with",
"result",
"object",
".",
"<p",
">",
"This",
"is",
"a",
"convenience",
"method",
"that",
"can",
"be",
"used",
"to",
"log",
"returning",
"from",
"a",
"method",
".",
"A",
"LogRecord",
"with",
"message",
"RETURN",
"{",... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/logging/MyfacesLogger.java#L774-L777 |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java | HttpBuilder.traceAsync | public <T> CompletableFuture<T> traceAsync(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) {
"""
Executes an asynchronous TRACE request on the configured URI (asynchronous alias to the `trace(Class,Closure)` method), with additional
configuration provided by the configuration closure. T... | java | public <T> CompletableFuture<T> traceAsync(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) {
return CompletableFuture.supplyAsync(() -> trace(type, closure), getExecutor());
} | [
"public",
"<",
"T",
">",
"CompletableFuture",
"<",
"T",
">",
"traceAsync",
"(",
"final",
"Class",
"<",
"T",
">",
"type",
",",
"@",
"DelegatesTo",
"(",
"HttpConfig",
".",
"class",
")",
"final",
"Closure",
"closure",
")",
"{",
"return",
"CompletableFuture",
... | Executes an asynchronous TRACE request on the configured URI (asynchronous alias to the `trace(Class,Closure)` method), with additional
configuration provided by the configuration closure. The result will be cast to the specified `type`.
[source,groovy]
----
def http = HttpBuilder.configure {
request.uri = 'http://loc... | [
"Executes",
"an",
"asynchronous",
"TRACE",
"request",
"on",
"the",
"configured",
"URI",
"(",
"asynchronous",
"alias",
"to",
"the",
"trace",
"(",
"Class",
"Closure",
")",
"method",
")",
"with",
"additional",
"configuration",
"provided",
"by",
"the",
"configuratio... | train | https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L2192-L2194 |
Azure/azure-sdk-for-java | signalr/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/signalr/v2018_03_01_preview/implementation/SignalRsInner.java | SignalRsInner.listKeysAsync | public Observable<SignalRKeysInner> listKeysAsync(String resourceGroupName, String resourceName) {
"""
Get the access keys of the SignalR resource.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@p... | java | public Observable<SignalRKeysInner> listKeysAsync(String resourceGroupName, String resourceName) {
return listKeysWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<SignalRKeysInner>, SignalRKeysInner>() {
@Override
public SignalRKeysInner call(Servic... | [
"public",
"Observable",
"<",
"SignalRKeysInner",
">",
"listKeysAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
")",
"{",
"return",
"listKeysWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
")",
".",
"map",
"(",
"new"... | Get the access keys of the SignalR resource.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param resourceName The name of the SignalR resource.
@throws IllegalArgumentException thrown if parameters fail ... | [
"Get",
"the",
"access",
"keys",
"of",
"the",
"SignalR",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/signalr/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/signalr/v2018_03_01_preview/implementation/SignalRsInner.java#L538-L545 |
virgo47/javasimon | console-embed/src/main/java/org/javasimon/console/SimonConsoleRequestProcessor.java | SimonConsoleRequestProcessor.create | public static SimonConsoleRequestProcessor create(String urlPrefix, Manager manager, String pluginClasses) {
"""
Instanciate the request processor (factory method)
@param urlPrefix Url prefix (null allowed)
@param manager Manager (null allowed)
@param pluginClasses Plugin classes (null allowed)
"""
Simon... | java | public static SimonConsoleRequestProcessor create(String urlPrefix, Manager manager, String pluginClasses) {
SimonConsoleRequestProcessor requestProcessor = new SimonConsoleRequestProcessor(urlPrefix);
if (manager != null) {
// Defaults to global manager
requestProcessor.setManager(manager);
}
if (p... | [
"public",
"static",
"SimonConsoleRequestProcessor",
"create",
"(",
"String",
"urlPrefix",
",",
"Manager",
"manager",
",",
"String",
"pluginClasses",
")",
"{",
"SimonConsoleRequestProcessor",
"requestProcessor",
"=",
"new",
"SimonConsoleRequestProcessor",
"(",
"urlPrefix",
... | Instanciate the request processor (factory method)
@param urlPrefix Url prefix (null allowed)
@param manager Manager (null allowed)
@param pluginClasses Plugin classes (null allowed) | [
"Instanciate",
"the",
"request",
"processor",
"(",
"factory",
"method",
")"
] | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/console-embed/src/main/java/org/javasimon/console/SimonConsoleRequestProcessor.java#L270-L281 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/InternalInputStreamManager.java | InternalInputStreamManager.getStreamSet | private StreamSet getStreamSet(SIBUuid12 streamID, boolean create) {
"""
Get a StreamSet for a given streamID. Optionally create the StreamSet
if it doesn't already exit.
@param streamID The streamID to map to a StreamSet.
@param create If TRUE then create the StreamSet if it doesn't already exit.
@return A... | java | private StreamSet getStreamSet(SIBUuid12 streamID, boolean create)
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "getStreamSet", new Object[]{streamID, new Boolean(create)});
StreamSet streamSet = null;
synchronized (streamSets)
{
streamSet = (StreamSet) streamSets.get(streamID);
... | [
"private",
"StreamSet",
"getStreamSet",
"(",
"SIBUuid12",
"streamID",
",",
"boolean",
"create",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getStreamSet\"",
",",
"new",
"Object",
"[",
"]",
"{... | Get a StreamSet for a given streamID. Optionally create the StreamSet
if it doesn't already exit.
@param streamID The streamID to map to a StreamSet.
@param create If TRUE then create the StreamSet if it doesn't already exit.
@return An instance of StreamSet | [
"Get",
"a",
"StreamSet",
"for",
"a",
"given",
"streamID",
".",
"Optionally",
"create",
"the",
"StreamSet",
"if",
"it",
"doesn",
"t",
"already",
"exit",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/InternalInputStreamManager.java#L277-L296 |
contentful/contentful-management.java | src/main/java/com/contentful/java/cma/gson/EntrySerializer.java | EntrySerializer.serialize | @Override
public JsonElement serialize(CMAEntry src, Type type, JsonSerializationContext context) {
"""
Make sure all fields are mapped in the locale - value way.
@param src the source to be edited.
@param type the type to be used.
@param context the json context to be changed.
@return a created jso... | java | @Override
public JsonElement serialize(CMAEntry src, Type type, JsonSerializationContext context) {
JsonObject fields = new JsonObject();
for (Map.Entry<String, LinkedHashMap<String, Object>> field : src.getFields().entrySet()) {
LinkedHashMap<String, Object> value = field.getValue();
if (value ==... | [
"@",
"Override",
"public",
"JsonElement",
"serialize",
"(",
"CMAEntry",
"src",
",",
"Type",
"type",
",",
"JsonSerializationContext",
"context",
")",
"{",
"JsonObject",
"fields",
"=",
"new",
"JsonObject",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
... | Make sure all fields are mapped in the locale - value way.
@param src the source to be edited.
@param type the type to be used.
@param context the json context to be changed.
@return a created json element. | [
"Make",
"sure",
"all",
"fields",
"are",
"mapped",
"in",
"the",
"locale",
"-",
"value",
"way",
"."
] | train | https://github.com/contentful/contentful-management.java/blob/ca310fb9ea9577fcff0ca57949ab7c2315fa2534/src/main/java/com/contentful/java/cma/gson/EntrySerializer.java#L44-L67 |
ksclarke/freelib-utils | src/main/java/info/freelibrary/util/FileExtFileFilter.java | FileExtFileFilter.accept | @Override
public boolean accept(final File aDir, final String aFileName) {
"""
Returns true if the supplied file name and parent directory are a match for this <code>FilenameFilter</code>.
@param aDir A parent directory for the supplied file name
@param aFileName The file name we want to check against our ... | java | @Override
public boolean accept(final File aDir, final String aFileName) {
for (final String extension : myExtensions) {
if (new File(aDir, aFileName).isFile() && aFileName.endsWith(extension)) {
return true;
}
}
return false;
} | [
"@",
"Override",
"public",
"boolean",
"accept",
"(",
"final",
"File",
"aDir",
",",
"final",
"String",
"aFileName",
")",
"{",
"for",
"(",
"final",
"String",
"extension",
":",
"myExtensions",
")",
"{",
"if",
"(",
"new",
"File",
"(",
"aDir",
",",
"aFileName... | Returns true if the supplied file name and parent directory are a match for this <code>FilenameFilter</code>.
@param aDir A parent directory for the supplied file name
@param aFileName The file name we want to check against our filter
@return True if the filter matches the supplied parent and file name; else, false | [
"Returns",
"true",
"if",
"the",
"supplied",
"file",
"name",
"and",
"parent",
"directory",
"are",
"a",
"match",
"for",
"this",
"<code",
">",
"FilenameFilter<",
"/",
"code",
">",
"."
] | train | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/FileExtFileFilter.java#L60-L69 |
javagl/ND | nd-distance/src/main/java/de/javagl/nd/distance/tuples/j/LongTupleDistanceFunctions.java | LongTupleDistanceFunctions.computeEuclideanSquared | static double computeEuclideanSquared(LongTuple t0, LongTuple t1) {
"""
Computes the squared Euclidean distance between the given tuples
@param t0 The first tuple
@param t1 The second tuple
@return The distance
@throws IllegalArgumentException If the given tuples do not
have the same {@link Tuple#getSize() ... | java | static double computeEuclideanSquared(LongTuple t0, LongTuple t1)
{
Utils.checkForEqualSize(t0, t1);
long sum = 0;
for (int i=0; i<t0.getSize(); i++)
{
long d = t0.get(i)-t1.get(i);
sum += d*d;
}
return sum;
} | [
"static",
"double",
"computeEuclideanSquared",
"(",
"LongTuple",
"t0",
",",
"LongTuple",
"t1",
")",
"{",
"Utils",
".",
"checkForEqualSize",
"(",
"t0",
",",
"t1",
")",
";",
"long",
"sum",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",... | Computes the squared Euclidean distance between the given tuples
@param t0 The first tuple
@param t1 The second tuple
@return The distance
@throws IllegalArgumentException If the given tuples do not
have the same {@link Tuple#getSize() size} | [
"Computes",
"the",
"squared",
"Euclidean",
"distance",
"between",
"the",
"given",
"tuples"
] | train | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-distance/src/main/java/de/javagl/nd/distance/tuples/j/LongTupleDistanceFunctions.java#L197-L207 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/odmg/locking/LockManagerDefaultImpl.java | LockManagerDefaultImpl.checkWrite | public synchronized boolean checkWrite(TransactionImpl tx, Object obj) {
"""
checks if there is a writelock for transaction tx on object obj.
Returns true if so, else false.
"""
if (log.isDebugEnabled()) log.debug("LM.checkWrite(tx-" + tx.getGUID() + ", " + new Identity(obj, tx.getBroker()).toString(... | java | public synchronized boolean checkWrite(TransactionImpl tx, Object obj)
{
if (log.isDebugEnabled()) log.debug("LM.checkWrite(tx-" + tx.getGUID() + ", " + new Identity(obj, tx.getBroker()).toString() + ")");
LockStrategy lockStrategy = LockStrategyFactory.getStrategyFor(obj);
return lockSt... | [
"public",
"synchronized",
"boolean",
"checkWrite",
"(",
"TransactionImpl",
"tx",
",",
"Object",
"obj",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"log",
".",
"debug",
"(",
"\"LM.checkWrite(tx-\"",
"+",
"tx",
".",
"getGUID",
"(",
")",... | checks if there is a writelock for transaction tx on object obj.
Returns true if so, else false. | [
"checks",
"if",
"there",
"is",
"a",
"writelock",
"for",
"transaction",
"tx",
"on",
"object",
"obj",
".",
"Returns",
"true",
"if",
"so",
"else",
"false",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/locking/LockManagerDefaultImpl.java#L142-L147 |
infinispan/infinispan | lucene/directory-provider/src/main/java/org/infinispan/hibernate/search/util/configuration/impl/ConfigurationParseHelper.java | ConfigurationParseHelper.parseInt | public static int parseInt(String value, String errorMsgOnParseFailure) {
"""
Parses a string into an integer value.
@param value a string containing an int value to parse
@param errorMsgOnParseFailure message being wrapped in a SearchException if value is {@code null} or not an
integer
@ret... | java | public static int parseInt(String value, String errorMsgOnParseFailure) {
if (value == null) {
throw new SearchException(errorMsgOnParseFailure);
} else {
try {
return Integer.parseInt(value.trim());
} catch (NumberFormatException nfe) {
throw log.getInvali... | [
"public",
"static",
"int",
"parseInt",
"(",
"String",
"value",
",",
"String",
"errorMsgOnParseFailure",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw",
"new",
"SearchException",
"(",
"errorMsgOnParseFailure",
")",
";",
"}",
"else",
"{",
"try",... | Parses a string into an integer value.
@param value a string containing an int value to parse
@param errorMsgOnParseFailure message being wrapped in a SearchException if value is {@code null} or not an
integer
@return the parsed integer value
@throws SearchException both for null values and for String... | [
"Parses",
"a",
"string",
"into",
"an",
"integer",
"value",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/lucene/directory-provider/src/main/java/org/infinispan/hibernate/search/util/configuration/impl/ConfigurationParseHelper.java#L73-L83 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/util/ClassLoaderUtil.java | ClassLoaderUtil.validateClassLoadable | public static boolean validateClassLoadable(ClassNotFoundException cnfe, ClassLoader cl) {
"""
Checks, whether the class that was not found in the given exception, can be resolved through
the given class loader.
@param cnfe The ClassNotFoundException that defines the name of the class.
@param cl The class loa... | java | public static boolean validateClassLoadable(ClassNotFoundException cnfe, ClassLoader cl) {
try {
String className = cnfe.getMessage();
Class.forName(className, false, cl);
return true;
}
catch (ClassNotFoundException e) {
return false;
}
catch (Exception e) {
return false;
}
} | [
"public",
"static",
"boolean",
"validateClassLoadable",
"(",
"ClassNotFoundException",
"cnfe",
",",
"ClassLoader",
"cl",
")",
"{",
"try",
"{",
"String",
"className",
"=",
"cnfe",
".",
"getMessage",
"(",
")",
";",
"Class",
".",
"forName",
"(",
"className",
",",... | Checks, whether the class that was not found in the given exception, can be resolved through
the given class loader.
@param cnfe The ClassNotFoundException that defines the name of the class.
@param cl The class loader to use for the class resolution.
@return True, if the class can be resolved with the given class loa... | [
"Checks",
"whether",
"the",
"class",
"that",
"was",
"not",
"found",
"in",
"the",
"given",
"exception",
"can",
"be",
"resolved",
"through",
"the",
"given",
"class",
"loader",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/ClassLoaderUtil.java#L119-L131 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/MurmurHashUtil.java | MurmurHashUtil.hashBytes | public static int hashBytes(MemorySegment segment, int offset, int lengthInBytes) {
"""
Hash bytes in MemorySegment.
@param segment segment.
@param offset offset for MemorySegment
@param lengthInBytes length in MemorySegment
@return hash code
"""
return hashBytes(segment, offset, lengthInBytes, DEFAULT_S... | java | public static int hashBytes(MemorySegment segment, int offset, int lengthInBytes) {
return hashBytes(segment, offset, lengthInBytes, DEFAULT_SEED);
} | [
"public",
"static",
"int",
"hashBytes",
"(",
"MemorySegment",
"segment",
",",
"int",
"offset",
",",
"int",
"lengthInBytes",
")",
"{",
"return",
"hashBytes",
"(",
"segment",
",",
"offset",
",",
"lengthInBytes",
",",
"DEFAULT_SEED",
")",
";",
"}"
] | Hash bytes in MemorySegment.
@param segment segment.
@param offset offset for MemorySegment
@param lengthInBytes length in MemorySegment
@return hash code | [
"Hash",
"bytes",
"in",
"MemorySegment",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/MurmurHashUtil.java#L73-L75 |
apereo/cas | support/cas-server-support-openid/src/main/java/org/apereo/cas/support/openid/authentication/principal/OpenIdServiceResponseBuilder.java | OpenIdServiceResponseBuilder.buildAuthenticationResponse | protected Response buildAuthenticationResponse(final OpenIdService service,
final Map<String, String> parameters,
final boolean successFullAuthentication,
final String... | java | protected Response buildAuthenticationResponse(final OpenIdService service,
final Map<String, String> parameters,
final boolean successFullAuthentication,
final String... | [
"protected",
"Response",
"buildAuthenticationResponse",
"(",
"final",
"OpenIdService",
"service",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
",",
"final",
"boolean",
"successFullAuthentication",
",",
"final",
"String",
"id",
",",
"final",
... | We sign directly (final 'true') because we don't add extensions
response message can be either a DirectError or an AuthSuccess here.
Note:
The association handle returned in the Response is either the 'public'
created in a previous association, or is a 'private' handle created
specifically for the verification step whe... | [
"We",
"sign",
"directly",
"(",
"final",
"true",
")",
"because",
"we",
"don",
"t",
"add",
"extensions",
"response",
"message",
"can",
"be",
"either",
"a",
"DirectError",
"or",
"an",
"AuthSuccess",
"here",
".",
"Note",
":",
"The",
"association",
"handle",
"r... | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-openid/src/main/java/org/apereo/cas/support/openid/authentication/principal/OpenIdServiceResponseBuilder.java#L130-L139 |
ontop/ontop | core/model/src/main/java/it/unibz/inf/ontop/dbschema/ForeignKeyConstraint.java | ForeignKeyConstraint.of | public static ForeignKeyConstraint of(String name, Attribute attribute, Attribute reference) {
"""
creates a single-attribute foreign key
@param name
@param attribute
@param reference
@return
"""
return new Builder((DatabaseRelationDefinition)attribute.getRelation(),
(DatabaseRelationDefinition... | java | public static ForeignKeyConstraint of(String name, Attribute attribute, Attribute reference) {
return new Builder((DatabaseRelationDefinition)attribute.getRelation(),
(DatabaseRelationDefinition)reference.getRelation())
.add(attribute, reference).build(name);
} | [
"public",
"static",
"ForeignKeyConstraint",
"of",
"(",
"String",
"name",
",",
"Attribute",
"attribute",
",",
"Attribute",
"reference",
")",
"{",
"return",
"new",
"Builder",
"(",
"(",
"DatabaseRelationDefinition",
")",
"attribute",
".",
"getRelation",
"(",
")",
"... | creates a single-attribute foreign key
@param name
@param attribute
@param reference
@return | [
"creates",
"a",
"single",
"-",
"attribute",
"foreign",
"key"
] | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/model/src/main/java/it/unibz/inf/ontop/dbschema/ForeignKeyConstraint.java#L141-L145 |
jcuda/jcusparse | JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java | JCusparse.cusparseScsc2hyb | public static int cusparseScsc2hyb(
cusparseHandle handle,
int m,
int n,
cusparseMatDescr descrA,
Pointer cscSortedValA,
Pointer cscSortedRowIndA,
Pointer cscSortedColPtrA,
cusparseHybMat hybA,
int userEllWidth,
int parti... | java | public static int cusparseScsc2hyb(
cusparseHandle handle,
int m,
int n,
cusparseMatDescr descrA,
Pointer cscSortedValA,
Pointer cscSortedRowIndA,
Pointer cscSortedColPtrA,
cusparseHybMat hybA,
int userEllWidth,
int parti... | [
"public",
"static",
"int",
"cusparseScsc2hyb",
"(",
"cusparseHandle",
"handle",
",",
"int",
"m",
",",
"int",
"n",
",",
"cusparseMatDescr",
"descrA",
",",
"Pointer",
"cscSortedValA",
",",
"Pointer",
"cscSortedRowIndA",
",",
"Pointer",
"cscSortedColPtrA",
",",
"cusp... | Description: This routine converts a sparse matrix in CSC storage format
to a sparse matrix in HYB storage format. | [
"Description",
":",
"This",
"routine",
"converts",
"a",
"sparse",
"matrix",
"in",
"CSC",
"storage",
"format",
"to",
"a",
"sparse",
"matrix",
"in",
"HYB",
"storage",
"format",
"."
] | train | https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L12175-L12188 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.