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 |
|---|---|---|---|---|---|---|---|---|---|---|
line/armeria | core/src/main/java/com/linecorp/armeria/client/AbstractClientOptionsBuilder.java | AbstractClientOptionsBuilder.rpcDecorator | public <I extends RpcRequest, O extends RpcResponse>
B rpcDecorator(DecoratingClientFunction<I, O> decorator) {
"""
Adds the specified RPC-level {@code decorator}.
@param decorator the {@link DecoratingClientFunction} that intercepts an invocation
@param <I> the {@link Request} type of the {@link Client} b... | java | public <I extends RpcRequest, O extends RpcResponse>
B rpcDecorator(DecoratingClientFunction<I, O> decorator) {
decoration.addRpc(decorator);
return self();
} | [
"public",
"<",
"I",
"extends",
"RpcRequest",
",",
"O",
"extends",
"RpcResponse",
">",
"B",
"rpcDecorator",
"(",
"DecoratingClientFunction",
"<",
"I",
",",
"O",
">",
"decorator",
")",
"{",
"decoration",
".",
"addRpc",
"(",
"decorator",
")",
";",
"return",
"... | Adds the specified RPC-level {@code decorator}.
@param decorator the {@link DecoratingClientFunction} that intercepts an invocation
@param <I> the {@link Request} type of the {@link Client} being decorated
@param <O> the {@link Response} type of the {@link Client} being decorated | [
"Adds",
"the",
"specified",
"RPC",
"-",
"level",
"{",
"@code",
"decorator",
"}",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/client/AbstractClientOptionsBuilder.java#L324-L328 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java | BugInstance.addClassAndMethod | @Nonnull
public BugInstance addClassAndMethod(JavaClass javaClass, Method method) {
"""
Add class and method annotations for given class and method.
@param javaClass
the class
@param method
the method
@return this object
"""
addClass(javaClass.getClassName());
addMethod(javaClass, me... | java | @Nonnull
public BugInstance addClassAndMethod(JavaClass javaClass, Method method) {
addClass(javaClass.getClassName());
addMethod(javaClass, method);
if (!MemberUtils.isUserGenerated(method)) {
foundInAutogeneratedMethod();
}
return this;
} | [
"@",
"Nonnull",
"public",
"BugInstance",
"addClassAndMethod",
"(",
"JavaClass",
"javaClass",
",",
"Method",
"method",
")",
"{",
"addClass",
"(",
"javaClass",
".",
"getClassName",
"(",
")",
")",
";",
"addMethod",
"(",
"javaClass",
",",
"method",
")",
";",
"if... | Add class and method annotations for given class and method.
@param javaClass
the class
@param method
the method
@return this object | [
"Add",
"class",
"and",
"method",
"annotations",
"for",
"given",
"class",
"and",
"method",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L903-L912 |
jparsec/jparsec | jparsec/src/main/java/org/jparsec/pattern/Patterns.java | Patterns.some | @Deprecated
public static Pattern some(int min, int max, CharPredicate predicate) {
"""
Returns a {@link Pattern} that matches at least {@code min} and up to {@code max} number of characters satisfying
{@code predicate},
@deprecated Use {@link #times(int, int, CharPredicate)} instead.
"""
return times(... | java | @Deprecated
public static Pattern some(int min, int max, CharPredicate predicate) {
return times(min, max, predicate);
} | [
"@",
"Deprecated",
"public",
"static",
"Pattern",
"some",
"(",
"int",
"min",
",",
"int",
"max",
",",
"CharPredicate",
"predicate",
")",
"{",
"return",
"times",
"(",
"min",
",",
"max",
",",
"predicate",
")",
";",
"}"
] | Returns a {@link Pattern} that matches at least {@code min} and up to {@code max} number of characters satisfying
{@code predicate},
@deprecated Use {@link #times(int, int, CharPredicate)} instead. | [
"Returns",
"a",
"{"
] | train | https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/pattern/Patterns.java#L400-L403 |
apache/groovy | subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java | Sql.executePreparedQuery | protected final ResultSet executePreparedQuery(String sql, List<Object> params)
throws SQLException {
"""
Useful helper method which handles resource management when executing a
prepared query which returns a result set.
Derived classes of Sql can override "createPreparedQueryCommand" and then
call ... | java | protected final ResultSet executePreparedQuery(String sql, List<Object> params)
throws SQLException {
AbstractQueryCommand command = createPreparedQueryCommand(sql, params);
ResultSet rs = null;
try {
rs = command.execute();
} finally {
command.closeRe... | [
"protected",
"final",
"ResultSet",
"executePreparedQuery",
"(",
"String",
"sql",
",",
"List",
"<",
"Object",
">",
"params",
")",
"throws",
"SQLException",
"{",
"AbstractQueryCommand",
"command",
"=",
"createPreparedQueryCommand",
"(",
"sql",
",",
"params",
")",
";... | Useful helper method which handles resource management when executing a
prepared query which returns a result set.
Derived classes of Sql can override "createPreparedQueryCommand" and then
call this method to access the ResultSet returned from the provided query.
@param sql query to execute
@param params parameters... | [
"Useful",
"helper",
"method",
"which",
"handles",
"resource",
"management",
"when",
"executing",
"a",
"prepared",
"query",
"which",
"returns",
"a",
"result",
"set",
".",
"Derived",
"classes",
"of",
"Sql",
"can",
"override",
"createPreparedQueryCommand",
"and",
"th... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java#L3932-L3942 |
apiman/apiman | manager/api/core/src/main/java/io/apiman/manager/api/core/metrics/AbstractMetricsAccessor.java | AbstractMetricsAccessor.generateHistogramSkeleton | public static <T extends HistogramDataPoint> Map<String, T> generateHistogramSkeleton(HistogramBean<T> rval, DateTime from, DateTime to,
HistogramIntervalType interval, Class<T> dataType) {
"""
Shortcut for the label (string) based histogram index.
@param rval
@param from
@param to
@param interval
... | java | public static <T extends HistogramDataPoint> Map<String, T> generateHistogramSkeleton(HistogramBean<T> rval, DateTime from, DateTime to,
HistogramIntervalType interval, Class<T> dataType) {
return generateHistogramSkeleton(rval, from, to, interval, dataType, String.class);
} | [
"public",
"static",
"<",
"T",
"extends",
"HistogramDataPoint",
">",
"Map",
"<",
"String",
",",
"T",
">",
"generateHistogramSkeleton",
"(",
"HistogramBean",
"<",
"T",
">",
"rval",
",",
"DateTime",
"from",
",",
"DateTime",
"to",
",",
"HistogramIntervalType",
"in... | Shortcut for the label (string) based histogram index.
@param rval
@param from
@param to
@param interval
@param dataType | [
"Shortcut",
"for",
"the",
"label",
"(",
"string",
")",
"based",
"histogram",
"index",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/core/src/main/java/io/apiman/manager/api/core/metrics/AbstractMetricsAccessor.java#L106-L109 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/BootstrapTools.java | BootstrapTools.writeConfiguration | public static void writeConfiguration(Configuration cfg, File file) throws IOException {
"""
Writes a Flink YAML config file from a Flink Configuration object.
@param cfg The Flink config
@param file The File to write to
@throws IOException
"""
try (FileWriter fwrt = new FileWriter(file);
PrintWriter o... | java | public static void writeConfiguration(Configuration cfg, File file) throws IOException {
try (FileWriter fwrt = new FileWriter(file);
PrintWriter out = new PrintWriter(fwrt)) {
for (String key : cfg.keySet()) {
String value = cfg.getString(key, null);
out.print(key);
out.print(": ");
out.println... | [
"public",
"static",
"void",
"writeConfiguration",
"(",
"Configuration",
"cfg",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"try",
"(",
"FileWriter",
"fwrt",
"=",
"new",
"FileWriter",
"(",
"file",
")",
";",
"PrintWriter",
"out",
"=",
"new",
"Print... | Writes a Flink YAML config file from a Flink Configuration object.
@param cfg The Flink config
@param file The File to write to
@throws IOException | [
"Writes",
"a",
"Flink",
"YAML",
"config",
"file",
"from",
"a",
"Flink",
"Configuration",
"object",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/BootstrapTools.java#L311-L321 |
lets-blade/blade | src/main/java/com/blade/kit/IocKit.java | IocKit.getInjectFields | private static List<FieldInjector> getInjectFields(Ioc ioc, ClassDefine classDefine) {
"""
Get @Inject Annotated field
@param ioc ioc container
@param classDefine classDefine
@return return FieldInjector
"""
List<FieldInjector> injectors = new ArrayList<>();
for (Field field : clas... | java | private static List<FieldInjector> getInjectFields(Ioc ioc, ClassDefine classDefine) {
List<FieldInjector> injectors = new ArrayList<>();
for (Field field : classDefine.getDeclaredFields()) {
if (null != field.getAnnotation(InjectWith.class) || null != field.getAnnotation(Inject.class)) {
... | [
"private",
"static",
"List",
"<",
"FieldInjector",
">",
"getInjectFields",
"(",
"Ioc",
"ioc",
",",
"ClassDefine",
"classDefine",
")",
"{",
"List",
"<",
"FieldInjector",
">",
"injectors",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"Field",
"f... | Get @Inject Annotated field
@param ioc ioc container
@param classDefine classDefine
@return return FieldInjector | [
"Get",
"@Inject",
"Annotated",
"field"
] | train | https://github.com/lets-blade/blade/blob/60624ee528be12122c49a9ad1713e336b959e59a/src/main/java/com/blade/kit/IocKit.java#L51-L62 |
pippo-java/pippo | pippo-core/src/main/java/ro/pippo/core/util/MimeTypes.java | MimeTypes.getContentType | public String getContentType(String filename, String defaultContentType) {
"""
Returns the content-type from a file name.<br/>
For a text-based content-type, also return the encoding suffix eg.
<em>"text/plain; charset=utf-8"</em>
@param filename the file name
@param defaultContentType the default ... | java | public String getContentType(String filename, String defaultContentType) {
String contentType = getMimeType(filename, null);
if (contentType == null) {
contentType = defaultContentType;
}
if (contentType != null && contentType.startsWith("text/")) {
// UTF-8 is fi... | [
"public",
"String",
"getContentType",
"(",
"String",
"filename",
",",
"String",
"defaultContentType",
")",
"{",
"String",
"contentType",
"=",
"getMimeType",
"(",
"filename",
",",
"null",
")",
";",
"if",
"(",
"contentType",
"==",
"null",
")",
"{",
"contentType"... | Returns the content-type from a file name.<br/>
For a text-based content-type, also return the encoding suffix eg.
<em>"text/plain; charset=utf-8"</em>
@param filename the file name
@param defaultContentType the default content-type to return when no matching
content-type is found
@return the content-type de... | [
"Returns",
"the",
"content",
"-",
"type",
"from",
"a",
"file",
"name",
".",
"<br",
"/",
">",
"For",
"a",
"text",
"-",
"based",
"content",
"-",
"type",
"also",
"return",
"the",
"encoding",
"suffix",
"eg",
".",
"<em",
">",
"text",
"/",
"plain",
";",
... | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/util/MimeTypes.java#L109-L120 |
vlingo/vlingo-actors | src/main/java/io/vlingo/actors/World.java | World.startRootFor | private void startRootFor(final Stage stage, final Logger logger) {
"""
Starts the {@code PrivateRootActor}. When the {@code PrivateRootActor} starts it will in turn
start the {@code PublicRootActor}.
@param stage the {@code Stage} in which to start the {@code PrivateRootActor}
@param logger the default {@code ... | java | private void startRootFor(final Stage stage, final Logger logger) {
stage.actorProtocolFor(
Stoppable.class,
Definition.has(PrivateRootActor.class, Definition.NoParameters, PRIVATE_ROOT_NAME),
null,
addressFactory.from(PRIVATE_ROOT_ID, PRIVATE_ROOT_NAME),
null,
null,
... | [
"private",
"void",
"startRootFor",
"(",
"final",
"Stage",
"stage",
",",
"final",
"Logger",
"logger",
")",
"{",
"stage",
".",
"actorProtocolFor",
"(",
"Stoppable",
".",
"class",
",",
"Definition",
".",
"has",
"(",
"PrivateRootActor",
".",
"class",
",",
"Defin... | Starts the {@code PrivateRootActor}. When the {@code PrivateRootActor} starts it will in turn
start the {@code PublicRootActor}.
@param stage the {@code Stage} in which to start the {@code PrivateRootActor}
@param logger the default {@code Logger} for this {@code World} and {@code Stage} | [
"Starts",
"the",
"{"
] | train | https://github.com/vlingo/vlingo-actors/blob/c7d046fd139c0490cf0fd2588d7dc2f792f13493/src/main/java/io/vlingo/actors/World.java#L606-L615 |
amplexus/java-flac-encoder | src/main/java/net/sourceforge/javaflacencoder/Subframe_Fixed.java | Subframe_Fixed.getData | public EncodedElement getData(EncodedElement dataEle) {
"""
Get the data from the last encode attempt. Data is returned in an
EncodedElement, properly packed at the bit-level to be added directly to
a FLAC stream.
@return EncodedElement containing encoded subframe
"""
//EncodedElement dataEle = new En... | java | public EncodedElement getData(EncodedElement dataEle) {
//EncodedElement dataEle = new EncodedElement(_totalBits/8+1,_offset);
int startSize = dataEle.getTotalBits();
int unencSampleSize = _frameSampleSize;
//write headers
int encodedType = 1<<3 | _order;
dataEle.addInt(0, 1);
dataEle.addInt... | [
"public",
"EncodedElement",
"getData",
"(",
"EncodedElement",
"dataEle",
")",
"{",
"//EncodedElement dataEle = new EncodedElement(_totalBits/8+1,_offset);",
"int",
"startSize",
"=",
"dataEle",
".",
"getTotalBits",
"(",
")",
";",
"int",
"unencSampleSize",
"=",
"_frameSampleS... | Get the data from the last encode attempt. Data is returned in an
EncodedElement, properly packed at the bit-level to be added directly to
a FLAC stream.
@return EncodedElement containing encoded subframe | [
"Get",
"the",
"data",
"from",
"the",
"last",
"encode",
"attempt",
".",
"Data",
"is",
"returned",
"in",
"an",
"EncodedElement",
"properly",
"packed",
"at",
"the",
"bit",
"-",
"level",
"to",
"be",
"added",
"directly",
"to",
"a",
"FLAC",
"stream",
"."
] | train | https://github.com/amplexus/java-flac-encoder/blob/3d536b877dee2a3fd4ab2e0d9569e292cae93bc9/src/main/java/net/sourceforge/javaflacencoder/Subframe_Fixed.java#L250-L279 |
glyptodon/guacamole-client | guacamole/src/main/java/org/apache/guacamole/extension/LanguageResourceService.java | LanguageResourceService.mergeTranslations | private JsonNode mergeTranslations(JsonNode original, JsonNode overlay) {
"""
Merges the given JSON objects. Any leaf node in overlay will overwrite
the corresponding path in original.
@param original
The original JSON object to which changes should be applied.
@param overlay
The JSON object containing ch... | java | private JsonNode mergeTranslations(JsonNode original, JsonNode overlay) {
// If we are at a leaf node, the result of merging is simply the overlay
if (!overlay.isObject() || original == null)
return overlay;
// Create mutable copy of original
ObjectNode newNode = JsonNodeFa... | [
"private",
"JsonNode",
"mergeTranslations",
"(",
"JsonNode",
"original",
",",
"JsonNode",
"overlay",
")",
"{",
"// If we are at a leaf node, the result of merging is simply the overlay",
"if",
"(",
"!",
"overlay",
".",
"isObject",
"(",
")",
"||",
"original",
"==",
"null... | Merges the given JSON objects. Any leaf node in overlay will overwrite
the corresponding path in original.
@param original
The original JSON object to which changes should be applied.
@param overlay
The JSON object containing changes that should be applied.
@return
The newly constructed JSON object that is the resul... | [
"Merges",
"the",
"given",
"JSON",
"objects",
".",
"Any",
"leaf",
"node",
"in",
"overlay",
"will",
"overwrite",
"the",
"corresponding",
"path",
"in",
"original",
"."
] | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/guacamole/src/main/java/org/apache/guacamole/extension/LanguageResourceService.java#L173-L196 |
logic-ng/LogicNG | src/main/java/org/logicng/cardinalityconstraints/CCALKCardinalityNetwork.java | CCALKCardinalityNetwork.buildForIncremental | void buildForIncremental(final EncodingResult result, final Variable[] vars, int rhs) {
"""
Builds the constraint for incremental usage.
@param result the result
@param vars the variables
@param rhs the right-hand side
"""
cardinalityNetwork.buildALKForIncremental(result, vars, rhs);
} | java | void buildForIncremental(final EncodingResult result, final Variable[] vars, int rhs) {
cardinalityNetwork.buildALKForIncremental(result, vars, rhs);
} | [
"void",
"buildForIncremental",
"(",
"final",
"EncodingResult",
"result",
",",
"final",
"Variable",
"[",
"]",
"vars",
",",
"int",
"rhs",
")",
"{",
"cardinalityNetwork",
".",
"buildALKForIncremental",
"(",
"result",
",",
"vars",
",",
"rhs",
")",
";",
"}"
] | Builds the constraint for incremental usage.
@param result the result
@param vars the variables
@param rhs the right-hand side | [
"Builds",
"the",
"constraint",
"for",
"incremental",
"usage",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/cardinalityconstraints/CCALKCardinalityNetwork.java#L67-L69 |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/VisualizeImageData.java | VisualizeImageData.colorizeSign | public static void colorizeSign( GrayF32 input , float maxAbsValue , Bitmap output , byte[] storage ) {
"""
Renders positive and negative values as two different colors.
@param input (Input) Image with positive and negative values.
@param maxAbsValue The largest absolute value of any pixel in the image. Set ... | java | public static void colorizeSign( GrayF32 input , float maxAbsValue , Bitmap output , byte[] storage ) {
shapeShape(input, output);
if( storage == null )
storage = declareStorage(output,null);
if( maxAbsValue < 0 )
maxAbsValue = ImageStatistics.maxAbs(input);
int indexDst = 0;
for( int y = 0; y < inp... | [
"public",
"static",
"void",
"colorizeSign",
"(",
"GrayF32",
"input",
",",
"float",
"maxAbsValue",
",",
"Bitmap",
"output",
",",
"byte",
"[",
"]",
"storage",
")",
"{",
"shapeShape",
"(",
"input",
",",
"output",
")",
";",
"if",
"(",
"storage",
"==",
"null"... | Renders positive and negative values as two different colors.
@param input (Input) Image with positive and negative values.
@param maxAbsValue The largest absolute value of any pixel in the image. Set to < 0 if not known.
@param output (Output) Bitmap ARGB_8888 image.
@param storage Optional working buffer for Bitma... | [
"Renders",
"positive",
"and",
"negative",
"values",
"as",
"two",
"different",
"colors",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/VisualizeImageData.java#L137-L166 |
orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java | JDBCUtilities.tableExists | public static boolean tableExists(Connection connection, String tableName) throws SQLException {
"""
Return true if the table exists.
@param connection Connection
@param tableName Table name
@return true if the table exists
@throws java.sql.SQLException
"""
try (Statement statement = connection.... | java | public static boolean tableExists(Connection connection, String tableName) throws SQLException {
try (Statement statement = connection.createStatement()) {
statement.execute("SELECT * FROM " + TableLocation.parse(tableName) + " LIMIT 0;");
return true;
} catch (SQLException ex) {... | [
"public",
"static",
"boolean",
"tableExists",
"(",
"Connection",
"connection",
",",
"String",
"tableName",
")",
"throws",
"SQLException",
"{",
"try",
"(",
"Statement",
"statement",
"=",
"connection",
".",
"createStatement",
"(",
")",
")",
"{",
"statement",
".",
... | Return true if the table exists.
@param connection Connection
@param tableName Table name
@return true if the table exists
@throws java.sql.SQLException | [
"Return",
"true",
"if",
"the",
"table",
"exists",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java#L319-L326 |
gallandarakhneorg/afc | core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java | XMLUtil.writeXML | public static void writeXML(Document xmldocument, Writer writer) throws IOException {
"""
Write the given node tree into a XML file.
@param xmldocument is the object that contains the node tree
@param writer is the target stream
@throws IOException if the stream cannot be read.
"""
assert xmldocument !=... | java | public static void writeXML(Document xmldocument, Writer writer) throws IOException {
assert xmldocument != null : AssertMessages.notNullParameter(0);
assert writer != null : AssertMessages.notNullParameter(1);
writeNode(xmldocument, writer);
} | [
"public",
"static",
"void",
"writeXML",
"(",
"Document",
"xmldocument",
",",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"assert",
"xmldocument",
"!=",
"null",
":",
"AssertMessages",
".",
"notNullParameter",
"(",
"0",
")",
";",
"assert",
"writer",
"... | Write the given node tree into a XML file.
@param xmldocument is the object that contains the node tree
@param writer is the target stream
@throws IOException if the stream cannot be read. | [
"Write",
"the",
"given",
"node",
"tree",
"into",
"a",
"XML",
"file",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java#L2390-L2394 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/HashUtils.java | HashUtils.getSHA256String | public static String getSHA256String(String str) {
"""
Calculate SHA-256 hash of a String
@param str - the String to hash
@return the SHA-256 hash value
"""
MessageDigest messageDigest = getMessageDigest(SHA256);
return getHashString(str, messageDigest);
} | java | public static String getSHA256String(String str) {
MessageDigest messageDigest = getMessageDigest(SHA256);
return getHashString(str, messageDigest);
} | [
"public",
"static",
"String",
"getSHA256String",
"(",
"String",
"str",
")",
"{",
"MessageDigest",
"messageDigest",
"=",
"getMessageDigest",
"(",
"SHA256",
")",
";",
"return",
"getHashString",
"(",
"str",
",",
"messageDigest",
")",
";",
"}"
] | Calculate SHA-256 hash of a String
@param str - the String to hash
@return the SHA-256 hash value | [
"Calculate",
"SHA",
"-",
"256",
"hash",
"of",
"a",
"String"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/HashUtils.java#L58-L61 |
jayantk/jklol | src/com/jayantkrish/jklol/models/DiscreteFactor.java | DiscreteFactor.describeAssignments | public String describeAssignments(List<Assignment> assignments, boolean includeZeros) {
"""
Gets a string description of {@code assignments} and their weights in
{@code this}.
@param assignments
@param includeZeros if {@code false}, zero weight assignments are omitted.
@return
"""
StringBuilder sb = ... | java | public String describeAssignments(List<Assignment> assignments, boolean includeZeros) {
StringBuilder sb = new StringBuilder();
for (Assignment assignment : assignments) {
double unnormalizedProb = getUnnormalizedProbability(assignment);
if (unnormalizedProb != 0.0 || includeZeros) {
Outcome... | [
"public",
"String",
"describeAssignments",
"(",
"List",
"<",
"Assignment",
">",
"assignments",
",",
"boolean",
"includeZeros",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Assignment",
"assignment",
":",
"assignments"... | Gets a string description of {@code assignments} and their weights in
{@code this}.
@param assignments
@param includeZeros if {@code false}, zero weight assignments are omitted.
@return | [
"Gets",
"a",
"string",
"description",
"of",
"{",
"@code",
"assignments",
"}",
"and",
"their",
"weights",
"in",
"{",
"@code",
"this",
"}",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/models/DiscreteFactor.java#L384-L395 |
census-instrumentation/opencensus-java | exporters/trace/jaeger/src/main/java/io/opencensus/exporter/trace/jaeger/JaegerTraceExporter.java | JaegerTraceExporter.createAndRegister | public static void createAndRegister(final String thriftEndpoint, final String serviceName) {
"""
Creates and registers the Jaeger Trace exporter to the OpenCensus library. Only one Jaeger
exporter can be registered at any point.
@param thriftEndpoint the Thrift endpoint of your Jaeger instance, e.g.:
"http:/... | java | public static void createAndRegister(final String thriftEndpoint, final String serviceName) {
synchronized (monitor) {
checkState(handler == null, "Jaeger exporter is already registered.");
final SpanExporter.Handler newHandler = newHandler(thriftEndpoint, serviceName);
JaegerTraceExporter.handler... | [
"public",
"static",
"void",
"createAndRegister",
"(",
"final",
"String",
"thriftEndpoint",
",",
"final",
"String",
"serviceName",
")",
"{",
"synchronized",
"(",
"monitor",
")",
"{",
"checkState",
"(",
"handler",
"==",
"null",
",",
"\"Jaeger exporter is already regis... | Creates and registers the Jaeger Trace exporter to the OpenCensus library. Only one Jaeger
exporter can be registered at any point.
@param thriftEndpoint the Thrift endpoint of your Jaeger instance, e.g.:
"http://127.0.0.1:14268/api/traces"
@param serviceName the local service name of the process.
@throws IllegalState... | [
"Creates",
"and",
"registers",
"the",
"Jaeger",
"Trace",
"exporter",
"to",
"the",
"OpenCensus",
"library",
".",
"Only",
"one",
"Jaeger",
"exporter",
"can",
"be",
"registered",
"at",
"any",
"point",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/exporters/trace/jaeger/src/main/java/io/opencensus/exporter/trace/jaeger/JaegerTraceExporter.java#L63-L70 |
paymill/paymill-java | src/main/java/com/paymill/services/RefundService.java | RefundService.refundTransaction | public Refund refundTransaction( Transaction transaction, Integer amount ) {
"""
This function refunds a {@link Transaction} that has been created previously and was refunded in parts or wasn't refunded at
all. The inserted amount will be refunded to the credit card / direct debit of the original {@link Transacti... | java | public Refund refundTransaction( Transaction transaction, Integer amount ) {
return this.refundTransaction( transaction, amount, null );
} | [
"public",
"Refund",
"refundTransaction",
"(",
"Transaction",
"transaction",
",",
"Integer",
"amount",
")",
"{",
"return",
"this",
".",
"refundTransaction",
"(",
"transaction",
",",
"amount",
",",
"null",
")",
";",
"}"
] | This function refunds a {@link Transaction} that has been created previously and was refunded in parts or wasn't refunded at
all. The inserted amount will be refunded to the credit card / direct debit of the original {@link Transaction}. There will
be some fees for the merchant for every refund.
<p>
Note:
<ul>
<li>You ... | [
"This",
"function",
"refunds",
"a",
"{"
] | train | https://github.com/paymill/paymill-java/blob/17281a0d4376c76f1711af9f09bfc138c90ba65a/src/main/java/com/paymill/services/RefundService.java#L113-L115 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java | Resolve.resolveDiamond | Symbol resolveDiamond(DiagnosticPosition pos,
Env<AttrContext> env,
Type site,
List<Type> argtypes,
List<Type> typeargtypes) {
"""
Resolve constructor using diamond inference.
@param pos T... | java | Symbol resolveDiamond(DiagnosticPosition pos,
Env<AttrContext> env,
Type site,
List<Type> argtypes,
List<Type> typeargtypes) {
return lookupMethod(env, pos, site.tsym, resolveMethodCheck,
... | [
"Symbol",
"resolveDiamond",
"(",
"DiagnosticPosition",
"pos",
",",
"Env",
"<",
"AttrContext",
">",
"env",
",",
"Type",
"site",
",",
"List",
"<",
"Type",
">",
"argtypes",
",",
"List",
"<",
"Type",
">",
"typeargtypes",
")",
"{",
"return",
"lookupMethod",
"("... | Resolve constructor using diamond inference.
@param pos The position to use for error reporting.
@param env The environment current at the constructor invocation.
@param site The type of class for which a constructor is searched.
The scope of this class has been touched in attribution.
@param argtypes ... | [
"Resolve",
"constructor",
"using",
"diamond",
"inference",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java#L2783-L2813 |
Azure/azure-sdk-for-java | edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java | DevicesInner.beginCreateOrUpdateSecuritySettings | public void beginCreateOrUpdateSecuritySettings(String deviceName, String resourceGroupName, AsymmetricEncryptedSecret deviceAdminPassword) {
"""
Updates the security settings on a data box edge/gateway device.
@param deviceName The device name.
@param resourceGroupName The resource group name.
@param deviceA... | java | public void beginCreateOrUpdateSecuritySettings(String deviceName, String resourceGroupName, AsymmetricEncryptedSecret deviceAdminPassword) {
beginCreateOrUpdateSecuritySettingsWithServiceResponseAsync(deviceName, resourceGroupName, deviceAdminPassword).toBlocking().single().body();
} | [
"public",
"void",
"beginCreateOrUpdateSecuritySettings",
"(",
"String",
"deviceName",
",",
"String",
"resourceGroupName",
",",
"AsymmetricEncryptedSecret",
"deviceAdminPassword",
")",
"{",
"beginCreateOrUpdateSecuritySettingsWithServiceResponseAsync",
"(",
"deviceName",
",",
"res... | Updates the security settings on a data box edge/gateway device.
@param deviceName The device name.
@param resourceGroupName The resource group name.
@param deviceAdminPassword Device administrator password as an encrypted string (encrypted using RSA PKCS #1) is used to sign into the local web UI of the device. The A... | [
"Updates",
"the",
"security",
"settings",
"on",
"a",
"data",
"box",
"edge",
"/",
"gateway",
"device",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java#L1915-L1917 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/FrameDataflowAnalysis.java | FrameDataflowAnalysis.getFactAtPC | public FrameType getFactAtPC(CFG cfg, int pc) throws DataflowAnalysisException {
"""
Get the dataflow fact representing the point just before given Location.
Note "before" is meant in the logical sense, so for backward analyses,
before means after the location in the control flow sense.
@return the fact at th... | java | public FrameType getFactAtPC(CFG cfg, int pc) throws DataflowAnalysisException {
FrameType result = createFact();
makeFactTop(result);
for (Location l : cfg.locations()) {
if (l.getHandle().getPosition() == pc) {
FrameType fact = getFactAtLocation(l);
... | [
"public",
"FrameType",
"getFactAtPC",
"(",
"CFG",
"cfg",
",",
"int",
"pc",
")",
"throws",
"DataflowAnalysisException",
"{",
"FrameType",
"result",
"=",
"createFact",
"(",
")",
";",
"makeFactTop",
"(",
"result",
")",
";",
"for",
"(",
"Location",
"l",
":",
"... | Get the dataflow fact representing the point just before given Location.
Note "before" is meant in the logical sense, so for backward analyses,
before means after the location in the control flow sense.
@return the fact at the point just before the location | [
"Get",
"the",
"dataflow",
"fact",
"representing",
"the",
"point",
"just",
"before",
"given",
"Location",
".",
"Note",
"before",
"is",
"meant",
"in",
"the",
"logical",
"sense",
"so",
"for",
"backward",
"analyses",
"before",
"means",
"after",
"the",
"location",
... | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/FrameDataflowAnalysis.java#L68-L81 |
jenkinsci/jenkins | core/src/main/java/hudson/model/User.java | User.getOrCreateByIdOrFullName | public static @Nonnull User getOrCreateByIdOrFullName(@Nonnull String idOrFullName) {
"""
Get the user by ID or Full Name.
<p>
If the user does not exist, creates a new one on-demand.
<p>
Use {@link #getById} when you know you have an ID.
In this method Jenkins will try to resolve the {@link User} by full n... | java | public static @Nonnull User getOrCreateByIdOrFullName(@Nonnull String idOrFullName) {
return get(idOrFullName, true, Collections.emptyMap());
} | [
"public",
"static",
"@",
"Nonnull",
"User",
"getOrCreateByIdOrFullName",
"(",
"@",
"Nonnull",
"String",
"idOrFullName",
")",
"{",
"return",
"get",
"(",
"idOrFullName",
",",
"true",
",",
"Collections",
".",
"emptyMap",
"(",
")",
")",
";",
"}"
] | Get the user by ID or Full Name.
<p>
If the user does not exist, creates a new one on-demand.
<p>
Use {@link #getById} when you know you have an ID.
In this method Jenkins will try to resolve the {@link User} by full name with help of various
{@link hudson.tasks.UserNameResolver}.
This is slow (see JENKINS-23281).
@p... | [
"Get",
"the",
"user",
"by",
"ID",
"or",
"Full",
"Name",
".",
"<p",
">",
"If",
"the",
"user",
"does",
"not",
"exist",
"creates",
"a",
"new",
"one",
"on",
"-",
"demand",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/User.java#L569-L571 |
icode/ameba | src/main/java/ameba/db/ebean/filter/CommonExprTransformer.java | CommonExprTransformer.textCommonTerms | public static Expression textCommonTerms(String operator, Val<Expression>[] args, EbeanExprInvoker invoker) {
"""
<p>textCommonTerms.</p>
@param operator a {@link java.lang.String} object.
@param args an array of {@link ameba.db.dsl.QueryExprMeta.Val} objects.
@param invoker a {@link ameba.db.ebean.filter.Ebe... | java | public static Expression textCommonTerms(String operator, Val<Expression>[] args, EbeanExprInvoker invoker) {
checkTextOptions(operator, args);
Map<String, Val<Expression>> ops = ((TextOptionsExpression) args[1].expr()).options;
TextCommonTerms common = new TextCommonTerms();
for (String... | [
"public",
"static",
"Expression",
"textCommonTerms",
"(",
"String",
"operator",
",",
"Val",
"<",
"Expression",
">",
"[",
"]",
"args",
",",
"EbeanExprInvoker",
"invoker",
")",
"{",
"checkTextOptions",
"(",
"operator",
",",
"args",
")",
";",
"Map",
"<",
"Strin... | <p>textCommonTerms.</p>
@param operator a {@link java.lang.String} object.
@param args an array of {@link ameba.db.dsl.QueryExprMeta.Val} objects.
@param invoker a {@link ameba.db.ebean.filter.EbeanExprInvoker} object.
@return a {@link io.ebean.Expression} object. | [
"<p",
">",
"textCommonTerms",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/ebean/filter/CommonExprTransformer.java#L458-L485 |
zaproxy/zaproxy | src/org/parosproxy/paros/extension/history/ExtensionHistory.java | ExtensionHistory.showAlertAddDialog | @Deprecated
public void showAlertAddDialog(HttpMessage httpMessage, int historyType) {
"""
Sets the {@code HttpMessage} and the history type of the
{@code HistoryReference} that will be created if the user creates the
alert. The current session will be used to create the
{@code HistoryReference}. The alert... | java | @Deprecated
public void showAlertAddDialog(HttpMessage httpMessage, int historyType) {
ExtensionAlert extAlert = Control.getSingleton().getExtensionLoader().getExtension(ExtensionAlert.class);
if (extAlert == null) {
return;
}
extAlert.showAlertAddDialog(httpMessage... | [
"@",
"Deprecated",
"public",
"void",
"showAlertAddDialog",
"(",
"HttpMessage",
"httpMessage",
",",
"int",
"historyType",
")",
"{",
"ExtensionAlert",
"extAlert",
"=",
"Control",
".",
"getSingleton",
"(",
")",
".",
"getExtensionLoader",
"(",
")",
".",
"getExtension"... | Sets the {@code HttpMessage} and the history type of the
{@code HistoryReference} that will be created if the user creates the
alert. The current session will be used to create the
{@code HistoryReference}. The alert created will be added to the newly
created {@code HistoryReference}.
<p>
Should be used when the alert ... | [
"Sets",
"the",
"{",
"@code",
"HttpMessage",
"}",
"and",
"the",
"history",
"type",
"of",
"the",
"{",
"@code",
"HistoryReference",
"}",
"that",
"will",
"be",
"created",
"if",
"the",
"user",
"creates",
"the",
"alert",
".",
"The",
"current",
"session",
"will",... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/extension/history/ExtensionHistory.java#L677-L684 |
alexvasilkov/AndroidCommons | library/src/main/java/com/alexvasilkov/android/commons/texts/Fonts.java | Fonts.apply | public static void apply(@NonNull TextView textView, @StringRes int fontStringId) {
"""
Applies font to provided TextView.<br/>
Note: this class will only accept fonts under <code>fonts/</code> directory
and fonts starting with <code>font:</code> prefix.
"""
apply(textView, textView.getContext().getS... | java | public static void apply(@NonNull TextView textView, @StringRes int fontStringId) {
apply(textView, textView.getContext().getString(fontStringId));
} | [
"public",
"static",
"void",
"apply",
"(",
"@",
"NonNull",
"TextView",
"textView",
",",
"@",
"StringRes",
"int",
"fontStringId",
")",
"{",
"apply",
"(",
"textView",
",",
"textView",
".",
"getContext",
"(",
")",
".",
"getString",
"(",
"fontStringId",
")",
")... | Applies font to provided TextView.<br/>
Note: this class will only accept fonts under <code>fonts/</code> directory
and fonts starting with <code>font:</code> prefix. | [
"Applies",
"font",
"to",
"provided",
"TextView",
".",
"<br",
"/",
">",
"Note",
":",
"this",
"class",
"will",
"only",
"accept",
"fonts",
"under",
"<code",
">",
"fonts",
"/",
"<",
"/",
"code",
">",
"directory",
"and",
"fonts",
"starting",
"with",
"<code",
... | train | https://github.com/alexvasilkov/AndroidCommons/blob/aca9f6d5acfc6bd3694984b7f89956e1a0146ddb/library/src/main/java/com/alexvasilkov/android/commons/texts/Fonts.java#L93-L95 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.java | BigtableInstanceAdminClient.getCluster | @SuppressWarnings("WeakerAccess")
public Cluster getCluster(String instanceId, String clusterId) {
"""
Get the cluster representation by ID.
<p>Sample code:
<pre>{@code
Cluster cluster = client.getCluster("my-instance", "my-cluster");
}</pre>
"""
return ApiExceptions.callAndTranslateApiException(... | java | @SuppressWarnings("WeakerAccess")
public Cluster getCluster(String instanceId, String clusterId) {
return ApiExceptions.callAndTranslateApiException(getClusterAsync(instanceId, clusterId));
} | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"Cluster",
"getCluster",
"(",
"String",
"instanceId",
",",
"String",
"clusterId",
")",
"{",
"return",
"ApiExceptions",
".",
"callAndTranslateApiException",
"(",
"getClusterAsync",
"(",
"instanceId",
",",... | Get the cluster representation by ID.
<p>Sample code:
<pre>{@code
Cluster cluster = client.getCluster("my-instance", "my-cluster");
}</pre> | [
"Get",
"the",
"cluster",
"representation",
"by",
"ID",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.java#L572-L575 |
datasalt/pangool | core/src/main/java/com/datasalt/pangool/tuplemr/TupleMRBuilder.java | TupleMRBuilder.addTupleInput | public void addTupleInput(Path path, Schema targetSchema, TupleMapper<ITuple, NullWritable> tupleMapper) {
"""
Adds an input file associated with a TupleFile.
<p>
A specific "Target Schema" is specified, which should be backwards-compatible with the Schema in the
Tuple File (new nullable fields are allowed, not... | java | public void addTupleInput(Path path, Schema targetSchema, TupleMapper<ITuple, NullWritable> tupleMapper) {
addInput(path, new TupleInputFormat(targetSchema), tupleMapper);
} | [
"public",
"void",
"addTupleInput",
"(",
"Path",
"path",
",",
"Schema",
"targetSchema",
",",
"TupleMapper",
"<",
"ITuple",
",",
"NullWritable",
">",
"tupleMapper",
")",
"{",
"addInput",
"(",
"path",
",",
"new",
"TupleInputFormat",
"(",
"targetSchema",
")",
",",... | Adds an input file associated with a TupleFile.
<p>
A specific "Target Schema" is specified, which should be backwards-compatible with the Schema in the
Tuple File (new nullable fields are allowed, not used old fields too). | [
"Adds",
"an",
"input",
"file",
"associated",
"with",
"a",
"TupleFile",
".",
"<p",
">",
"A",
"specific",
"Target",
"Schema",
"is",
"specified",
"which",
"should",
"be",
"backwards",
"-",
"compatible",
"with",
"the",
"Schema",
"in",
"the",
"Tuple",
"File",
"... | train | https://github.com/datasalt/pangool/blob/bfd312dd78cba03febaf7988ae96a3d4bc585408/core/src/main/java/com/datasalt/pangool/tuplemr/TupleMRBuilder.java#L160-L162 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/Gather.java | Gather.find | public T find(Predicate<T> decision, T defaultValue) {
"""
Returns the first element that satisfies the given decision, or defaultValue if none found.
@param decision
@param defaultValue
@return
"""
return Iterables.find(result(), decision, defaultValue);
} | java | public T find(Predicate<T> decision, T defaultValue) {
return Iterables.find(result(), decision, defaultValue);
} | [
"public",
"T",
"find",
"(",
"Predicate",
"<",
"T",
">",
"decision",
",",
"T",
"defaultValue",
")",
"{",
"return",
"Iterables",
".",
"find",
"(",
"result",
"(",
")",
",",
"decision",
",",
"defaultValue",
")",
";",
"}"
] | Returns the first element that satisfies the given decision, or defaultValue if none found.
@param decision
@param defaultValue
@return | [
"Returns",
"the",
"first",
"element",
"that",
"satisfies",
"the",
"given",
"decision",
"or",
"defaultValue",
"if",
"none",
"found",
"."
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/Gather.java#L207-L209 |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/shared/action/BaseMoskitoUIAction.java | BaseMoskitoUIAction.getCurrentInterval | protected String getCurrentInterval(HttpServletRequest req, boolean saveToSession) {
"""
Returns the currently selected interval, either as parameter or from session.
@param req
@param saveToSession - if true the value from request will be stored to session.
@return
"""
String intervalParameter = req.getP... | java | protected String getCurrentInterval(HttpServletRequest req, boolean saveToSession){
String intervalParameter = req.getParameter(PARAM_INTERVAL);
String interval = intervalParameter;
if (interval==null){
interval = (String)req.getSession().getAttribute(BEAN_INTERVAL);
if (interval == null)
interval = DEF... | [
"protected",
"String",
"getCurrentInterval",
"(",
"HttpServletRequest",
"req",
",",
"boolean",
"saveToSession",
")",
"{",
"String",
"intervalParameter",
"=",
"req",
".",
"getParameter",
"(",
"PARAM_INTERVAL",
")",
";",
"String",
"interval",
"=",
"intervalParameter",
... | Returns the currently selected interval, either as parameter or from session.
@param req
@param saveToSession - if true the value from request will be stored to session.
@return | [
"Returns",
"the",
"currently",
"selected",
"interval",
"either",
"as",
"parameter",
"or",
"from",
"session",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/shared/action/BaseMoskitoUIAction.java#L299-L310 |
intellimate/Izou | src/main/java/org/intellimate/izou/events/EventDistributor.java | EventDistributor.registerEventListener | @SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter")
public void registerEventListener(List<String> ids, EventListenerModel eventListener) {
"""
Adds an listener for events.
<p>
It will register for all ids individually!
This method will ignore if this listener is already listening to an Eve... | java | @SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter")
public void registerEventListener(List<String> ids, EventListenerModel eventListener) {
for(String id : ids) {
ArrayList<EventListenerModel> listenersList = listeners.get(id);
if (listenersList == null) {
... | [
"@",
"SuppressWarnings",
"(",
"\"SynchronizationOnLocalVariableOrMethodParameter\"",
")",
"public",
"void",
"registerEventListener",
"(",
"List",
"<",
"String",
">",
"ids",
",",
"EventListenerModel",
"eventListener",
")",
"{",
"for",
"(",
"String",
"id",
":",
"ids",
... | Adds an listener for events.
<p>
It will register for all ids individually!
This method will ignore if this listener is already listening to an Event.
Method is thread-safe.
</p>
@param ids this can be type, or descriptors etc.
@param eventListener the ActivatorEventListener-interface for receiving activator events | [
"Adds",
"an",
"listener",
"for",
"events",
".",
"<p",
">",
"It",
"will",
"register",
"for",
"all",
"ids",
"individually!",
"This",
"method",
"will",
"ignore",
"if",
"this",
"listener",
"is",
"already",
"listening",
"to",
"an",
"Event",
".",
"Method",
"is",... | train | https://github.com/intellimate/Izou/blob/40a808b97998e17655c4a78e30ce7326148aed27/src/main/java/org/intellimate/izou/events/EventDistributor.java#L131-L145 |
square/flow | flow/src/main/java/flow/Traversal.java | Traversal.createContext | @NonNull public Context createContext(@NonNull Object key, @NonNull Context baseContext) {
"""
Creates a Context for the given key.
Contexts can be created only for keys at the top of the origin and destination Histories.
"""
return new FlowContextWrapper(keyManager.findServices(key), baseContext);
} | java | @NonNull public Context createContext(@NonNull Object key, @NonNull Context baseContext) {
return new FlowContextWrapper(keyManager.findServices(key), baseContext);
} | [
"@",
"NonNull",
"public",
"Context",
"createContext",
"(",
"@",
"NonNull",
"Object",
"key",
",",
"@",
"NonNull",
"Context",
"baseContext",
")",
"{",
"return",
"new",
"FlowContextWrapper",
"(",
"keyManager",
".",
"findServices",
"(",
"key",
")",
",",
"baseConte... | Creates a Context for the given key.
Contexts can be created only for keys at the top of the origin and destination Histories. | [
"Creates",
"a",
"Context",
"for",
"the",
"given",
"key",
"."
] | train | https://github.com/square/flow/blob/1656288d1cb4a92dfbcff8276f4d7f9e3390419b/flow/src/main/java/flow/Traversal.java#L43-L45 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ThreadLocalRandom.java | ThreadLocalRandom.ints | public IntStream ints(long streamSize, int randomNumberOrigin,
int randomNumberBound) {
"""
Returns a stream producing the given {@code streamSize} number
of pseudorandom {@code int} values, each conforming to the given
origin (inclusive) and bound (exclusive).
@param streamSize the ... | java | public IntStream ints(long streamSize, int randomNumberOrigin,
int randomNumberBound) {
if (streamSize < 0L)
throw new IllegalArgumentException(BAD_SIZE);
if (randomNumberOrigin >= randomNumberBound)
throw new IllegalArgumentException(BAD_RANGE);
... | [
"public",
"IntStream",
"ints",
"(",
"long",
"streamSize",
",",
"int",
"randomNumberOrigin",
",",
"int",
"randomNumberBound",
")",
"{",
"if",
"(",
"streamSize",
"<",
"0L",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"BAD_SIZE",
")",
";",
"if",
"(",
... | Returns a stream producing the given {@code streamSize} number
of pseudorandom {@code int} values, each conforming to the given
origin (inclusive) and bound (exclusive).
@param streamSize the number of values to generate
@param randomNumberOrigin the origin (inclusive) of each random value
@param randomNumberBound the... | [
"Returns",
"a",
"stream",
"producing",
"the",
"given",
"{",
"@code",
"streamSize",
"}",
"number",
"of",
"pseudorandom",
"{",
"@code",
"int",
"}",
"values",
"each",
"conforming",
"to",
"the",
"given",
"origin",
"(",
"inclusive",
")",
"and",
"bound",
"(",
"e... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ThreadLocalRandom.java#L515-L525 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/util/StreamUtil.java | StreamUtil.cloneContent | public static InputStream cloneContent(InputStream source, long readbackSize, ByteArrayOutputStream target) throws IOException {
"""
a convenience method to reduce all the casting of HttpEntity.getContentLength() to int
"""
return cloneContent(source, (int)Math.min((long)Integer.MAX_VALUE, readbackSize... | java | public static InputStream cloneContent(InputStream source, long readbackSize, ByteArrayOutputStream target) throws IOException {
return cloneContent(source, (int)Math.min((long)Integer.MAX_VALUE, readbackSize), target);
} | [
"public",
"static",
"InputStream",
"cloneContent",
"(",
"InputStream",
"source",
",",
"long",
"readbackSize",
",",
"ByteArrayOutputStream",
"target",
")",
"throws",
"IOException",
"{",
"return",
"cloneContent",
"(",
"source",
",",
"(",
"int",
")",
"Math",
".",
"... | a convenience method to reduce all the casting of HttpEntity.getContentLength() to int | [
"a",
"convenience",
"method",
"to",
"reduce",
"all",
"the",
"casting",
"of",
"HttpEntity",
".",
"getContentLength",
"()",
"to",
"int"
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/util/StreamUtil.java#L119-L121 |
arquillian/arquillian-cube | docker/docker/src/main/java/org/arquillian/cube/docker/impl/docker/DockerClientExecutor.java | DockerClientExecutor.execStartVerbose | public ExecInspection execStartVerbose(String containerId, String... commands) {
"""
EXecutes command to given container returning the inspection object as well. This method does 3 calls to
dockerhost. Create, Start and Inspect.
@param containerId
to execute command.
"""
this.readWriteLock.readLoc... | java | public ExecInspection execStartVerbose(String containerId, String... commands) {
this.readWriteLock.readLock().lock();
try {
String id = execCreate(containerId, commands);
CubeOutput output = execStartOutput(id);
return new ExecInspection(output, inspectExec(id));
... | [
"public",
"ExecInspection",
"execStartVerbose",
"(",
"String",
"containerId",
",",
"String",
"...",
"commands",
")",
"{",
"this",
".",
"readWriteLock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"String",
"id",
"=",
"execCreate",
"(... | EXecutes command to given container returning the inspection object as well. This method does 3 calls to
dockerhost. Create, Start and Inspect.
@param containerId
to execute command. | [
"EXecutes",
"command",
"to",
"given",
"container",
"returning",
"the",
"inspection",
"object",
"as",
"well",
".",
"This",
"method",
"does",
"3",
"calls",
"to",
"dockerhost",
".",
"Create",
"Start",
"and",
"Inspect",
"."
] | train | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/docker/docker/src/main/java/org/arquillian/cube/docker/impl/docker/DockerClientExecutor.java#L928-L938 |
alamkanak/Android-Week-View | library/src/main/java/com/alamkanak/weekview/WeekView.java | WeekView.getDateTimeInterpreter | public DateTimeInterpreter getDateTimeInterpreter() {
"""
Get the interpreter which provides the text to show in the header column and the header row.
@return The date, time interpreter.
"""
if (mDateTimeInterpreter == null) {
mDateTimeInterpreter = new DateTimeInterpreter() {
... | java | public DateTimeInterpreter getDateTimeInterpreter() {
if (mDateTimeInterpreter == null) {
mDateTimeInterpreter = new DateTimeInterpreter() {
@Override
public String interpretDate(Calendar date) {
try {
SimpleDateFormat sdf =... | [
"public",
"DateTimeInterpreter",
"getDateTimeInterpreter",
"(",
")",
"{",
"if",
"(",
"mDateTimeInterpreter",
"==",
"null",
")",
"{",
"mDateTimeInterpreter",
"=",
"new",
"DateTimeInterpreter",
"(",
")",
"{",
"@",
"Override",
"public",
"String",
"interpretDate",
"(",
... | Get the interpreter which provides the text to show in the header column and the header row.
@return The date, time interpreter. | [
"Get",
"the",
"interpreter",
"which",
"provides",
"the",
"text",
"to",
"show",
"in",
"the",
"header",
"column",
"and",
"the",
"header",
"row",
"."
] | train | https://github.com/alamkanak/Android-Week-View/blob/dc3f97d65d44785d1a761b52b58527c86c4eee1b/library/src/main/java/com/alamkanak/weekview/WeekView.java#L1299-L1330 |
JavaMoney/jsr354-api | src/main/java/javax/money/CurrencyQueryBuilder.java | CurrencyQueryBuilder.setCurrencyCodes | public CurrencyQueryBuilder setCurrencyCodes(String... codes) {
"""
Sets the currency code, or the regular expression to select codes.
@param codes the currency codes or code expressions, not null.
@return the query for chaining.
"""
return set(CurrencyQuery.KEY_QUERY_CURRENCY_CODES, Arrays.asList(... | java | public CurrencyQueryBuilder setCurrencyCodes(String... codes) {
return set(CurrencyQuery.KEY_QUERY_CURRENCY_CODES, Arrays.asList(codes));
} | [
"public",
"CurrencyQueryBuilder",
"setCurrencyCodes",
"(",
"String",
"...",
"codes",
")",
"{",
"return",
"set",
"(",
"CurrencyQuery",
".",
"KEY_QUERY_CURRENCY_CODES",
",",
"Arrays",
".",
"asList",
"(",
"codes",
")",
")",
";",
"}"
] | Sets the currency code, or the regular expression to select codes.
@param codes the currency codes or code expressions, not null.
@return the query for chaining. | [
"Sets",
"the",
"currency",
"code",
"or",
"the",
"regular",
"expression",
"to",
"select",
"codes",
"."
] | train | https://github.com/JavaMoney/jsr354-api/blob/49a7ae436eaf45cac1040879185531ef22de5525/src/main/java/javax/money/CurrencyQueryBuilder.java#L68-L70 |
GwtMaterialDesign/gwt-material-addins | src/main/java/gwt/material/design/addins/client/popupmenu/MaterialPopupMenu.java | MaterialPopupMenu.setPopupPosition | public void setPopupPosition(int popupX, int popupY) {
"""
Set the popup position of the context menu
@param popupX window x position
@param popupY window y position
"""
// Will check if the popup is out of container
this.popupX = popupX;
this.popupY = popupY;
setLeft(popupX... | java | public void setPopupPosition(int popupX, int popupY) {
// Will check if the popup is out of container
this.popupX = popupX;
this.popupY = popupY;
setLeft(popupX);
setTop(popupY);
} | [
"public",
"void",
"setPopupPosition",
"(",
"int",
"popupX",
",",
"int",
"popupY",
")",
"{",
"// Will check if the popup is out of container",
"this",
".",
"popupX",
"=",
"popupX",
";",
"this",
".",
"popupY",
"=",
"popupY",
";",
"setLeft",
"(",
"popupX",
")",
"... | Set the popup position of the context menu
@param popupX window x position
@param popupY window y position | [
"Set",
"the",
"popup",
"position",
"of",
"the",
"context",
"menu"
] | train | https://github.com/GwtMaterialDesign/gwt-material-addins/blob/11aec9d92918225f70f936285d0ae94f2178c36e/src/main/java/gwt/material/design/addins/client/popupmenu/MaterialPopupMenu.java#L163-L169 |
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.createOrUpdate | public SignalRResourceInner createOrUpdate(String resourceGroupName, String resourceName, SignalRCreateParameters parameters) {
"""
Create a new SignalR service and update an exiting SignalR service.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value fr... | java | public SignalRResourceInner createOrUpdate(String resourceGroupName, String resourceName, SignalRCreateParameters parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, parameters).toBlocking().last().body();
} | [
"public",
"SignalRResourceInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"SignalRCreateParameters",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
",... | Create a new SignalR service and update an exiting SignalR service.
@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.
@param parameters Parameters for the... | [
"Create",
"a",
"new",
"SignalR",
"service",
"and",
"update",
"an",
"exiting",
"SignalR",
"service",
"."
] | 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#L1060-L1062 |
luuuis/jcalendar | src/main/java/com/toedter/calendar/JCalendar.java | JCalendar.setCalendar | private void setCalendar(Calendar c, boolean update) {
"""
Sets the calendar attribute of the JCalendar object
@param c
the new calendar value
@param update
the new calendar value
@throws NullPointerException -
if c is null;
"""
if (c == null) {
setDate(null);
}
Calendar oldCalendar = calendar... | java | private void setCalendar(Calendar c, boolean update) {
if (c == null) {
setDate(null);
}
Calendar oldCalendar = calendar;
calendar = c;
if (update) {
// Thanks to Jeff Ulmer for correcting a bug in the sequence :)
yearChooser.setYear(c.get(Calendar.YEAR));
monthChooser.setMonth(c.get(Calendar.MON... | [
"private",
"void",
"setCalendar",
"(",
"Calendar",
"c",
",",
"boolean",
"update",
")",
"{",
"if",
"(",
"c",
"==",
"null",
")",
"{",
"setDate",
"(",
"null",
")",
";",
"}",
"Calendar",
"oldCalendar",
"=",
"calendar",
";",
"calendar",
"=",
"c",
";",
"if... | Sets the calendar attribute of the JCalendar object
@param c
the new calendar value
@param update
the new calendar value
@throws NullPointerException -
if c is null; | [
"Sets",
"the",
"calendar",
"attribute",
"of",
"the",
"JCalendar",
"object"
] | train | https://github.com/luuuis/jcalendar/blob/442e5bc319d92dee93400e6180ca74a5b6bd7775/src/main/java/com/toedter/calendar/JCalendar.java#L353-L368 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/PartnersInner.java | PartnersInner.createOrUpdateAsync | public Observable<IntegrationAccountPartnerInner> createOrUpdateAsync(String resourceGroupName, String integrationAccountName, String partnerName, IntegrationAccountPartnerInner partner) {
"""
Creates or updates an integration account partner.
@param resourceGroupName The resource group name.
@param integratio... | java | public Observable<IntegrationAccountPartnerInner> createOrUpdateAsync(String resourceGroupName, String integrationAccountName, String partnerName, IntegrationAccountPartnerInner partner) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, integrationAccountName, partnerName, partner).map(new Func... | [
"public",
"Observable",
"<",
"IntegrationAccountPartnerInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"integrationAccountName",
",",
"String",
"partnerName",
",",
"IntegrationAccountPartnerInner",
"partner",
")",
"{",
"return",
"creat... | Creates or updates an integration account partner.
@param resourceGroupName The resource group name.
@param integrationAccountName The integration account name.
@param partnerName The integration account partner name.
@param partner The integration account partner.
@throws IllegalArgumentException thrown if parameters... | [
"Creates",
"or",
"updates",
"an",
"integration",
"account",
"partner",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/PartnersInner.java#L477-L484 |
OpenLiberty/open-liberty | dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/DeferrableScheduledExecutorImpl.java | DeferrableScheduledExecutorImpl.roundUpDelay | static long roundUpDelay(long delay, TimeUnit unit, long now) {
"""
Round up delays so that all tasks fire at approximately with approximately the same 15s period.
"""
if (delay < 0) {
// Negative is treated as 0.
delay = 0;
}
long target = now + unit.toMillis(d... | java | static long roundUpDelay(long delay, TimeUnit unit, long now) {
if (delay < 0) {
// Negative is treated as 0.
delay = 0;
}
long target = now + unit.toMillis(delay);
if (target < now) {
// We can't add the delay to the current time without overflow.
... | [
"static",
"long",
"roundUpDelay",
"(",
"long",
"delay",
",",
"TimeUnit",
"unit",
",",
"long",
"now",
")",
"{",
"if",
"(",
"delay",
"<",
"0",
")",
"{",
"// Negative is treated as 0.",
"delay",
"=",
"0",
";",
"}",
"long",
"target",
"=",
"now",
"+",
"unit... | Round up delays so that all tasks fire at approximately with approximately the same 15s period. | [
"Round",
"up",
"delays",
"so",
"that",
"all",
"tasks",
"fire",
"at",
"approximately",
"with",
"approximately",
"the",
"same",
"15s",
"period",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/DeferrableScheduledExecutorImpl.java#L32-L60 |
domaframework/doma-gen | src/main/java/org/seasar/doma/extension/gen/Generator.java | Generator.createTemplateLoader | protected TemplateLoader createTemplateLoader(File templateFilePrimaryDir) {
"""
{@link TemplateLoader}を作成します。
@param templateFilePrimaryDir テンプレートファイルを格納したプライマリディレクトリ、プライマリディレクトリを使用しない場合{@code null}
@return {@link TemplateLoader}
"""
TemplateLoader primary = null;
if (templateFilePrimaryDir != nul... | java | protected TemplateLoader createTemplateLoader(File templateFilePrimaryDir) {
TemplateLoader primary = null;
if (templateFilePrimaryDir != null) {
try {
primary = new FileTemplateLoader(templateFilePrimaryDir);
} catch (IOException e) {
throw new GenException(Message.DOMAGEN9001, e, e... | [
"protected",
"TemplateLoader",
"createTemplateLoader",
"(",
"File",
"templateFilePrimaryDir",
")",
"{",
"TemplateLoader",
"primary",
"=",
"null",
";",
"if",
"(",
"templateFilePrimaryDir",
"!=",
"null",
")",
"{",
"try",
"{",
"primary",
"=",
"new",
"FileTemplateLoader... | {@link TemplateLoader}を作成します。
@param templateFilePrimaryDir テンプレートファイルを格納したプライマリディレクトリ、プライマリディレクトリを使用しない場合{@code null}
@return {@link TemplateLoader} | [
"{",
"@link",
"TemplateLoader",
"}",
"を作成します。"
] | train | https://github.com/domaframework/doma-gen/blob/8046e0b28d2167d444125f206ce36e554b3ee616/src/main/java/org/seasar/doma/extension/gen/Generator.java#L70-L84 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/nonparametrics/independentsamples/KolmogorovSmirnovIndependentSamples.java | KolmogorovSmirnovIndependentSamples.checkCriticalValue | private static boolean checkCriticalValue(double score, boolean is_twoTailed, int n1, int n2, double aLevel) {
"""
Checks the Critical Value to determine if the Hypothesis should be rejected
@param score
@param is_twoTailed
@param n1
@param n2
@param aLevel
@return
"""
boolean rejected=false;
... | java | private static boolean checkCriticalValue(double score, boolean is_twoTailed, int n1, int n2, double aLevel) {
boolean rejected=false;
double criticalValue= calculateCriticalValue(is_twoTailed,n1,n2,aLevel);
if(score>criticalValue) {
rejected=true;
}
return rejec... | [
"private",
"static",
"boolean",
"checkCriticalValue",
"(",
"double",
"score",
",",
"boolean",
"is_twoTailed",
",",
"int",
"n1",
",",
"int",
"n2",
",",
"double",
"aLevel",
")",
"{",
"boolean",
"rejected",
"=",
"false",
";",
"double",
"criticalValue",
"=",
"ca... | Checks the Critical Value to determine if the Hypothesis should be rejected
@param score
@param is_twoTailed
@param n1
@param n2
@param aLevel
@return | [
"Checks",
"the",
"Critical",
"Value",
"to",
"determine",
"if",
"the",
"Hypothesis",
"should",
"be",
"rejected"
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/nonparametrics/independentsamples/KolmogorovSmirnovIndependentSamples.java#L115-L126 |
google/closure-compiler | src/com/google/javascript/rhino/jstype/JSTypeRegistry.java | JSTypeRegistry.createRecordTypeFromNodes | private JSType createRecordTypeFromNodes(Node n, String sourceName, StaticTypedScope scope) {
"""
Creates a RecordType from the nodes representing said record type.
@param n The node with type info.
@param sourceName The source file name.
@param scope A scope for doing type name lookups.
"""
RecordTy... | java | private JSType createRecordTypeFromNodes(Node n, String sourceName, StaticTypedScope scope) {
RecordTypeBuilder builder = new RecordTypeBuilder(this);
// For each of the fields in the record type.
for (Node fieldTypeNode = n.getFirstChild();
fieldTypeNode != null;
fieldTypeNode = fieldTy... | [
"private",
"JSType",
"createRecordTypeFromNodes",
"(",
"Node",
"n",
",",
"String",
"sourceName",
",",
"StaticTypedScope",
"scope",
")",
"{",
"RecordTypeBuilder",
"builder",
"=",
"new",
"RecordTypeBuilder",
"(",
"this",
")",
";",
"// For each of the fields in the record ... | Creates a RecordType from the nodes representing said record type.
@param n The node with type info.
@param sourceName The source file name.
@param scope A scope for doing type name lookups. | [
"Creates",
"a",
"RecordType",
"from",
"the",
"nodes",
"representing",
"said",
"record",
"type",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/JSTypeRegistry.java#L2208-L2251 |
jfinal/jfinal | src/main/java/com/jfinal/plugin/redis/Cache.java | Cache.lrem | public Long lrem(Object key, long count, Object value) {
"""
根据参数 count 的值,移除列表中与参数 value 相等的元素。
count 的值可以是以下几种:
count > 0 : 从表头开始向表尾搜索,移除与 value 相等的元素,数量为 count 。
count < 0 : 从表尾开始向表头搜索,移除与 value 相等的元素,数量为 count 的绝对值。
count = 0 : 移除表中所有与 value 相等的值。
"""
Jedis jedis = getJedis();
try {
return je... | java | public Long lrem(Object key, long count, Object value) {
Jedis jedis = getJedis();
try {
return jedis.lrem(keyToBytes(key), count, valueToBytes(value));
}
finally {close(jedis);}
} | [
"public",
"Long",
"lrem",
"(",
"Object",
"key",
",",
"long",
"count",
",",
"Object",
"value",
")",
"{",
"Jedis",
"jedis",
"=",
"getJedis",
"(",
")",
";",
"try",
"{",
"return",
"jedis",
".",
"lrem",
"(",
"keyToBytes",
"(",
"key",
")",
",",
"count",
... | 根据参数 count 的值,移除列表中与参数 value 相等的元素。
count 的值可以是以下几种:
count > 0 : 从表头开始向表尾搜索,移除与 value 相等的元素,数量为 count 。
count < 0 : 从表尾开始向表头搜索,移除与 value 相等的元素,数量为 count 的绝对值。
count = 0 : 移除表中所有与 value 相等的值。 | [
"根据参数",
"count",
"的值,移除列表中与参数",
"value",
"相等的元素。",
"count",
"的值可以是以下几种:",
"count",
">",
"0",
":",
"从表头开始向表尾搜索,移除与",
"value",
"相等的元素,数量为",
"count",
"。",
"count",
"<",
"0",
":",
"从表尾开始向表头搜索,移除与",
"value",
"相等的元素,数量为",
"count",
"的绝对值。",
"count",
"=",
"0",
":",
... | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/redis/Cache.java#L701-L707 |
samskivert/pythagoras | src/main/java/pythagoras/f/MathUtil.java | MathUtil.lerpa | public static float lerpa (float a1, float a2, float t) {
"""
Linearly interpolates between two angles, taking the shortest path around the circle.
This assumes that both angles are in [-pi, +pi].
"""
float ma1 = mirrorAngle(a1), ma2 = mirrorAngle(a2);
float d = Math.abs(a2 - a1), md = Math.ab... | java | public static float lerpa (float a1, float a2, float t) {
float ma1 = mirrorAngle(a1), ma2 = mirrorAngle(a2);
float d = Math.abs(a2 - a1), md = Math.abs(ma1 - ma2);
return (d <= md) ? lerp(a1, a2, t) : mirrorAngle(lerp(ma1, ma2, t));
} | [
"public",
"static",
"float",
"lerpa",
"(",
"float",
"a1",
",",
"float",
"a2",
",",
"float",
"t",
")",
"{",
"float",
"ma1",
"=",
"mirrorAngle",
"(",
"a1",
")",
",",
"ma2",
"=",
"mirrorAngle",
"(",
"a2",
")",
";",
"float",
"d",
"=",
"Math",
".",
"a... | Linearly interpolates between two angles, taking the shortest path around the circle.
This assumes that both angles are in [-pi, +pi]. | [
"Linearly",
"interpolates",
"between",
"two",
"angles",
"taking",
"the",
"shortest",
"path",
"around",
"the",
"circle",
".",
"This",
"assumes",
"that",
"both",
"angles",
"are",
"in",
"[",
"-",
"pi",
"+",
"pi",
"]",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/f/MathUtil.java#L103-L107 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/util/AmbiguousEJBRefReferenceFactory.java | AmbiguousEJBRefReferenceFactory.createAmbiguousReference | public static Reference createAmbiguousReference
(String shortDefaultBinding,
List<J2EEName> j2eeNames) {
"""
Creates an AmbiguousEJBReference Reference based on a short-form
default binding (interface) and a list of J2EENames for all EJB
implementing that interface, and ... | java | public static Reference createAmbiguousReference
(String shortDefaultBinding,
List<J2EEName> j2eeNames)
{
String message = "The short-form default binding '" + shortDefaultBinding +
"' is ambiguous because multiple beans implement the interfa... | [
"public",
"static",
"Reference",
"createAmbiguousReference",
"(",
"String",
"shortDefaultBinding",
",",
"List",
"<",
"J2EEName",
">",
"j2eeNames",
")",
"{",
"String",
"message",
"=",
"\"The short-form default binding '\"",
"+",
"shortDefaultBinding",
"+",
"\"' is ambiguou... | Creates an AmbiguousEJBReference Reference based on a short-form
default binding (interface) and a list of J2EENames for all EJB
implementing that interface, and using short-form bindings. <p>
Intended for use in the following scenario: <p>
Default short form bindings are being used, and multiple EJBs
are configured ... | [
"Creates",
"an",
"AmbiguousEJBReference",
"Reference",
"based",
"on",
"a",
"short",
"-",
"form",
"default",
"binding",
"(",
"interface",
")",
"and",
"a",
"list",
"of",
"J2EENames",
"for",
"all",
"EJB",
"implementing",
"that",
"interface",
"and",
"using",
"shor... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/util/AmbiguousEJBRefReferenceFactory.java#L116-L129 |
joniles/mpxj | src/main/java/net/sf/mpxj/primavera/PrimaveraPMFileReader.java | PrimaveraPMFileReader.populateField | private void populateField(FieldContainer container, FieldType target, FieldType... types) {
"""
Populates a field based on baseline and actual values.
@param container field container
@param target target field
@param types fields to test for not-null values
"""
for (FieldType type : types)
{... | java | private void populateField(FieldContainer container, FieldType target, FieldType... types)
{
for (FieldType type : types)
{
Object value = container.getCachedValue(type);
if (value != null)
{
container.set(target, value);
break;
}
}
} | [
"private",
"void",
"populateField",
"(",
"FieldContainer",
"container",
",",
"FieldType",
"target",
",",
"FieldType",
"...",
"types",
")",
"{",
"for",
"(",
"FieldType",
"type",
":",
"types",
")",
"{",
"Object",
"value",
"=",
"container",
".",
"getCachedValue",... | Populates a field based on baseline and actual values.
@param container field container
@param target target field
@param types fields to test for not-null values | [
"Populates",
"a",
"field",
"based",
"on",
"baseline",
"and",
"actual",
"values",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraPMFileReader.java#L873-L884 |
astrapi69/jaulp-wicket | jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/util/WicketComponentExtensions.java | WicketComponentExtensions.toPageParameters | @Deprecated
public static PageParameters toPageParameters(final Map<String, String> parameters) {
"""
Converts the given Map to a {@link PageParameters} object.
@param parameters
the {@link Map} with the parameters to set.
@return the {@link PageParameters}
@deprecated use instead {@link PageParametersExte... | java | @Deprecated
public static PageParameters toPageParameters(final Map<String, String> parameters)
{
return PageParametersExtensions.toPageParameters(parameters);
} | [
"@",
"Deprecated",
"public",
"static",
"PageParameters",
"toPageParameters",
"(",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"{",
"return",
"PageParametersExtensions",
".",
"toPageParameters",
"(",
"parameters",
")",
";",
"}"
] | Converts the given Map to a {@link PageParameters} object.
@param parameters
the {@link Map} with the parameters to set.
@return the {@link PageParameters}
@deprecated use instead {@link PageParametersExtensions#toPageParameters(Map)} | [
"Converts",
"the",
"given",
"Map",
"to",
"a",
"{",
"@link",
"PageParameters",
"}",
"object",
"."
] | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/util/WicketComponentExtensions.java#L421-L425 |
Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/AbstractInstanceRegistry.java | AbstractInstanceRegistry.storeOverriddenStatusIfRequired | @Deprecated
@Override
public void storeOverriddenStatusIfRequired(String id, InstanceStatus overriddenStatus) {
"""
@deprecated this is expensive, try not to use. See if you can use
{@link #storeOverriddenStatusIfRequired(String, String, InstanceStatus)} instead.
Stores overridden status if it is not a... | java | @Deprecated
@Override
public void storeOverriddenStatusIfRequired(String id, InstanceStatus overriddenStatus) {
InstanceStatus instanceStatus = overriddenInstanceStatusMap.get(id);
if ((instanceStatus == null)
|| (!overriddenStatus.equals(instanceStatus))) {
// We mig... | [
"@",
"Deprecated",
"@",
"Override",
"public",
"void",
"storeOverriddenStatusIfRequired",
"(",
"String",
"id",
",",
"InstanceStatus",
"overriddenStatus",
")",
"{",
"InstanceStatus",
"instanceStatus",
"=",
"overriddenInstanceStatusMap",
".",
"get",
"(",
"id",
")",
";",
... | @deprecated this is expensive, try not to use. See if you can use
{@link #storeOverriddenStatusIfRequired(String, String, InstanceStatus)} instead.
Stores overridden status if it is not already there. This happens during
a reconciliation process during renewal requests.
@param id the unique identifier of the instance... | [
"@deprecated",
"this",
"is",
"expensive",
"try",
"not",
"to",
"use",
".",
"See",
"if",
"you",
"can",
"use",
"{",
"@link",
"#storeOverriddenStatusIfRequired",
"(",
"String",
"String",
"InstanceStatus",
")",
"}",
"instead",
"."
] | train | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/AbstractInstanceRegistry.java#L393-L414 |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java | ThreeViewEstimateMetricScene.process | public boolean process(List<AssociatedTriple> associated , int width , int height ) {
"""
Determines the metric scene. The principle point is assumed to be zero in the passed in pixel coordinates.
Typically this is done by subtracting the image center from each pixel coordinate for each view.
@param associated... | java | public boolean process(List<AssociatedTriple> associated , int width , int height ) {
init(width, height);
// Fit a trifocal tensor to the input observations
if (!robustFitTrifocal(associated) )
return false;
// estimate the scene's structure
if( !estimateProjectiveScene())
return false;
if( !proje... | [
"public",
"boolean",
"process",
"(",
"List",
"<",
"AssociatedTriple",
">",
"associated",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"init",
"(",
"width",
",",
"height",
")",
";",
"// Fit a trifocal tensor to the input observations",
"if",
"(",
"!",
"... | Determines the metric scene. The principle point is assumed to be zero in the passed in pixel coordinates.
Typically this is done by subtracting the image center from each pixel coordinate for each view.
@param associated List of associated features from 3 views. pixels
@param width width of all images
@param height h... | [
"Determines",
"the",
"metric",
"scene",
".",
"The",
"principle",
"point",
"is",
"assumed",
"to",
"be",
"zero",
"in",
"the",
"passed",
"in",
"pixel",
"coordinates",
".",
"Typically",
"this",
"is",
"done",
"by",
"subtracting",
"the",
"image",
"center",
"from",... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java#L157-L181 |
raydac/java-comment-preprocessor | jcp/src/main/java/com/igormaznitsa/meta/common/utils/Deferrers.java | Deferrers.processDeferredActions | @Weight(value = Weight.Unit.VARIABLE, comment = "Depends on the current call stack depth")
public static void processDeferredActions() {
"""
Process all defer actions for the current stack depth level.
@since 1.0
"""
final int stackDepth = ThreadUtils.stackDepth();
final List<Deferred> list = REG... | java | @Weight(value = Weight.Unit.VARIABLE, comment = "Depends on the current call stack depth")
public static void processDeferredActions() {
final int stackDepth = ThreadUtils.stackDepth();
final List<Deferred> list = REGISTRY.get();
final Iterator<Deferred> iterator = list.iterator();
while (iterator.h... | [
"@",
"Weight",
"(",
"value",
"=",
"Weight",
".",
"Unit",
".",
"VARIABLE",
",",
"comment",
"=",
"\"Depends on the current call stack depth\"",
")",
"public",
"static",
"void",
"processDeferredActions",
"(",
")",
"{",
"final",
"int",
"stackDepth",
"=",
"ThreadUtils"... | Process all defer actions for the current stack depth level.
@since 1.0 | [
"Process",
"all",
"defer",
"actions",
"for",
"the",
"current",
"stack",
"depth",
"level",
"."
] | train | https://github.com/raydac/java-comment-preprocessor/blob/83ac87b575ac084914d77695a8c8673de3b8300c/jcp/src/main/java/com/igormaznitsa/meta/common/utils/Deferrers.java#L214-L237 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/images/ImageGenerator.java | ImageGenerator.drawImageWithNewMapContent | public BufferedImage drawImageWithNewMapContent( ReferencedEnvelope ref, int imageWidth, int imageHeight, double buffer ) {
"""
Draw the map on an image creating a new MapContent.
@param bounds the area of interest.
@param imageWidth the width of the image to produce.
@param imageHeight the height of the imag... | java | public BufferedImage drawImageWithNewMapContent( ReferencedEnvelope ref, int imageWidth, int imageHeight, double buffer ) {
MapContent content = new MapContent();
content.setTitle("dump");
if (forceCrs != null) {
content.getViewport().setCoordinateReferenceSystem(forceCrs);
... | [
"public",
"BufferedImage",
"drawImageWithNewMapContent",
"(",
"ReferencedEnvelope",
"ref",
",",
"int",
"imageWidth",
",",
"int",
"imageHeight",
",",
"double",
"buffer",
")",
"{",
"MapContent",
"content",
"=",
"new",
"MapContent",
"(",
")",
";",
"content",
".",
"... | Draw the map on an image creating a new MapContent.
@param bounds the area of interest.
@param imageWidth the width of the image to produce.
@param imageHeight the height of the image to produce.
@param buffer the buffer to add around the map bounds in map units.
@return the image. | [
"Draw",
"the",
"map",
"on",
"an",
"image",
"creating",
"a",
"new",
"MapContent",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/images/ImageGenerator.java#L512-L557 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/MatchPatternIterator.java | MatchPatternIterator.setRoot | public void setRoot(int context, Object environment) {
"""
Initialize the context values for this expression
after it is cloned.
@param context The XPath runtime context for this
transformation.
"""
super.setRoot(context, environment);
m_traverser = m_cdtm.getAxisTraverser(m_superAxis);
} | java | public void setRoot(int context, Object environment)
{
super.setRoot(context, environment);
m_traverser = m_cdtm.getAxisTraverser(m_superAxis);
} | [
"public",
"void",
"setRoot",
"(",
"int",
"context",
",",
"Object",
"environment",
")",
"{",
"super",
".",
"setRoot",
"(",
"context",
",",
"environment",
")",
";",
"m_traverser",
"=",
"m_cdtm",
".",
"getAxisTraverser",
"(",
"m_superAxis",
")",
";",
"}"
] | Initialize the context values for this expression
after it is cloned.
@param context The XPath runtime context for this
transformation. | [
"Initialize",
"the",
"context",
"values",
"for",
"this",
"expression",
"after",
"it",
"is",
"cloned",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/MatchPatternIterator.java#L160-L164 |
future-architect/uroborosql | src/main/java/jp/co/future/uroborosql/config/DefaultSqlConfig.java | DefaultSqlConfig.getConfig | public static SqlConfig getConfig(final DataSource dataSource, final boolean autoCommit, final boolean readOnly,
final int transactionIsolation) {
"""
データソースを指定してSqlConfigを取得する
@param dataSource データソース
@param autoCommit 自動コミットの指定
@param readOnly 読み取り専用モードの指定
@param transactionIsolation トランザクション隔離レベルの指定
@... | java | public static SqlConfig getConfig(final DataSource dataSource, final boolean autoCommit, final boolean readOnly,
final int transactionIsolation) {
DataSourceConnectionSupplierImpl connectionSupplier = new DataSourceConnectionSupplierImpl(dataSource);
connectionSupplier.setDefaultAutoCommit(autoCommit);
connect... | [
"public",
"static",
"SqlConfig",
"getConfig",
"(",
"final",
"DataSource",
"dataSource",
",",
"final",
"boolean",
"autoCommit",
",",
"final",
"boolean",
"readOnly",
",",
"final",
"int",
"transactionIsolation",
")",
"{",
"DataSourceConnectionSupplierImpl",
"connectionSupp... | データソースを指定してSqlConfigを取得する
@param dataSource データソース
@param autoCommit 自動コミットの指定
@param readOnly 読み取り専用モードの指定
@param transactionIsolation トランザクション隔離レベルの指定
@return SqlConfigオブジェクト | [
"データソースを指定してSqlConfigを取得する"
] | train | https://github.com/future-architect/uroborosql/blob/4c26db51defdac3c6ed16866e33ab45e190e2e0c/src/main/java/jp/co/future/uroborosql/config/DefaultSqlConfig.java#L196-L203 |
ddf-project/DDF | core/src/main/java/io/ddf/Factor.java | Factor.setLevels | public void setLevels(List<String> levels, boolean isOrdered) throws DDFException {
"""
Typically, levels are automatically computed from the data, but in some rare instances, the user may want to
specify the levels explicitly, e.g., when the data column does not contain all the levels desired.
@param levels
... | java | public void setLevels(List<String> levels, boolean isOrdered) throws DDFException {
this.setLevels(levels, null, isOrdered);
} | [
"public",
"void",
"setLevels",
"(",
"List",
"<",
"String",
">",
"levels",
",",
"boolean",
"isOrdered",
")",
"throws",
"DDFException",
"{",
"this",
".",
"setLevels",
"(",
"levels",
",",
"null",
",",
"isOrdered",
")",
";",
"}"
] | Typically, levels are automatically computed from the data, but in some rare instances, the user may want to
specify the levels explicitly, e.g., when the data column does not contain all the levels desired.
@param levels
@param isOrdered a flag indicating whether the levels actually have "less than" and "greater than... | [
"Typically",
"levels",
"are",
"automatically",
"computed",
"from",
"the",
"data",
"but",
"in",
"some",
"rare",
"instances",
"the",
"user",
"may",
"want",
"to",
"specify",
"the",
"levels",
"explicitly",
"e",
".",
"g",
".",
"when",
"the",
"data",
"column",
"... | train | https://github.com/ddf-project/DDF/blob/e4e68315dcec1ed8b287bf1ee73baa88e7e41eba/core/src/main/java/io/ddf/Factor.java#L157-L159 |
Jasig/uPortal | uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/services/EntityCachingService.java | EntityCachingService.get | @Override
public IBasicEntity get(Class<? extends IBasicEntity> type, String key)
throws CachingException {
"""
Returns the cached entity identified by type and key.
@param type Class
@param key String
@return IBasicEntity entity
@exception org.apereo.portal.concurrency.CachingException
"... | java | @Override
public IBasicEntity get(Class<? extends IBasicEntity> type, String key)
throws CachingException {
return EntityCachingServiceLocator.getEntityCachingService().get(type, key);
} | [
"@",
"Override",
"public",
"IBasicEntity",
"get",
"(",
"Class",
"<",
"?",
"extends",
"IBasicEntity",
">",
"type",
",",
"String",
"key",
")",
"throws",
"CachingException",
"{",
"return",
"EntityCachingServiceLocator",
".",
"getEntityCachingService",
"(",
")",
".",
... | Returns the cached entity identified by type and key.
@param type Class
@param key String
@return IBasicEntity entity
@exception org.apereo.portal.concurrency.CachingException | [
"Returns",
"the",
"cached",
"entity",
"identified",
"by",
"type",
"and",
"key",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/services/EntityCachingService.java#L103-L107 |
openbase/jul | exception/src/main/java/org/openbase/jul/exception/printer/ExceptionPrinter.java | ExceptionPrinter.printHistoryAndReturnThrowable | public static <T extends Throwable> T printHistoryAndReturnThrowable(final T th, final Printer printer) {
"""
Print Exception messages without stack trace in non debug mode. Method prints recursive all messages of the given exception stack to get a history overview of the causes. In verbose mode (app
-v) the stac... | java | public static <T extends Throwable> T printHistoryAndReturnThrowable(final T th, final Printer printer) {
printHistory(th, printer);
return th;
} | [
"public",
"static",
"<",
"T",
"extends",
"Throwable",
">",
"T",
"printHistoryAndReturnThrowable",
"(",
"final",
"T",
"th",
",",
"final",
"Printer",
"printer",
")",
"{",
"printHistory",
"(",
"th",
",",
"printer",
")",
";",
"return",
"th",
";",
"}"
] | Print Exception messages without stack trace in non debug mode. Method prints recursive all messages of the given exception stack to get a history overview of the causes. In verbose mode (app
-v) the stacktrace is printed in the end of history.
@param <T> Exception type
@param th exception stack to print.
@param print... | [
"Print",
"Exception",
"messages",
"without",
"stack",
"trace",
"in",
"non",
"debug",
"mode",
".",
"Method",
"prints",
"recursive",
"all",
"messages",
"of",
"the",
"given",
"exception",
"stack",
"to",
"get",
"a",
"history",
"overview",
"of",
"the",
"causes",
... | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/exception/src/main/java/org/openbase/jul/exception/printer/ExceptionPrinter.java#L290-L293 |
buschmais/jqa-java-plugin | src/main/java/com/buschmais/jqassistant/plugin/java/api/scanner/SignatureHelper.java | SignatureHelper.getFieldSignature | public static String getFieldSignature(String name, String rawSignature) {
"""
Return a field signature.
@param name
The field name.
@param rawSignature
The signature containing the type value.
@return The field signature.
"""
StringBuilder signature = new StringBuilder();
String returnT... | java | public static String getFieldSignature(String name, String rawSignature) {
StringBuilder signature = new StringBuilder();
String returnType = org.objectweb.asm.Type.getType(rawSignature).getClassName();
signature.append(returnType);
signature.append(' ');
signature.append(name);
... | [
"public",
"static",
"String",
"getFieldSignature",
"(",
"String",
"name",
",",
"String",
"rawSignature",
")",
"{",
"StringBuilder",
"signature",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"String",
"returnType",
"=",
"org",
".",
"objectweb",
".",
"asm",
".",
... | Return a field signature.
@param name
The field name.
@param rawSignature
The signature containing the type value.
@return The field signature. | [
"Return",
"a",
"field",
"signature",
"."
] | train | https://github.com/buschmais/jqa-java-plugin/blob/4c050943e9c28cf1c4a08aa962d5b5bf03c4fe54/src/main/java/com/buschmais/jqassistant/plugin/java/api/scanner/SignatureHelper.java#L94-L101 |
CloudBees-community/syslog-java-client | src/main/java/com/cloudbees/syslog/integration/jul/util/LogManagerHelper.java | LogManagerHelper.getFilterProperty | @Nullable
public static Filter getFilterProperty(@Nonnull LogManager manager, @Nullable String name, @Nullable Filter defaultValue) {
"""
Visible version of {@link java.util.logging.LogManager#getFilterProperty(String, java.util.logging.Filter)}.
We return an instance of the class named by the "name" proper... | java | @Nullable
public static Filter getFilterProperty(@Nonnull LogManager manager, @Nullable String name, @Nullable Filter defaultValue) {
if (name == null) {
return defaultValue;
}
String val = manager.getProperty(name);
try {
if (val != null) {
Cl... | [
"@",
"Nullable",
"public",
"static",
"Filter",
"getFilterProperty",
"(",
"@",
"Nonnull",
"LogManager",
"manager",
",",
"@",
"Nullable",
"String",
"name",
",",
"@",
"Nullable",
"Filter",
"defaultValue",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"... | Visible version of {@link java.util.logging.LogManager#getFilterProperty(String, java.util.logging.Filter)}.
We return an instance of the class named by the "name" property.
If the property is not defined or has problems we return the defaultValue. | [
"Visible",
"version",
"of",
"{",
"@link",
"java",
".",
"util",
".",
"logging",
".",
"LogManager#getFilterProperty",
"(",
"String",
"java",
".",
"util",
".",
"logging",
".",
"Filter",
")",
"}",
"."
] | train | https://github.com/CloudBees-community/syslog-java-client/blob/41e01206e4ce17c6d225ffb443bf19792a3f3c3a/src/main/java/com/cloudbees/syslog/integration/jul/util/LogManagerHelper.java#L64-L82 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Normalizer2Impl.java | Normalizer2Impl.getCanonStartSet | public boolean getCanonStartSet(int c, UnicodeSet set) {
"""
Returns true if there are characters whose decomposition starts with c.
If so, then the set is cleared and then filled with those characters.
<b>{@link #ensureCanonIterData()} must have been called before this method,
or else this method will crash.</... | java | public boolean getCanonStartSet(int c, UnicodeSet set) {
int canonValue=canonIterData.get(c)&~CANON_NOT_SEGMENT_STARTER;
if(canonValue==0) {
return false;
}
set.clear();
int value=canonValue&CANON_VALUE_MASK;
if((canonValue&CANON_HAS_SET)!=0) {
set... | [
"public",
"boolean",
"getCanonStartSet",
"(",
"int",
"c",
",",
"UnicodeSet",
"set",
")",
"{",
"int",
"canonValue",
"=",
"canonIterData",
".",
"get",
"(",
"c",
")",
"&",
"~",
"CANON_NOT_SEGMENT_STARTER",
";",
"if",
"(",
"canonValue",
"==",
"0",
")",
"{",
... | Returns true if there are characters whose decomposition starts with c.
If so, then the set is cleared and then filled with those characters.
<b>{@link #ensureCanonIterData()} must have been called before this method,
or else this method will crash.</b>
@param c A Unicode code point.
@param set A UnicodeSet to receive ... | [
"Returns",
"true",
"if",
"there",
"are",
"characters",
"whose",
"decomposition",
"starts",
"with",
"c",
".",
"If",
"so",
"then",
"the",
"set",
"is",
"cleared",
"and",
"then",
"filled",
"with",
"those",
"characters",
".",
"<b",
">",
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Normalizer2Impl.java#L859-L881 |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/ReadStreamOld.java | ReadStreamOld.writeToStream | public void writeToStream(OutputStream os, int len)
throws IOException {
"""
Writes <code>len<code> bytes to the output stream from this stream.
@param os destination stream.
@param len bytes to write.
"""
while (len > 0) {
if (_readLength <= _readOffset) {
if (! readBuffer())
... | java | public void writeToStream(OutputStream os, int len)
throws IOException
{
while (len > 0) {
if (_readLength <= _readOffset) {
if (! readBuffer())
return;
}
int sublen = Math.min(len, _readLength - _readOffset);
os.write(_readBuffer, _readOffset, sublen);
_readO... | [
"public",
"void",
"writeToStream",
"(",
"OutputStream",
"os",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"while",
"(",
"len",
">",
"0",
")",
"{",
"if",
"(",
"_readLength",
"<=",
"_readOffset",
")",
"{",
"if",
"(",
"!",
"readBuffer",
"(",
")"... | Writes <code>len<code> bytes to the output stream from this stream.
@param os destination stream.
@param len bytes to write. | [
"Writes",
"<code",
">",
"len<code",
">",
"bytes",
"to",
"the",
"output",
"stream",
"from",
"this",
"stream",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/ReadStreamOld.java#L1072-L1087 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/FailoverGroupsInner.java | FailoverGroupsInner.forceFailoverAllowDataLossAsync | public Observable<FailoverGroupInner> forceFailoverAllowDataLossAsync(String resourceGroupName, String serverName, String failoverGroupName) {
"""
Fails over from the current primary server to this server. This operation might result in data loss.
@param resourceGroupName The name of the resource group that con... | java | public Observable<FailoverGroupInner> forceFailoverAllowDataLossAsync(String resourceGroupName, String serverName, String failoverGroupName) {
return forceFailoverAllowDataLossWithServiceResponseAsync(resourceGroupName, serverName, failoverGroupName).map(new Func1<ServiceResponse<FailoverGroupInner>, FailoverGr... | [
"public",
"Observable",
"<",
"FailoverGroupInner",
">",
"forceFailoverAllowDataLossAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"failoverGroupName",
")",
"{",
"return",
"forceFailoverAllowDataLossWithServiceResponseAsync",
"(",
"reso... | Fails over from the current primary server to this server. This operation might result in data loss.
@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 serverName The name of the server containing the f... | [
"Fails",
"over",
"from",
"the",
"current",
"primary",
"server",
"to",
"this",
"server",
".",
"This",
"operation",
"might",
"result",
"in",
"data",
"loss",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/FailoverGroupsInner.java#L1087-L1094 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/copy/CopyManager.java | CopyManager.copyIn | public long copyIn(final String sql, Reader from, int bufferSize)
throws SQLException, IOException {
"""
Use COPY FROM STDIN for very fast copying from a Reader into a database table.
@param sql COPY FROM STDIN statement
@param from a CSV file or such
@param bufferSize number of characters to buffer and... | java | public long copyIn(final String sql, Reader from, int bufferSize)
throws SQLException, IOException {
char[] cbuf = new char[bufferSize];
int len;
CopyIn cp = copyIn(sql);
try {
while ((len = from.read(cbuf)) >= 0) {
if (len > 0) {
byte[] buf = encoding.encode(new String(cbu... | [
"public",
"long",
"copyIn",
"(",
"final",
"String",
"sql",
",",
"Reader",
"from",
",",
"int",
"bufferSize",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"char",
"[",
"]",
"cbuf",
"=",
"new",
"char",
"[",
"bufferSize",
"]",
";",
"int",
"len",
... | Use COPY FROM STDIN for very fast copying from a Reader into a database table.
@param sql COPY FROM STDIN statement
@param from a CSV file or such
@param bufferSize number of characters to buffer and push over network to server at once
@return number of rows updated for server 8.2 or newer; -1 for older
@throws SQLExc... | [
"Use",
"COPY",
"FROM",
"STDIN",
"for",
"very",
"fast",
"copying",
"from",
"a",
"Reader",
"into",
"a",
"database",
"table",
"."
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/copy/CopyManager.java#L169-L187 |
ZuInnoTe/hadoopcryptoledger | hiveudf/src/main/java/org/zuinnote/hadoop/bitcoin/hive/udf/BitcoinTransactionHashSegwitUDF.java | BitcoinTransactionHashSegwitUDF.readListOfBitcoinScriptWitnessFromTable | private List<BitcoinScriptWitnessItem> readListOfBitcoinScriptWitnessFromTable(ListObjectInspector loi, Object listOfScriptWitnessItemObject) {
"""
Read list of Bitcoin ScriptWitness items from a table in Hive in any format (e.g. ORC, Parquet)
@param loi ObjectInspector for processing the Object containing a li... | java | private List<BitcoinScriptWitnessItem> readListOfBitcoinScriptWitnessFromTable(ListObjectInspector loi, Object listOfScriptWitnessItemObject) {
int listLength=loi.getListLength(listOfScriptWitnessItemObject);
List<BitcoinScriptWitnessItem> result = new ArrayList<>(listLength);
StructObjectInspector listOfScriptwitnessI... | [
"private",
"List",
"<",
"BitcoinScriptWitnessItem",
">",
"readListOfBitcoinScriptWitnessFromTable",
"(",
"ListObjectInspector",
"loi",
",",
"Object",
"listOfScriptWitnessItemObject",
")",
"{",
"int",
"listLength",
"=",
"loi",
".",
"getListLength",
"(",
"listOfScriptWitnessI... | Read list of Bitcoin ScriptWitness items from a table in Hive in any format (e.g. ORC, Parquet)
@param loi ObjectInspector for processing the Object containing a list
@param listOfScriptWitnessItemObject object containing the list of scriptwitnessitems of a Bitcoin Transaction
@return a list of BitcoinScriptWitnessIt... | [
"Read",
"list",
"of",
"Bitcoin",
"ScriptWitness",
"items",
"from",
"a",
"table",
"in",
"Hive",
"in",
"any",
"format",
"(",
"e",
".",
"g",
".",
"ORC",
"Parquet",
")"
] | train | https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/hiveudf/src/main/java/org/zuinnote/hadoop/bitcoin/hive/udf/BitcoinTransactionHashSegwitUDF.java#L274-L311 |
javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MPdfWriter.java | MPdfWriter.print | @Override
public void print(final MBasicTable table, final OutputStream out) throws IOException {
"""
Lance l'impression (Méthode abstraite assurant le polymorphisme des instances.).
@param table
MBasicTable
@param out
OutputStream
@throws IOException
Erreur disque
"""
writePdf(table, out);
} | java | @Override
public void print(final MBasicTable table, final OutputStream out) throws IOException {
writePdf(table, out);
} | [
"@",
"Override",
"public",
"void",
"print",
"(",
"final",
"MBasicTable",
"table",
",",
"final",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"writePdf",
"(",
"table",
",",
"out",
")",
";",
"}"
] | Lance l'impression (Méthode abstraite assurant le polymorphisme des instances.).
@param table
MBasicTable
@param out
OutputStream
@throws IOException
Erreur disque | [
"Lance",
"l",
"impression",
"(",
"Méthode",
"abstraite",
"assurant",
"le",
"polymorphisme",
"des",
"instances",
".",
")",
"."
] | train | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MPdfWriter.java#L108-L111 |
aalmiray/Json-lib | src/main/java/net/sf/json/JsonConfig.java | JsonConfig.unregisterJsonValueProcessor | public void unregisterJsonValueProcessor( Class beanClass, Class propertyType ) {
"""
Removes a JsonValueProcessor.<br>
[Java -> JSON]
@param beanClass the class to which the property may belong
@param propertyType the type of the property
"""
if( beanClass != null && propertyType != null ) {
... | java | public void unregisterJsonValueProcessor( Class beanClass, Class propertyType ) {
if( beanClass != null && propertyType != null ) {
beanTypeMap.remove( beanClass, propertyType );
}
} | [
"public",
"void",
"unregisterJsonValueProcessor",
"(",
"Class",
"beanClass",
",",
"Class",
"propertyType",
")",
"{",
"if",
"(",
"beanClass",
"!=",
"null",
"&&",
"propertyType",
"!=",
"null",
")",
"{",
"beanTypeMap",
".",
"remove",
"(",
"beanClass",
",",
"prope... | Removes a JsonValueProcessor.<br>
[Java -> JSON]
@param beanClass the class to which the property may belong
@param propertyType the type of the property | [
"Removes",
"a",
"JsonValueProcessor",
".",
"<br",
">",
"[",
"Java",
"-",
">",
";",
"JSON",
"]"
] | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JsonConfig.java#L1365-L1369 |
NordicSemiconductor/Android-DFU-Library | dfu/src/main/java/no/nordicsemi/android/dfu/BaseDfuImpl.java | BaseDfuImpl.restartService | void restartService(@NonNull final Intent intent, final boolean scanForBootloader) {
"""
Restarts the service based on the given intent. If parameter set this method will also scan for
an advertising bootloader that has address equal or incremented by 1 to the current one.
@param intent the intent t... | java | void restartService(@NonNull final Intent intent, final boolean scanForBootloader) {
String newAddress = null;
if (scanForBootloader) {
mService.sendLogBroadcast(DfuBaseService.LOG_LEVEL_VERBOSE, "Scanning for the DFU Bootloader...");
newAddress = BootloaderScannerFactory.getScanner().searchFor(mGatt.getDevic... | [
"void",
"restartService",
"(",
"@",
"NonNull",
"final",
"Intent",
"intent",
",",
"final",
"boolean",
"scanForBootloader",
")",
"{",
"String",
"newAddress",
"=",
"null",
";",
"if",
"(",
"scanForBootloader",
")",
"{",
"mService",
".",
"sendLogBroadcast",
"(",
"D... | Restarts the service based on the given intent. If parameter set this method will also scan for
an advertising bootloader that has address equal or incremented by 1 to the current one.
@param intent the intent to be started as a service
@param scanForBootloader true to scan for advertising bootloader, false... | [
"Restarts",
"the",
"service",
"based",
"on",
"the",
"given",
"intent",
".",
"If",
"parameter",
"set",
"this",
"method",
"will",
"also",
"scan",
"for",
"an",
"advertising",
"bootloader",
"that",
"has",
"address",
"equal",
"or",
"incremented",
"by",
"1",
"to",... | train | https://github.com/NordicSemiconductor/Android-DFU-Library/blob/ec14c8c522bebe801a9a4c3dfbbeb1f53262c03f/dfu/src/main/java/no/nordicsemi/android/dfu/BaseDfuImpl.java#L742-L762 |
tango-controls/JTango | server/src/main/java/org/tango/server/servant/DeviceImpl.java | DeviceImpl.command_inout_history_4 | @Override
public DevCmdHistory_4 command_inout_history_4(final String commandName, final int maxSize) throws DevFailed {
"""
Command history. IDL 4 version.
@param commandName the command name
@param maxSize the maximum depth of history
@return the history
@throws DevFailed
"""
MDC.setCon... | java | @Override
public DevCmdHistory_4 command_inout_history_4(final String commandName, final int maxSize) throws DevFailed {
MDC.setContextMap(contextMap);
xlogger.entry();
checkInitialization();
final long request = deviceMonitoring.startRequest("command_inout_history_4 " + commandName)... | [
"@",
"Override",
"public",
"DevCmdHistory_4",
"command_inout_history_4",
"(",
"final",
"String",
"commandName",
",",
"final",
"int",
"maxSize",
")",
"throws",
"DevFailed",
"{",
"MDC",
".",
"setContextMap",
"(",
"contextMap",
")",
";",
"xlogger",
".",
"entry",
"(... | Command history. IDL 4 version.
@param commandName the command name
@param maxSize the maximum depth of history
@return the history
@throws DevFailed | [
"Command",
"history",
".",
"IDL",
"4",
"version",
"."
] | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L1699-L1723 |
fuzzylite/jfuzzylite | jfuzzylite/src/main/java/com/fuzzylite/factory/DefuzzifierFactory.java | DefuzzifierFactory.constrDefuzzifier | public Defuzzifier constrDefuzzifier(String key, WeightedDefuzzifier.Type type) {
"""
Creates a Defuzzifier by executing the registered constructor
@param key is the unique name by which constructors are registered
@param type is the type of a WeightedDefuzzifier
@return a Defuzzifier by executing the registe... | java | public Defuzzifier constrDefuzzifier(String key, WeightedDefuzzifier.Type type) {
Defuzzifier result = constructObject(key);
if (result instanceof WeightedDefuzzifier) {
((WeightedDefuzzifier) result).setType(type);
}
return result;
} | [
"public",
"Defuzzifier",
"constrDefuzzifier",
"(",
"String",
"key",
",",
"WeightedDefuzzifier",
".",
"Type",
"type",
")",
"{",
"Defuzzifier",
"result",
"=",
"constructObject",
"(",
"key",
")",
";",
"if",
"(",
"result",
"instanceof",
"WeightedDefuzzifier",
")",
"... | Creates a Defuzzifier by executing the registered constructor
@param key is the unique name by which constructors are registered
@param type is the type of a WeightedDefuzzifier
@return a Defuzzifier by executing the registered constructor and setting
its type | [
"Creates",
"a",
"Defuzzifier",
"by",
"executing",
"the",
"registered",
"constructor"
] | train | https://github.com/fuzzylite/jfuzzylite/blob/583ac1928f39512af75de80d560e67448039595a/jfuzzylite/src/main/java/com/fuzzylite/factory/DefuzzifierFactory.java#L97-L103 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Channel.java | Channel.registerBlockListener | public String registerBlockListener(BlockingQueue<QueuedBlockEvent> blockEventQueue) throws InvalidArgumentException {
"""
Register a Queued block listener. This queue should never block insertion of events.
@param blockEventQueue the queue
@return return a handle to ungregister the handler.
@throws InvalidAr... | java | public String registerBlockListener(BlockingQueue<QueuedBlockEvent> blockEventQueue) throws InvalidArgumentException {
if (shutdown) {
throw new InvalidArgumentException(format("Channel %s has been shutdown.", name));
}
if (null == blockEventQueue) {
throw new InvalidAr... | [
"public",
"String",
"registerBlockListener",
"(",
"BlockingQueue",
"<",
"QueuedBlockEvent",
">",
"blockEventQueue",
")",
"throws",
"InvalidArgumentException",
"{",
"if",
"(",
"shutdown",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"format",
"(",
"\"Chan... | Register a Queued block listener. This queue should never block insertion of events.
@param blockEventQueue the queue
@return return a handle to ungregister the handler.
@throws InvalidArgumentException | [
"Register",
"a",
"Queued",
"block",
"listener",
".",
"This",
"queue",
"should",
"never",
"block",
"insertion",
"of",
"events",
"."
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L5515-L5531 |
atomix/atomix | utils/src/main/java/io/atomix/utils/logging/ContextualLoggerFactory.java | ContextualLoggerFactory.getLogger | public static ContextualLogger getLogger(String name, LoggerContext context) {
"""
Returns a contextual logger.
@param name the contextual logger name
@param context the logger context
@return the logger
"""
return new ContextualLogger(LoggerFactory.getLogger(name), context);
} | java | public static ContextualLogger getLogger(String name, LoggerContext context) {
return new ContextualLogger(LoggerFactory.getLogger(name), context);
} | [
"public",
"static",
"ContextualLogger",
"getLogger",
"(",
"String",
"name",
",",
"LoggerContext",
"context",
")",
"{",
"return",
"new",
"ContextualLogger",
"(",
"LoggerFactory",
".",
"getLogger",
"(",
"name",
")",
",",
"context",
")",
";",
"}"
] | Returns a contextual logger.
@param name the contextual logger name
@param context the logger context
@return the logger | [
"Returns",
"a",
"contextual",
"logger",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/utils/src/main/java/io/atomix/utils/logging/ContextualLoggerFactory.java#L32-L34 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/security/MessageDigestUtils.java | MessageDigestUtils.computeSha256 | public static byte[] computeSha256(final byte[] data) {
"""
Calculate the message digest value with SHA 256 algorithm.
@param data to calculate.
@return message digest value.
"""
try {
return MessageDigest.getInstance(ALGORITHM_SHA_256).digest(data);
} catch (NoSuchAlgorithmExcept... | java | public static byte[] computeSha256(final byte[] data) {
try {
return MessageDigest.getInstance(ALGORITHM_SHA_256).digest(data);
} catch (NoSuchAlgorithmException e) {
throw new IllegalStateException("unsupported algorithm for message digest: ", e);
}
} | [
"public",
"static",
"byte",
"[",
"]",
"computeSha256",
"(",
"final",
"byte",
"[",
"]",
"data",
")",
"{",
"try",
"{",
"return",
"MessageDigest",
".",
"getInstance",
"(",
"ALGORITHM_SHA_256",
")",
".",
"digest",
"(",
"data",
")",
";",
"}",
"catch",
"(",
... | Calculate the message digest value with SHA 256 algorithm.
@param data to calculate.
@return message digest value. | [
"Calculate",
"the",
"message",
"digest",
"value",
"with",
"SHA",
"256",
"algorithm",
"."
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/security/MessageDigestUtils.java#L38-L44 |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kraken/query/NotifyQuery.java | NotifyQuery.exec | @Override
public void exec(Result<Object> result, Object[] args) {
"""
/*
@Override
public int partitionHash(Object[] args)
{
if (_keyExpr == null) {
return -1;
}
return _keyExpr.partitionHash(args);
}
"""
TableKelp tableKelp = _table.getTableKelp();
RowCursor minCursor = tableKelp.cur... | java | @Override
public void exec(Result<Object> result, Object[] args)
{
TableKelp tableKelp = _table.getTableKelp();
RowCursor minCursor = tableKelp.cursor();
RowCursor maxCursor = tableKelp.cursor();
minCursor.clear();
maxCursor.setKeyMax();
_whereKraken.fillMinCursor(minCursor, a... | [
"@",
"Override",
"public",
"void",
"exec",
"(",
"Result",
"<",
"Object",
">",
"result",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"TableKelp",
"tableKelp",
"=",
"_table",
".",
"getTableKelp",
"(",
")",
";",
"RowCursor",
"minCursor",
"=",
"tableKelp",
".... | /*
@Override
public int partitionHash(Object[] args)
{
if (_keyExpr == null) {
return -1;
}
return _keyExpr.partitionHash(args);
} | [
"/",
"*",
"@Override",
"public",
"int",
"partitionHash",
"(",
"Object",
"[]",
"args",
")",
"{",
"if",
"(",
"_keyExpr",
"==",
"null",
")",
"{",
"return",
"-",
"1",
";",
"}"
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kraken/query/NotifyQuery.java#L89-L115 |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.displaySystem | protected void displaySystem (String bundle, String message, byte attLevel, String localtype) {
"""
Display the specified system message as if it had come from the server.
"""
// nothing should be untranslated, so pass the default bundle if need be.
if (bundle == null) {
bundle = _b... | java | protected void displaySystem (String bundle, String message, byte attLevel, String localtype)
{
// nothing should be untranslated, so pass the default bundle if need be.
if (bundle == null) {
bundle = _bundle;
}
SystemMessage msg = new SystemMessage(message, bundle, attLe... | [
"protected",
"void",
"displaySystem",
"(",
"String",
"bundle",
",",
"String",
"message",
",",
"byte",
"attLevel",
",",
"String",
"localtype",
")",
"{",
"// nothing should be untranslated, so pass the default bundle if need be.",
"if",
"(",
"bundle",
"==",
"null",
")",
... | Display the specified system message as if it had come from the server. | [
"Display",
"the",
"specified",
"system",
"message",
"as",
"if",
"it",
"had",
"come",
"from",
"the",
"server",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L1085-L1093 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/SimpleDateFormat.java | SimpleDateFormat.parseInt | private Number parseInt(String text,
ParsePosition pos,
boolean allowNegative,
NumberFormat fmt) {
"""
Parse an integer using numberFormat. This method is semantically
const, but actually may modify fNumberFormat.
"""
... | java | private Number parseInt(String text,
ParsePosition pos,
boolean allowNegative,
NumberFormat fmt) {
return parseInt(text, -1, pos, allowNegative, fmt);
} | [
"private",
"Number",
"parseInt",
"(",
"String",
"text",
",",
"ParsePosition",
"pos",
",",
"boolean",
"allowNegative",
",",
"NumberFormat",
"fmt",
")",
"{",
"return",
"parseInt",
"(",
"text",
",",
"-",
"1",
",",
"pos",
",",
"allowNegative",
",",
"fmt",
")",... | Parse an integer using numberFormat. This method is semantically
const, but actually may modify fNumberFormat. | [
"Parse",
"an",
"integer",
"using",
"numberFormat",
".",
"This",
"method",
"is",
"semantically",
"const",
"but",
"actually",
"may",
"modify",
"fNumberFormat",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/SimpleDateFormat.java#L3720-L3725 |
haifengl/smile | plot/src/main/java/smile/plot/Graphics.java | Graphics.fillPolygon | public void fillPolygon(float alpha, double[]... coord) {
"""
Fill polygon. The coordinates are in logical coordinates. This also supports
basic alpha compositing rules for combining source and destination
colors to achieve blending and transparency effects with graphics and images.
@param alpha the constant ... | java | public void fillPolygon(float alpha, double[]... coord) {
int[][] c = new int[coord.length][2];
for (int i = 0; i < coord.length; i++) {
c[i] = projection.screenProjection(coord[i]);
}
int[] x = new int[c.length];
for (int i = 0; i < c.length; i++) {
x[i]... | [
"public",
"void",
"fillPolygon",
"(",
"float",
"alpha",
",",
"double",
"[",
"]",
"...",
"coord",
")",
"{",
"int",
"[",
"]",
"[",
"]",
"c",
"=",
"new",
"int",
"[",
"coord",
".",
"length",
"]",
"[",
"2",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"... | Fill polygon. The coordinates are in logical coordinates. This also supports
basic alpha compositing rules for combining source and destination
colors to achieve blending and transparency effects with graphics and images.
@param alpha the constant alpha to be multiplied with the alpha of the
source. alpha must be a fl... | [
"Fill",
"polygon",
".",
"The",
"coordinates",
"are",
"in",
"logical",
"coordinates",
".",
"This",
"also",
"supports",
"basic",
"alpha",
"compositing",
"rules",
"for",
"combining",
"source",
"and",
"destination",
"colors",
"to",
"achieve",
"blending",
"and",
"tra... | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/plot/src/main/java/smile/plot/Graphics.java#L492-L513 |
umeding/fuzzer | src/main/java/com/uwemeding/fuzzer/Program.java | Program.addExternalFunction | public ExternalFunction addExternalFunction(String name, String argumentName) {
"""
Add an external function.
<p>
@param name function name
@param argumentName the argument name
@return the function
"""
return addFunction(new ExternalFunction(name, argumentName));
} | java | public ExternalFunction addExternalFunction(String name, String argumentName) {
return addFunction(new ExternalFunction(name, argumentName));
} | [
"public",
"ExternalFunction",
"addExternalFunction",
"(",
"String",
"name",
",",
"String",
"argumentName",
")",
"{",
"return",
"addFunction",
"(",
"new",
"ExternalFunction",
"(",
"name",
",",
"argumentName",
")",
")",
";",
"}"
] | Add an external function.
<p>
@param name function name
@param argumentName the argument name
@return the function | [
"Add",
"an",
"external",
"function",
".",
"<p",
">"
] | train | https://github.com/umeding/fuzzer/blob/e8aa46313bb1d1328865f26f99455124aede828c/src/main/java/com/uwemeding/fuzzer/Program.java#L241-L243 |
apache/groovy | src/main/java/org/codehaus/groovy/syntax/Types.java | Types.makePrefix | public static void makePrefix(CSTNode node, boolean throwIfInvalid) {
"""
Converts a node from a generic type to a specific prefix type.
Throws a <code>GroovyBugError</code> if the type can't be converted
and requested.
"""
switch (node.getMeaning()) {
case PLUS:
node.set... | java | public static void makePrefix(CSTNode node, boolean throwIfInvalid) {
switch (node.getMeaning()) {
case PLUS:
node.setMeaning(PREFIX_PLUS);
break;
case MINUS:
node.setMeaning(PREFIX_MINUS);
break;
case PLUS_PL... | [
"public",
"static",
"void",
"makePrefix",
"(",
"CSTNode",
"node",
",",
"boolean",
"throwIfInvalid",
")",
"{",
"switch",
"(",
"node",
".",
"getMeaning",
"(",
")",
")",
"{",
"case",
"PLUS",
":",
"node",
".",
"setMeaning",
"(",
"PREFIX_PLUS",
")",
";",
"bre... | Converts a node from a generic type to a specific prefix type.
Throws a <code>GroovyBugError</code> if the type can't be converted
and requested. | [
"Converts",
"a",
"node",
"from",
"a",
"generic",
"type",
"to",
"a",
"specific",
"prefix",
"type",
".",
"Throws",
"a",
"<code",
">",
"GroovyBugError<",
"/",
"code",
">",
"if",
"the",
"type",
"can",
"t",
"be",
"converted",
"and",
"requested",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/syntax/Types.java#L855-L880 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.java | FileOutputCommitter.abortJob | @Override
public void abortJob(JobContext context, JobStatus.State state)
throws IOException {
"""
Delete the temporary directory, including all of the work directories.
@param context the job's context
@param state final run state of the job, should be FAILED or KILLED
"""
cleanupJob(context);
} | java | @Override
public void abortJob(JobContext context, JobStatus.State state)
throws IOException {
cleanupJob(context);
} | [
"@",
"Override",
"public",
"void",
"abortJob",
"(",
"JobContext",
"context",
",",
"JobStatus",
".",
"State",
"state",
")",
"throws",
"IOException",
"{",
"cleanupJob",
"(",
"context",
")",
";",
"}"
] | Delete the temporary directory, including all of the work directories.
@param context the job's context
@param state final run state of the job, should be FAILED or KILLED | [
"Delete",
"the",
"temporary",
"directory",
"including",
"all",
"of",
"the",
"work",
"directories",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.java#L141-L145 |
FitLayout/segmentation | src/main/java/org/fit/segm/grouping/AreaUtils.java | AreaUtils.isOnSameLine | public static boolean isOnSameLine(Area a1, Area a2, int threshold) {
"""
Checks if the given areas are on the same line.
@param a1
@param a2
@return
"""
final Rectangular gp1 = a1.getBounds();
final Rectangular gp2 = a2.getBounds();
return (Math.abs(gp1.getY1() - gp2.getY1()) <= thr... | java | public static boolean isOnSameLine(Area a1, Area a2, int threshold)
{
final Rectangular gp1 = a1.getBounds();
final Rectangular gp2 = a2.getBounds();
return (Math.abs(gp1.getY1() - gp2.getY1()) <= threshold
&& Math.abs(gp1.getY2() - gp2.getY2()) <= threshold);
} | [
"public",
"static",
"boolean",
"isOnSameLine",
"(",
"Area",
"a1",
",",
"Area",
"a2",
",",
"int",
"threshold",
")",
"{",
"final",
"Rectangular",
"gp1",
"=",
"a1",
".",
"getBounds",
"(",
")",
";",
"final",
"Rectangular",
"gp2",
"=",
"a2",
".",
"getBounds",... | Checks if the given areas are on the same line.
@param a1
@param a2
@return | [
"Checks",
"if",
"the",
"given",
"areas",
"are",
"on",
"the",
"same",
"line",
"."
] | train | https://github.com/FitLayout/segmentation/blob/12998087d576640c2f2a6360cf6088af95eea5f4/src/main/java/org/fit/segm/grouping/AreaUtils.java#L59-L65 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.readUser | public CmsUser readUser(CmsRequestContext context, String username, String password) throws CmsException {
"""
Returns a user object if the password for the user is correct.<p>
If the user/password pair is not valid a <code>{@link CmsException}</code> is thrown.<p>
@param context the current request context
... | java | public CmsUser readUser(CmsRequestContext context, String username, String password) throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
CmsUser result = null;
try {
result = m_driverManager.readUser(dbc, CmsOrganizationalUnit.removeLeadingSeparator(us... | [
"public",
"CmsUser",
"readUser",
"(",
"CmsRequestContext",
"context",
",",
"String",
"username",
",",
"String",
"password",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(",
"context",
")",
";",
"CmsUse... | Returns a user object if the password for the user is correct.<p>
If the user/password pair is not valid a <code>{@link CmsException}</code> is thrown.<p>
@param context the current request context
@param username the user name of the user that is to be read
@param password the password of the user that is to be read... | [
"Returns",
"a",
"user",
"object",
"if",
"the",
"password",
"for",
"the",
"user",
"is",
"correct",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L5523-L5535 |
kiswanij/jk-util | src/main/java/com/jk/util/validation/builtin/ValidationBundle.java | ValidationBundle.getMessage | public static String getMessage(final Class class1, final String string, final Object[] objects) {
"""
Gets the message.
@param class1 the class 1
@param string the string
@param objects the objects
@return the message
"""
return JKMessage.get(string, objects);
} | java | public static String getMessage(final Class class1, final String string, final Object[] objects) {
return JKMessage.get(string, objects);
} | [
"public",
"static",
"String",
"getMessage",
"(",
"final",
"Class",
"class1",
",",
"final",
"String",
"string",
",",
"final",
"Object",
"[",
"]",
"objects",
")",
"{",
"return",
"JKMessage",
".",
"get",
"(",
"string",
",",
"objects",
")",
";",
"}"
] | Gets the message.
@param class1 the class 1
@param string the string
@param objects the objects
@return the message | [
"Gets",
"the",
"message",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/validation/builtin/ValidationBundle.java#L49-L51 |
mpetazzoni/ttorrent | ttorrent-client/src/main/java/com/turn/ttorrent/client/CommunicationManager.java | CommunicationManager.addTorrent | public TorrentManager addTorrent(String dotTorrentFilePath,
String downloadDirPath,
PieceStorageFactory pieceStorageFactory,
List<TorrentListener> listeners) throws IOException {
"""
Adds torrent to storage wit... | java | public TorrentManager addTorrent(String dotTorrentFilePath,
String downloadDirPath,
PieceStorageFactory pieceStorageFactory,
List<TorrentListener> listeners) throws IOException {
FileMetadataProvider metadataPro... | [
"public",
"TorrentManager",
"addTorrent",
"(",
"String",
"dotTorrentFilePath",
",",
"String",
"downloadDirPath",
",",
"PieceStorageFactory",
"pieceStorageFactory",
",",
"List",
"<",
"TorrentListener",
">",
"listeners",
")",
"throws",
"IOException",
"{",
"FileMetadataProvi... | Adds torrent to storage with specified {@link PieceStorageFactory}.
It can be used for skipping initial validation of data
@param dotTorrentFilePath path to torrent metadata file
@param downloadDirPath path to directory where downloaded files are placed
@param pieceStorageFactory factory for creating {@link PieceSt... | [
"Adds",
"torrent",
"to",
"storage",
"with",
"specified",
"{",
"@link",
"PieceStorageFactory",
"}",
".",
"It",
"can",
"be",
"used",
"for",
"skipping",
"initial",
"validation",
"of",
"data"
] | train | https://github.com/mpetazzoni/ttorrent/blob/ecd0e6caf853b63393c4ab63cfd8f20114f73f70/ttorrent-client/src/main/java/com/turn/ttorrent/client/CommunicationManager.java#L172-L181 |
kiegroup/drools | drools-beliefs/src/main/java/org/drools/beliefs/bayes/BayesInstance.java | BayesInstance.passMessage | public void passMessage( JunctionTreeClique sourceClique, JunctionTreeSeparator sep, JunctionTreeClique targetClique) {
"""
Passes a message from node1 to node2.
node1 projects its trgPotentials into the separator.
node2 then absorbs those trgPotentials from the separator.
@param sourceClique
@param sep
@para... | java | public void passMessage( JunctionTreeClique sourceClique, JunctionTreeSeparator sep, JunctionTreeClique targetClique) {
double[] sepPots = separatorStates[sep.getId()].getPotentials();
double[] oldSepPots = Arrays.copyOf(sepPots, sepPots.length);
BayesVariable[] sepVars = sep.getValues().toArra... | [
"public",
"void",
"passMessage",
"(",
"JunctionTreeClique",
"sourceClique",
",",
"JunctionTreeSeparator",
"sep",
",",
"JunctionTreeClique",
"targetClique",
")",
"{",
"double",
"[",
"]",
"sepPots",
"=",
"separatorStates",
"[",
"sep",
".",
"getId",
"(",
")",
"]",
... | Passes a message from node1 to node2.
node1 projects its trgPotentials into the separator.
node2 then absorbs those trgPotentials from the separator.
@param sourceClique
@param sep
@param targetClique | [
"Passes",
"a",
"message",
"from",
"node1",
"to",
"node2",
".",
"node1",
"projects",
"its",
"trgPotentials",
"into",
"the",
"separator",
".",
"node2",
"then",
"absorbs",
"those",
"trgPotentials",
"from",
"the",
"separator",
"."
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-beliefs/src/main/java/org/drools/beliefs/bayes/BayesInstance.java#L368-L387 |
google/closure-compiler | src/com/google/javascript/jscomp/AbstractCompiler.java | AbstractCompiler.setAnnotation | void setAnnotation(String key, Object object) {
"""
Sets an annotation for the given key.
@param key the annotation key
@param object the object to store as the annotation
"""
checkArgument(object != null, "The stored annotation value cannot be null.");
Preconditions.checkArgument(
!annotat... | java | void setAnnotation(String key, Object object) {
checkArgument(object != null, "The stored annotation value cannot be null.");
Preconditions.checkArgument(
!annotationMap.containsKey(key), "Cannot overwrite the existing annotation '%s'.", key);
annotationMap.put(key, object);
} | [
"void",
"setAnnotation",
"(",
"String",
"key",
",",
"Object",
"object",
")",
"{",
"checkArgument",
"(",
"object",
"!=",
"null",
",",
"\"The stored annotation value cannot be null.\"",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"!",
"annotationMap",
".",
... | Sets an annotation for the given key.
@param key the annotation key
@param object the object to store as the annotation | [
"Sets",
"an",
"annotation",
"for",
"the",
"given",
"key",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCompiler.java#L688-L693 |
astrapi69/jaulp-wicket | jaulp-wicket-dialogs/src/main/java/de/alpharogroup/wicket/dialogs/panels/info/InfoPanel.java | InfoPanel.newCloseButton | protected AjaxButton newCloseButton(final String id) {
"""
Factory method for creating a new no {@link AjaxButton}. This method is invoked in the
constructor from the derived classes and can be overridden so users can provide their own
version of a no {@link AjaxButton}.
@param id
the id
@return the new {@l... | java | protected AjaxButton newCloseButton(final String id)
{
final AjaxButton ajaxButton = new AjaxButton(id)
{
/**
* The serialVersionUID.
*/
private static final long serialVersionUID = 1L;
/**
* {@inheritDoc}
*/
@Override
protected void onError(final AjaxRequestTarget target, final For... | [
"protected",
"AjaxButton",
"newCloseButton",
"(",
"final",
"String",
"id",
")",
"{",
"final",
"AjaxButton",
"ajaxButton",
"=",
"new",
"AjaxButton",
"(",
"id",
")",
"{",
"/**\n\t\t\t * The serialVersionUID.\n\t\t\t */",
"private",
"static",
"final",
"long",
"serialVers... | Factory method for creating a new no {@link AjaxButton}. This method is invoked in the
constructor from the derived classes and can be overridden so users can provide their own
version of a no {@link AjaxButton}.
@param id
the id
@return the new {@link AjaxButton} | [
"Factory",
"method",
"for",
"creating",
"a",
"new",
"no",
"{",
"@link",
"AjaxButton",
"}",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
"pro... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-dialogs/src/main/java/de/alpharogroup/wicket/dialogs/panels/info/InfoPanel.java#L73-L104 |
RestComm/sip-servlets | sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/message/SipServletRequestImpl.java | SipServletRequestImpl.pushRoute | private void pushRoute(javax.sip.address.SipURI sipUri) {
"""
Pushes a route header on initial request based on the jain sip sipUri given on parameter
@param sipUri the jain sip sip uri to use to construct the route header to push on the request
"""
if(!isInitial() && getSipSession().getProxy() == null) {
... | java | private void pushRoute(javax.sip.address.SipURI sipUri) {
if(!isInitial() && getSipSession().getProxy() == null) {
//as per JSR 289 Section 11.1.3 Pushing Route Header Field Values
// pushRoute can only be done on the initial requests.
// Subsequent requests within a dialog follow the route set.
// Any at... | [
"private",
"void",
"pushRoute",
"(",
"javax",
".",
"sip",
".",
"address",
".",
"SipURI",
"sipUri",
")",
"{",
"if",
"(",
"!",
"isInitial",
"(",
")",
"&&",
"getSipSession",
"(",
")",
".",
"getProxy",
"(",
")",
"==",
"null",
")",
"{",
"//as per JSR 289 Se... | Pushes a route header on initial request based on the jain sip sipUri given on parameter
@param sipUri the jain sip sip uri to use to construct the route header to push on the request | [
"Pushes",
"a",
"route",
"header",
"on",
"initial",
"request",
"based",
"on",
"the",
"jain",
"sip",
"sipUri",
"given",
"on",
"parameter"
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/message/SipServletRequestImpl.java#L686-L709 |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java | MercatorProjection.longitudeToPixelX | public static double longitudeToPixelX(double longitude, byte zoomLevel, int tileSize) {
"""
Converts a longitude coordinate (in degrees) to a pixel X coordinate at a certain zoom level.
@param longitude the longitude coordinate that should be converted.
@param zoomLevel the zoom level at which the coordinate ... | java | public static double longitudeToPixelX(double longitude, byte zoomLevel, int tileSize) {
long mapSize = getMapSize(zoomLevel, tileSize);
return (longitude + 180) / 360 * mapSize;
} | [
"public",
"static",
"double",
"longitudeToPixelX",
"(",
"double",
"longitude",
",",
"byte",
"zoomLevel",
",",
"int",
"tileSize",
")",
"{",
"long",
"mapSize",
"=",
"getMapSize",
"(",
"zoomLevel",
",",
"tileSize",
")",
";",
"return",
"(",
"longitude",
"+",
"18... | Converts a longitude coordinate (in degrees) to a pixel X coordinate at a certain zoom level.
@param longitude the longitude coordinate that should be converted.
@param zoomLevel the zoom level at which the coordinate should be converted.
@param tileSize the tile size
@return the pixel X coordinate of the longitude v... | [
"Converts",
"a",
"longitude",
"coordinate",
"(",
"in",
"degrees",
")",
"to",
"a",
"pixel",
"X",
"coordinate",
"at",
"a",
"certain",
"zoom",
"level",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java#L266-L269 |
google/error-prone-javac | src/jdk.jshell/share/classes/jdk/jshell/execution/JdiInitiator.java | JdiInitiator.listenTarget | private VirtualMachine listenTarget(int port, List<String> remoteVMOptions) {
"""
Directly launch the remote agent and connect JDI to it with a
ListeningConnector.
"""
ListeningConnector listener = (ListeningConnector) connector;
// Files to collection to output of a start-up failure
F... | java | private VirtualMachine listenTarget(int port, List<String> remoteVMOptions) {
ListeningConnector listener = (ListeningConnector) connector;
// Files to collection to output of a start-up failure
File crashErrorFile = createTempFile("error");
File crashOutputFile = createTempFile("output"... | [
"private",
"VirtualMachine",
"listenTarget",
"(",
"int",
"port",
",",
"List",
"<",
"String",
">",
"remoteVMOptions",
")",
"{",
"ListeningConnector",
"listener",
"=",
"(",
"ListeningConnector",
")",
"connector",
";",
"// Files to collection to output of a start-up failure"... | Directly launch the remote agent and connect JDI to it with a
ListeningConnector. | [
"Directly",
"launch",
"the",
"remote",
"agent",
"and",
"connect",
"JDI",
"to",
"it",
"with",
"a",
"ListeningConnector",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiInitiator.java#L149-L204 |
drinkjava2/jBeanBox | jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckClassAdapter.java | CheckClassAdapter.verify | public static void verify(final ClassReader cr, final ClassLoader loader,
final boolean dump, final PrintWriter pw) {
"""
Checks a given class.
@param cr
a <code>ClassReader</code> that contains bytecode for the
analysis.
@param loader
a <code>ClassLoader</code> which will be used to load
refer... | java | public static void verify(final ClassReader cr, final ClassLoader loader,
final boolean dump, final PrintWriter pw) {
ClassNode cn = new ClassNode();
cr.accept(new CheckClassAdapter(cn, false), ClassReader.SKIP_DEBUG);
Type syperType = cn.superName == null ? null : Type
... | [
"public",
"static",
"void",
"verify",
"(",
"final",
"ClassReader",
"cr",
",",
"final",
"ClassLoader",
"loader",
",",
"final",
"boolean",
"dump",
",",
"final",
"PrintWriter",
"pw",
")",
"{",
"ClassNode",
"cn",
"=",
"new",
"ClassNode",
"(",
")",
";",
"cr",
... | Checks a given class.
@param cr
a <code>ClassReader</code> that contains bytecode for the
analysis.
@param loader
a <code>ClassLoader</code> which will be used to load
referenced classes. This is useful if you are verifiying
multiple interdependent classes.
@param dump
true if bytecode should be printed out not only w... | [
"Checks",
"a",
"given",
"class",
"."
] | train | https://github.com/drinkjava2/jBeanBox/blob/01c216599ffa2e5f2d9c01df2adaad0f45567c04/jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckClassAdapter.java#L209-L243 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.deposit_depositId_payment_GET | public OvhPayment deposit_depositId_payment_GET(String depositId) throws IOException {
"""
Get this object properties
REST: GET /me/deposit/{depositId}/payment
@param depositId [required]
"""
String qPath = "/me/deposit/{depositId}/payment";
StringBuilder sb = path(qPath, depositId);
String resp = ex... | java | public OvhPayment deposit_depositId_payment_GET(String depositId) throws IOException {
String qPath = "/me/deposit/{depositId}/payment";
StringBuilder sb = path(qPath, depositId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhPayment.class);
} | [
"public",
"OvhPayment",
"deposit_depositId_payment_GET",
"(",
"String",
"depositId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/deposit/{depositId}/payment\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"depositId",
")",
";",
... | Get this object properties
REST: GET /me/deposit/{depositId}/payment
@param depositId [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L3304-L3309 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/log/Log.java | Log.enableSubsystem | public static void enableSubsystem(ISubsystem subsystem, boolean enable) {
"""
Enable/disable the logging component
@param subsystem The logging component
@param enable true - to enable it, false - to disable it
"""
if (enable_logging) {
if (enable) {
mEnabledSubsystems.ad... | java | public static void enableSubsystem(ISubsystem subsystem, boolean enable) {
if (enable_logging) {
if (enable) {
mEnabledSubsystems.add(subsystem);
} else {
mEnabledSubsystems.remove(subsystem);
}
}
} | [
"public",
"static",
"void",
"enableSubsystem",
"(",
"ISubsystem",
"subsystem",
",",
"boolean",
"enable",
")",
"{",
"if",
"(",
"enable_logging",
")",
"{",
"if",
"(",
"enable",
")",
"{",
"mEnabledSubsystems",
".",
"add",
"(",
"subsystem",
")",
";",
"}",
"els... | Enable/disable the logging component
@param subsystem The logging component
@param enable true - to enable it, false - to disable it | [
"Enable",
"/",
"disable",
"the",
"logging",
"component"
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/log/Log.java#L136-L144 |
haifengl/smile | core/src/main/java/smile/association/ARM.java | ARM.getPowerSet | private static int getPowerSet(int[] set, int inputIndex, int[] sofar, int[][] sets, int outputIndex) {
"""
Recursively calculates all possible subsets.
@param set the input item set.
@param inputIndex the index within the input set marking current
element under consideration (0 at start).
@param sofar the cur... | java | private static int getPowerSet(int[] set, int inputIndex, int[] sofar, int[][] sets, int outputIndex) {
for (int i = inputIndex; i < set.length; i++) {
int n = sofar == null ? 0 : sofar.length;
if (n < set.length-1) {
int[] subset = new int[n + 1];
subset[... | [
"private",
"static",
"int",
"getPowerSet",
"(",
"int",
"[",
"]",
"set",
",",
"int",
"inputIndex",
",",
"int",
"[",
"]",
"sofar",
",",
"int",
"[",
"]",
"[",
"]",
"sets",
",",
"int",
"outputIndex",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"inputIndex",... | Recursively calculates all possible subsets.
@param set the input item set.
@param inputIndex the index within the input set marking current
element under consideration (0 at start).
@param sofar the current combination determined sofar during the
recursion (null at start).
@param sets the power set to store all combin... | [
"Recursively",
"calculates",
"all",
"possible",
"subsets",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/association/ARM.java#L265-L281 |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/statistics/kriging/OmsKriging.java | OmsKriging.storeResult | private void storeResult( double[] result2, int[] id ) throws SchemaException {
"""
Store the result in a HashMap (if the mode is 0 or 1)
@param result2
the result of the model
@param id
the associated id of the calculating points.
@throws SchemaException
@throws SchemaException
"""
outData = n... | java | private void storeResult( double[] result2, int[] id ) throws SchemaException {
outData = new HashMap<Integer, double[]>();
for( int i = 0; i < result2.length; i++ ) {
outData.put(id[i], new double[]{checkResultValue(result2[i])});
}
} | [
"private",
"void",
"storeResult",
"(",
"double",
"[",
"]",
"result2",
",",
"int",
"[",
"]",
"id",
")",
"throws",
"SchemaException",
"{",
"outData",
"=",
"new",
"HashMap",
"<",
"Integer",
",",
"double",
"[",
"]",
">",
"(",
")",
";",
"for",
"(",
"int",... | Store the result in a HashMap (if the mode is 0 or 1)
@param result2
the result of the model
@param id
the associated id of the calculating points.
@throws SchemaException
@throws SchemaException | [
"Store",
"the",
"result",
"in",
"a",
"HashMap",
"(",
"if",
"the",
"mode",
"is",
"0",
"or",
"1",
")"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/statistics/kriging/OmsKriging.java#L535-L540 |
haifengl/smile | math/src/main/java/smile/math/IntArrayList.java | IntArrayList.set | public IntArrayList set(int index, int val) {
"""
Replaces the value at the specified position in this list with the
specified value.
@param index index of the value to replace
@param val value to be stored at the specified position
@throws IndexOutOfBoundsException if the index is out of range (index < 0... | java | public IntArrayList set(int index, int val) {
if (index < 0 || index >= size) {
throw new IndexOutOfBoundsException(String.valueOf(index));
}
data[index] = val;
return this;
} | [
"public",
"IntArrayList",
"set",
"(",
"int",
"index",
",",
"int",
"val",
")",
"{",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">=",
"size",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"String",
".",
"valueOf",
"(",
"index",
")",
")",
... | Replaces the value at the specified position in this list with the
specified value.
@param index index of the value to replace
@param val value to be stored at the specified position
@throws IndexOutOfBoundsException if the index is out of range (index < 0 || index ≥ size()) | [
"Replaces",
"the",
"value",
"at",
"the",
"specified",
"position",
"in",
"this",
"list",
"with",
"the",
"specified",
"value",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/math/src/main/java/smile/math/IntArrayList.java#L150-L156 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/util/FileUtils.java | FileUtils.writeToFile | public static void writeToFile(InputStream inputStream, File file) {
"""
Writes inputStream content to file. Uses default charset encoding.
@param inputStream
@param file
"""
try (InputStreamReader inputStreamReader = new InputStreamReader(inputStream)) {
writeToFile(FileCopyUtils.copyToS... | java | public static void writeToFile(InputStream inputStream, File file) {
try (InputStreamReader inputStreamReader = new InputStreamReader(inputStream)) {
writeToFile(FileCopyUtils.copyToString(inputStreamReader), file, getDefaultCharset());
} catch (IOException e) {
throw new CitrusR... | [
"public",
"static",
"void",
"writeToFile",
"(",
"InputStream",
"inputStream",
",",
"File",
"file",
")",
"{",
"try",
"(",
"InputStreamReader",
"inputStreamReader",
"=",
"new",
"InputStreamReader",
"(",
"inputStream",
")",
")",
"{",
"writeToFile",
"(",
"FileCopyUtil... | Writes inputStream content to file. Uses default charset encoding.
@param inputStream
@param file | [
"Writes",
"inputStream",
"content",
"to",
"file",
".",
"Uses",
"default",
"charset",
"encoding",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/util/FileUtils.java#L134-L140 |
knowm/XChange | xchange-bitcoinde/src/main/java/org/knowm/xchange/bitcoinde/BitcoindeAdapters.java | BitcoindeAdapters.adaptOrderBook | public static OrderBook adaptOrderBook(
BitcoindeOrderbookWrapper bitcoindeOrderbookWrapper, CurrencyPair currencyPair) {
"""
Adapt a org.knowm.xchange.bitcoinde.dto.marketdata.BitcoindeOrderBook object to an OrderBook
object.
@param bitcoindeOrderbookWrapper the exchange specific OrderBook object
@para... | java | public static OrderBook adaptOrderBook(
BitcoindeOrderbookWrapper bitcoindeOrderbookWrapper, CurrencyPair currencyPair) {
// System.out.println("bitcoindeOrderbookWrapper = " +
// bitcoindeOrderbookWrapper);
// System.out.println("credits = " + bitcoindeOrderbookWrapper.getCredits());
List<Limit... | [
"public",
"static",
"OrderBook",
"adaptOrderBook",
"(",
"BitcoindeOrderbookWrapper",
"bitcoindeOrderbookWrapper",
",",
"CurrencyPair",
"currencyPair",
")",
"{",
"// System.out.println(\"bitcoindeOrderbookWrapper = \" +",
"// bitcoindeOrderbookWrapper);",
"// System.out.println(\"credits ... | Adapt a org.knowm.xchange.bitcoinde.dto.marketdata.BitcoindeOrderBook object to an OrderBook
object.
@param bitcoindeOrderbookWrapper the exchange specific OrderBook object
@param currencyPair (e.g. BTC/USD)
@return The XChange OrderBook | [
"Adapt",
"a",
"org",
".",
"knowm",
".",
"xchange",
".",
"bitcoinde",
".",
"dto",
".",
"marketdata",
".",
"BitcoindeOrderBook",
"object",
"to",
"an",
"OrderBook",
"object",
"."
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-bitcoinde/src/main/java/org/knowm/xchange/bitcoinde/BitcoindeAdapters.java#L64-L85 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java | ConfigurationReader.parseNamespaceFilterConfig | private void parseNamespaceFilterConfig(final Node node, final ConfigSettings config) {
"""
Parses the namespaces parameter section. This is the subsection of filter.
@param node
Reference to the current used xml node
@param config
Reference to the ConfigSettings
"""
String name;
Integer value;
Nod... | java | private void parseNamespaceFilterConfig(final Node node, final ConfigSettings config) {
String name;
Integer value;
Node nnode;
final NodeList list = node.getChildNodes();
final int length = list.getLength();
final Set<Integer> namespaces = new HashSet<Integer>();
for (int i = 0; i < length; i++) {
nn... | [
"private",
"void",
"parseNamespaceFilterConfig",
"(",
"final",
"Node",
"node",
",",
"final",
"ConfigSettings",
"config",
")",
"{",
"String",
"name",
";",
"Integer",
"value",
";",
"Node",
"nnode",
";",
"final",
"NodeList",
"list",
"=",
"node",
".",
"getChildNod... | Parses the namespaces parameter section. This is the subsection of filter.
@param node
Reference to the current used xml node
@param config
Reference to the ConfigSettings | [
"Parses",
"the",
"namespaces",
"parameter",
"section",
".",
"This",
"is",
"the",
"subsection",
"of",
"filter",
"."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java#L293-L320 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.