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 |
|---|---|---|---|---|---|---|---|---|---|---|
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java | CassandraSchemaManager.handleCreate | private void handleCreate(TableInfo tableInfo, KsDef ksDef) throws Exception {
"""
Handle create.
@param tableInfo
the table info
@param ksDef
the ks def
@throws Exception
the exception
"""
if (containsCompositeKey(tableInfo))
{
validateCompoundKey(tableInfo);
//... | java | private void handleCreate(TableInfo tableInfo, KsDef ksDef) throws Exception
{
if (containsCompositeKey(tableInfo))
{
validateCompoundKey(tableInfo);
// First drop existing column family.
dropTableUsingCql(tableInfo);
}
else
{
o... | [
"private",
"void",
"handleCreate",
"(",
"TableInfo",
"tableInfo",
",",
"KsDef",
"ksDef",
")",
"throws",
"Exception",
"{",
"if",
"(",
"containsCompositeKey",
"(",
"tableInfo",
")",
")",
"{",
"validateCompoundKey",
"(",
"tableInfo",
")",
";",
"// First drop existing... | Handle create.
@param tableInfo
the table info
@param ksDef
the ks def
@throws Exception
the exception | [
"Handle",
"create",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java#L601-L614 |
biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/GUIFarmJobRunnable.java | GUIFarmJobRunnable.createAndShowGUI | private static void createAndShowGUI(GUIAlignmentProgressListener progressListener) {
"""
Create the GUI and show it. As with all GUI code, this must run
on the event-dispatching thread.
"""
//Create and set up the window.
JFrame frame = new JFrame("Monitor alignment process");
frame.setDefaultCloseOper... | java | private static void createAndShowGUI(GUIAlignmentProgressListener progressListener) {
//Create and set up the window.
JFrame frame = new JFrame("Monitor alignment process");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Create and set up the content pane.
JComponent newContentPane = progressListene... | [
"private",
"static",
"void",
"createAndShowGUI",
"(",
"GUIAlignmentProgressListener",
"progressListener",
")",
"{",
"//Create and set up the window.",
"JFrame",
"frame",
"=",
"new",
"JFrame",
"(",
"\"Monitor alignment process\"",
")",
";",
"frame",
".",
"setDefaultCloseOper... | Create the GUI and show it. As with all GUI code, this must run
on the event-dispatching thread. | [
"Create",
"the",
"GUI",
"and",
"show",
"it",
".",
"As",
"with",
"all",
"GUI",
"code",
"this",
"must",
"run",
"on",
"the",
"event",
"-",
"dispatching",
"thread",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/GUIFarmJobRunnable.java#L42-L56 |
apache/incubator-shardingsphere | sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/jdbc/adapter/WrapperAdapter.java | WrapperAdapter.recordMethodInvocation | @SneakyThrows
public final void recordMethodInvocation(final Class<?> targetClass, final String methodName, final Class<?>[] argumentTypes, final Object[] arguments) {
"""
record method invocation.
@param targetClass target class
@param methodName method name
@param argumentTypes argument types
@param ar... | java | @SneakyThrows
public final void recordMethodInvocation(final Class<?> targetClass, final String methodName, final Class<?>[] argumentTypes, final Object[] arguments) {
jdbcMethodInvocations.add(new JdbcMethodInvocation(targetClass.getMethod(methodName, argumentTypes), arguments));
} | [
"@",
"SneakyThrows",
"public",
"final",
"void",
"recordMethodInvocation",
"(",
"final",
"Class",
"<",
"?",
">",
"targetClass",
",",
"final",
"String",
"methodName",
",",
"final",
"Class",
"<",
"?",
">",
"[",
"]",
"argumentTypes",
",",
"final",
"Object",
"[",... | record method invocation.
@param targetClass target class
@param methodName method name
@param argumentTypes argument types
@param arguments arguments | [
"record",
"method",
"invocation",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/jdbc/adapter/WrapperAdapter.java#L59-L62 |
wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/spi/MediaSource.java | MediaSource.getMediaRefProperty | @Deprecated
protected final @Nullable String getMediaRefProperty(@NotNull MediaRequest mediaRequest) {
"""
Get property name containing the media request path
@param mediaRequest Media request
@return Property name
@deprecated Use {@link #getMediaRefProperty(MediaRequest, MediaHandlerConfig)}
"""
retu... | java | @Deprecated
protected final @Nullable String getMediaRefProperty(@NotNull MediaRequest mediaRequest) {
return getMediaRefProperty(mediaRequest, null);
} | [
"@",
"Deprecated",
"protected",
"final",
"@",
"Nullable",
"String",
"getMediaRefProperty",
"(",
"@",
"NotNull",
"MediaRequest",
"mediaRequest",
")",
"{",
"return",
"getMediaRefProperty",
"(",
"mediaRequest",
",",
"null",
")",
";",
"}"
] | Get property name containing the media request path
@param mediaRequest Media request
@return Property name
@deprecated Use {@link #getMediaRefProperty(MediaRequest, MediaHandlerConfig)} | [
"Get",
"property",
"name",
"containing",
"the",
"media",
"request",
"path"
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/spi/MediaSource.java#L161-L164 |
alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/NimbusServer.java | NimbusServer.initCleaner | @SuppressWarnings("rawtypes")
private void initCleaner(Map conf) throws IOException {
"""
Right now, every 600 seconds, nimbus will clean jar under /LOCAL-DIR/nimbus/inbox,
which is the uploading topology directory
"""
final ScheduledExecutorService scheduExec = data.getScheduExec();
if (... | java | @SuppressWarnings("rawtypes")
private void initCleaner(Map conf) throws IOException {
final ScheduledExecutorService scheduExec = data.getScheduExec();
if (!data.isLaunchedCleaner()) {
// Schedule Nimbus inbox cleaner/nimbus/inbox jar
String dir_location = StormConfig.master... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"private",
"void",
"initCleaner",
"(",
"Map",
"conf",
")",
"throws",
"IOException",
"{",
"final",
"ScheduledExecutorService",
"scheduExec",
"=",
"data",
".",
"getScheduExec",
"(",
")",
";",
"if",
"(",
"!",
"da... | Right now, every 600 seconds, nimbus will clean jar under /LOCAL-DIR/nimbus/inbox,
which is the uploading topology directory | [
"Right",
"now",
"every",
"600",
"seconds",
"nimbus",
"will",
"clean",
"jar",
"under",
"/",
"LOCAL",
"-",
"DIR",
"/",
"nimbus",
"/",
"inbox",
"which",
"is",
"the",
"uploading",
"topology",
"directory"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/NimbusServer.java#L262-L280 |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/features/ExampleAssociatePoints.java | ExampleAssociatePoints.describeImage | private void describeImage(T input, List<Point2D_F64> points, FastQueue<TD> descs ) {
"""
Detects features inside the two images and computes descriptions at those points.
"""
detDesc.detect(input);
for( int i = 0; i < detDesc.getNumberOfFeatures(); i++ ) {
points.add( detDesc.getLocation(i).copy() );
... | java | private void describeImage(T input, List<Point2D_F64> points, FastQueue<TD> descs )
{
detDesc.detect(input);
for( int i = 0; i < detDesc.getNumberOfFeatures(); i++ ) {
points.add( detDesc.getLocation(i).copy() );
descs.grow().setTo(detDesc.getDescription(i));
}
} | [
"private",
"void",
"describeImage",
"(",
"T",
"input",
",",
"List",
"<",
"Point2D_F64",
">",
"points",
",",
"FastQueue",
"<",
"TD",
">",
"descs",
")",
"{",
"detDesc",
".",
"detect",
"(",
"input",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i"... | Detects features inside the two images and computes descriptions at those points. | [
"Detects",
"features",
"inside",
"the",
"two",
"images",
"and",
"computes",
"descriptions",
"at",
"those",
"points",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleAssociatePoints.java#L109-L117 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java | WaveformFinder.requestWaveformDetailFrom | public WaveformDetail requestWaveformDetailFrom(final DataReference dataReference) {
"""
Ask the specified player for the specified waveform detail from the specified media slot, first checking if we
have a cached copy.
@param dataReference uniquely identifies the desired waveform detail
@return the wavefor... | java | public WaveformDetail requestWaveformDetailFrom(final DataReference dataReference) {
ensureRunning();
for (WaveformDetail cached : detailHotCache.values()) {
if (cached.dataReference.equals(dataReference)) { // Found a hot cue hit, use it.
return cached;
}
... | [
"public",
"WaveformDetail",
"requestWaveformDetailFrom",
"(",
"final",
"DataReference",
"dataReference",
")",
"{",
"ensureRunning",
"(",
")",
";",
"for",
"(",
"WaveformDetail",
"cached",
":",
"detailHotCache",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"cache... | Ask the specified player for the specified waveform detail from the specified media slot, first checking if we
have a cached copy.
@param dataReference uniquely identifies the desired waveform detail
@return the waveform detail, if it was found, or {@code null}
@throws IllegalStateException if the WaveformFinder is ... | [
"Ask",
"the",
"specified",
"player",
"for",
"the",
"specified",
"waveform",
"detail",
"from",
"the",
"specified",
"media",
"slot",
"first",
"checking",
"if",
"we",
"have",
"a",
"cached",
"copy",
"."
] | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java#L563-L571 |
btaz/data-util | src/main/java/com/btaz/util/xml/model/Xml.java | Xml.deepCopy | private void deepCopy(Element origElement, Element copyElement) {
"""
Deep copy recursive helper method.
@param origElement original element
@param copyElement copy element
"""
List<Node> children = origElement.getChildElements();
for(Node node : children) {
try {
... | java | private void deepCopy(Element origElement, Element copyElement) {
List<Node> children = origElement.getChildElements();
for(Node node : children) {
try {
if(node instanceof Content) {
Content content = (Content) ((Content) node).clone();
... | [
"private",
"void",
"deepCopy",
"(",
"Element",
"origElement",
",",
"Element",
"copyElement",
")",
"{",
"List",
"<",
"Node",
">",
"children",
"=",
"origElement",
".",
"getChildElements",
"(",
")",
";",
"for",
"(",
"Node",
"node",
":",
"children",
")",
"{",
... | Deep copy recursive helper method.
@param origElement original element
@param copyElement copy element | [
"Deep",
"copy",
"recursive",
"helper",
"method",
"."
] | train | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/xml/model/Xml.java#L310-L326 |
bwkimmel/jdcp | jdcp-core/src/main/java/ca/eandb/jdcp/remote/JobStatus.java | JobStatus.withStatus | public JobStatus withStatus(String newStatus) {
"""
Creates a copy of this <code>JobStatus</code> with the status string set
to the specified value.
@param newStatus A description of the current status of the job.
@return A copy of this <code>JobStatus</code> with the status string set
to the specified value.
... | java | public JobStatus withStatus(String newStatus) {
return new JobStatus(jobId, description, state, progress, newStatus, eventId);
} | [
"public",
"JobStatus",
"withStatus",
"(",
"String",
"newStatus",
")",
"{",
"return",
"new",
"JobStatus",
"(",
"jobId",
",",
"description",
",",
"state",
",",
"progress",
",",
"newStatus",
",",
"eventId",
")",
";",
"}"
] | Creates a copy of this <code>JobStatus</code> with the status string set
to the specified value.
@param newStatus A description of the current status of the job.
@return A copy of this <code>JobStatus</code> with the status string set
to the specified value. | [
"Creates",
"a",
"copy",
"of",
"this",
"<code",
">",
"JobStatus<",
"/",
"code",
">",
"with",
"the",
"status",
"string",
"set",
"to",
"the",
"specified",
"value",
"."
] | train | https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-core/src/main/java/ca/eandb/jdcp/remote/JobStatus.java#L133-L135 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/plugins/configuration/PropertyResolverFactory.java | PropertyResolverFactory.createPrefixedResolver | public static PropertyResolver createPrefixedResolver(final PropertyResolver resolver, String providerName, String pluginType) {
"""
@return Create a resolver from a set of retrievers, possibly null
@param resolver resolver
@param pluginType service type name
@param providerName provider name
"""
... | java | public static PropertyResolver createPrefixedResolver(final PropertyResolver resolver, String providerName, String pluginType) {
final String projectPrefix = projectPropertyPrefix(pluginPropertyPrefix(pluginType, providerName));
final String frameworkPrefix = frameworkPropertyPrefix(pluginPropertyPrefix... | [
"public",
"static",
"PropertyResolver",
"createPrefixedResolver",
"(",
"final",
"PropertyResolver",
"resolver",
",",
"String",
"providerName",
",",
"String",
"pluginType",
")",
"{",
"final",
"String",
"projectPrefix",
"=",
"projectPropertyPrefix",
"(",
"pluginPropertyPref... | @return Create a resolver from a set of retrievers, possibly null
@param resolver resolver
@param pluginType service type name
@param providerName provider name | [
"@return",
"Create",
"a",
"resolver",
"from",
"a",
"set",
"of",
"retrievers",
"possibly",
"null"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/plugins/configuration/PropertyResolverFactory.java#L218-L243 |
Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/query/values/JcElement.java | JcElement.booleanProperty | public JcBoolean booleanProperty(String name) {
"""
<div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div>
<div color='red' style="font-size:18px;color:red"><i>access a named boolean property, return a <b>JcBoolean</b></i></div>
<br/>
"""
JcBoolean ret = new JcBoolean(name, th... | java | public JcBoolean booleanProperty(String name) {
JcBoolean ret = new JcBoolean(name, this, OPERATOR.PropertyContainer.PROPERTY_ACCESS);
QueryRecorder.recordInvocationConditional(this, "booleanProperty", ret, QueryRecorder.literal(name));
return ret;
} | [
"public",
"JcBoolean",
"booleanProperty",
"(",
"String",
"name",
")",
"{",
"JcBoolean",
"ret",
"=",
"new",
"JcBoolean",
"(",
"name",
",",
"this",
",",
"OPERATOR",
".",
"PropertyContainer",
".",
"PROPERTY_ACCESS",
")",
";",
"QueryRecorder",
".",
"recordInvocation... | <div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div>
<div color='red' style="font-size:18px;color:red"><i>access a named boolean property, return a <b>JcBoolean</b></i></div>
<br/> | [
"<div",
"color",
"=",
"red",
"style",
"=",
"font",
"-",
"size",
":",
"24px",
";",
"color",
":",
"red",
">",
"<b",
">",
"<i",
">",
"<u",
">",
"JCYPHER<",
"/",
"u",
">",
"<",
"/",
"i",
">",
"<",
"/",
"b",
">",
"<",
"/",
"div",
">",
"<div",
... | train | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/query/values/JcElement.java#L75-L79 |
killbill/killbill | profiles/killbill/src/main/java/org/killbill/billing/server/log/obfuscators/LuhnMaskingObfuscator.java | LuhnMaskingObfuscator.stripSeparators | @VisibleForTesting
String stripSeparators(final String cardNumber) {
"""
Remove any ` ` and `-` characters from the given string.
@param cardNumber the number to clean up
@return if the given string contains no ` ` or `-` characters, the string
itself is returned, otherwise a new string containing no ` ` ... | java | @VisibleForTesting
String stripSeparators(final String cardNumber) {
final int length = cardNumber.length();
final char[] result = new char[length];
int count = 0;
char cur;
for (int i = 0; i < length; i++) {
cur = cardNumber.charAt(i);
if (!(cur == ' ... | [
"@",
"VisibleForTesting",
"String",
"stripSeparators",
"(",
"final",
"String",
"cardNumber",
")",
"{",
"final",
"int",
"length",
"=",
"cardNumber",
".",
"length",
"(",
")",
";",
"final",
"char",
"[",
"]",
"result",
"=",
"new",
"char",
"[",
"length",
"]",
... | Remove any ` ` and `-` characters from the given string.
@param cardNumber the number to clean up
@return if the given string contains no ` ` or `-` characters, the string
itself is returned, otherwise a new string containing no ` ` or `-`
characters is returned | [
"Remove",
"any",
"and",
"-",
"characters",
"from",
"the",
"given",
"string",
"."
] | train | https://github.com/killbill/killbill/blob/6457b485fb32a182c76197a83f428123331f1380/profiles/killbill/src/main/java/org/killbill/billing/server/log/obfuscators/LuhnMaskingObfuscator.java#L181-L197 |
redkale/redkale | src/org/redkale/net/http/HttpRequest.java | HttpRequest.getRequstURIPath | public double getRequstURIPath(String prefix, double defvalue) {
"""
获取请求URL分段中含prefix段的double值 <br>
例如请求URL /pipes/record/query/point:40.0 <br>
获取time参数: double point = request.getRequstURIPath("point:", 0.0);
@param prefix prefix段前缀
@param defvalue 默认double值
@return double值
"""
String... | java | public double getRequstURIPath(String prefix, double defvalue) {
String val = getRequstURIPath(prefix, null);
try {
return val == null ? defvalue : Double.parseDouble(val);
} catch (NumberFormatException e) {
return defvalue;
}
} | [
"public",
"double",
"getRequstURIPath",
"(",
"String",
"prefix",
",",
"double",
"defvalue",
")",
"{",
"String",
"val",
"=",
"getRequstURIPath",
"(",
"prefix",
",",
"null",
")",
";",
"try",
"{",
"return",
"val",
"==",
"null",
"?",
"defvalue",
":",
"Double",... | 获取请求URL分段中含prefix段的double值 <br>
例如请求URL /pipes/record/query/point:40.0 <br>
获取time参数: double point = request.getRequstURIPath("point:", 0.0);
@param prefix prefix段前缀
@param defvalue 默认double值
@return double值 | [
"获取请求URL分段中含prefix段的double值",
"<br",
">",
"例如请求URL",
"/",
"pipes",
"/",
"record",
"/",
"query",
"/",
"point",
":",
"40",
".",
"0",
"<br",
">",
"获取time参数",
":",
"double",
"point",
"=",
"request",
".",
"getRequstURIPath",
"(",
"point",
":",
"0",
".",
"0",
... | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/net/http/HttpRequest.java#L955-L962 |
apache/predictionio-sdk-java | client/src/main/java/org/apache/predictionio/sdk/java/EventClient.java | EventClient.unsetItemAsFuture | public FutureAPIResponse unsetItemAsFuture(String iid, List<String> properties)
throws IOException {
"""
Sends an unset item properties request. Same as {@link #unsetItemAsFuture(String, List,
DateTime) unsetItemAsFuture(String, List<String>, DateTime)} except event time is not
specified and recorded... | java | public FutureAPIResponse unsetItemAsFuture(String iid, List<String> properties)
throws IOException {
return unsetItemAsFuture(iid, properties, new DateTime());
} | [
"public",
"FutureAPIResponse",
"unsetItemAsFuture",
"(",
"String",
"iid",
",",
"List",
"<",
"String",
">",
"properties",
")",
"throws",
"IOException",
"{",
"return",
"unsetItemAsFuture",
"(",
"iid",
",",
"properties",
",",
"new",
"DateTime",
"(",
")",
")",
";"... | Sends an unset item properties request. Same as {@link #unsetItemAsFuture(String, List,
DateTime) unsetItemAsFuture(String, List<String>, DateTime)} except event time is not
specified and recorded as the time when the function is called. | [
"Sends",
"an",
"unset",
"item",
"properties",
"request",
".",
"Same",
"as",
"{"
] | train | https://github.com/apache/predictionio-sdk-java/blob/16052c96b136340c175c3f9c2692e720850df219/client/src/main/java/org/apache/predictionio/sdk/java/EventClient.java#L528-L531 |
raphw/byte-buddy | byte-buddy-dep/src/main/java/net/bytebuddy/asm/MemberSubstitution.java | WithoutSpecification.replaceWithMethod | public MemberSubstitution replaceWithMethod(ElementMatcher<? super MethodDescription> matcher, MethodGraph.Compiler methodGraphCompiler) {
"""
Replaces any interaction with a matched byte code element with a non-static method access on the first
parameter of the matched element. When matching a non-static field a... | java | public MemberSubstitution replaceWithMethod(ElementMatcher<? super MethodDescription> matcher, MethodGraph.Compiler methodGraphCompiler) {
return replaceWith(new Substitution.ForMethodInvocation.OfMatchedMethod(matcher, methodGraphCompiler));
} | [
"public",
"MemberSubstitution",
"replaceWithMethod",
"(",
"ElementMatcher",
"<",
"?",
"super",
"MethodDescription",
">",
"matcher",
",",
"MethodGraph",
".",
"Compiler",
"methodGraphCompiler",
")",
"{",
"return",
"replaceWith",
"(",
"new",
"Substitution",
".",
"ForMeth... | Replaces any interaction with a matched byte code element with a non-static method access on the first
parameter of the matched element. When matching a non-static field access or method invocation, the
substituted method is located on the same receiver type as the original access. For static access, the
first argument... | [
"Replaces",
"any",
"interaction",
"with",
"a",
"matched",
"byte",
"code",
"element",
"with",
"a",
"non",
"-",
"static",
"method",
"access",
"on",
"the",
"first",
"parameter",
"of",
"the",
"matched",
"element",
".",
"When",
"matching",
"a",
"non",
"-",
"sta... | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/asm/MemberSubstitution.java#L409-L411 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxTrash.java | BoxTrash.getFileInfo | public BoxFile.Info getFileInfo(String fileID) {
"""
Gets information about a trashed file.
@param fileID the ID of the trashed file.
@return info about the trashed file.
"""
URL url = FILE_INFO_URL_TEMPLATE.build(this.api.getBaseURL(), fileID);
BoxAPIRequest request = new BoxAPIReque... | java | public BoxFile.Info getFileInfo(String fileID) {
URL url = FILE_INFO_URL_TEMPLATE.build(this.api.getBaseURL(), fileID);
BoxAPIRequest request = new BoxAPIRequest(this.api, url, "GET");
BoxJSONResponse response = (BoxJSONResponse) request.send();
JsonObject jsonObject = JsonObject.readFro... | [
"public",
"BoxFile",
".",
"Info",
"getFileInfo",
"(",
"String",
"fileID",
")",
"{",
"URL",
"url",
"=",
"FILE_INFO_URL_TEMPLATE",
".",
"build",
"(",
"this",
".",
"api",
".",
"getBaseURL",
"(",
")",
",",
"fileID",
")",
";",
"BoxAPIRequest",
"request",
"=",
... | Gets information about a trashed file.
@param fileID the ID of the trashed file.
@return info about the trashed file. | [
"Gets",
"information",
"about",
"a",
"trashed",
"file",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTrash.java#L157-L165 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/process/PTBLexer.java | PTBLexer.getNext | private Object getNext(String txt, String originalText) {
"""
Make the next token.
@param txt What the token should be
@param originalText The original String that got transformed into txt
"""
if (invertible) {
String str = prevWordAfter.toString();
prevWordAfter.setLength(0);
CoreL... | java | private Object getNext(String txt, String originalText) {
if (invertible) {
String str = prevWordAfter.toString();
prevWordAfter.setLength(0);
CoreLabel word = (CoreLabel) tokenFactory.makeToken(txt, yychar, yylength());
word.set(OriginalTextAnnotation.class, originalText);
word.... | [
"private",
"Object",
"getNext",
"(",
"String",
"txt",
",",
"String",
"originalText",
")",
"{",
"if",
"(",
"invertible",
")",
"{",
"String",
"str",
"=",
"prevWordAfter",
".",
"toString",
"(",
")",
";",
"prevWordAfter",
".",
"setLength",
"(",
"0",
")",
";"... | Make the next token.
@param txt What the token should be
@param originalText The original String that got transformed into txt | [
"Make",
"the",
"next",
"token",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/process/PTBLexer.java#L10618-L10631 |
Wikidata/Wikidata-Toolkit | wdtk-dumpfiles/src/main/java/org/wikidata/wdtk/dumpfiles/MwRevisionProcessorBroker.java | MwRevisionProcessorBroker.notifyMwRevisionProcessors | void notifyMwRevisionProcessors(MwRevision mwRevision, boolean isCurrent) {
"""
Notifies all interested subscribers of the given revision.
@param mwRevision
the given revision
@param isCurrent
true if this is guaranteed to be the most current revision
"""
if (mwRevision == null || mwRevision.getPageId(... | java | void notifyMwRevisionProcessors(MwRevision mwRevision, boolean isCurrent) {
if (mwRevision == null || mwRevision.getPageId() <= 0) {
return;
}
for (MwRevisionProcessorBroker.RevisionSubscription rs : this.revisionSubscriptions) {
if (rs.onlyCurrentRevisions == isCurrent
&& (rs.model == null || mwRevisi... | [
"void",
"notifyMwRevisionProcessors",
"(",
"MwRevision",
"mwRevision",
",",
"boolean",
"isCurrent",
")",
"{",
"if",
"(",
"mwRevision",
"==",
"null",
"||",
"mwRevision",
".",
"getPageId",
"(",
")",
"<=",
"0",
")",
"{",
"return",
";",
"}",
"for",
"(",
"MwRev... | Notifies all interested subscribers of the given revision.
@param mwRevision
the given revision
@param isCurrent
true if this is guaranteed to be the most current revision | [
"Notifies",
"all",
"interested",
"subscribers",
"of",
"the",
"given",
"revision",
"."
] | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-dumpfiles/src/main/java/org/wikidata/wdtk/dumpfiles/MwRevisionProcessorBroker.java#L175-L186 |
aoindustries/aocode-public | src/main/java/com/aoindustries/rmi/RegistryManager.java | RegistryManager.createRegistry | public static Registry createRegistry(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException {
"""
Creates a registry or returns the registry that is already using the port.
"""
synchronized(registryCache) {
Integer portObj = port;
Registry registry = registryCache.get... | java | public static Registry createRegistry(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException {
synchronized(registryCache) {
Integer portObj = port;
Registry registry = registryCache.get(portObj);
if(registry==null) {
registry = LocateRegistry.createRegistry(port, csf, s... | [
"public",
"static",
"Registry",
"createRegistry",
"(",
"int",
"port",
",",
"RMIClientSocketFactory",
"csf",
",",
"RMIServerSocketFactory",
"ssf",
")",
"throws",
"RemoteException",
"{",
"synchronized",
"(",
"registryCache",
")",
"{",
"Integer",
"portObj",
"=",
"port"... | Creates a registry or returns the registry that is already using the port. | [
"Creates",
"a",
"registry",
"or",
"returns",
"the",
"registry",
"that",
"is",
"already",
"using",
"the",
"port",
"."
] | train | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/rmi/RegistryManager.java#L48-L58 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.backupSecretAsync | public ServiceFuture<BackupSecretResult> backupSecretAsync(String vaultBaseUrl, String secretName, final ServiceCallback<BackupSecretResult> serviceCallback) {
"""
Backs up the specified secret.
Requests that a backup of the specified secret be downloaded to the client. All versions of the secret will be download... | java | public ServiceFuture<BackupSecretResult> backupSecretAsync(String vaultBaseUrl, String secretName, final ServiceCallback<BackupSecretResult> serviceCallback) {
return ServiceFuture.fromResponse(backupSecretWithServiceResponseAsync(vaultBaseUrl, secretName), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"BackupSecretResult",
">",
"backupSecretAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"secretName",
",",
"final",
"ServiceCallback",
"<",
"BackupSecretResult",
">",
"serviceCallback",
")",
"{",
"return",
"ServiceFuture",
".",
"f... | Backs up the specified secret.
Requests that a backup of the specified secret be downloaded to the client. All versions of the secret will be downloaded. This operation requires the secrets/backup permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param secretName The name of... | [
"Backs",
"up",
"the",
"specified",
"secret",
".",
"Requests",
"that",
"a",
"backup",
"of",
"the",
"specified",
"secret",
"be",
"downloaded",
"to",
"the",
"client",
".",
"All",
"versions",
"of",
"the",
"secret",
"will",
"be",
"downloaded",
".",
"This",
"ope... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L4920-L4922 |
alkacon/opencms-core | src/org/opencms/workplace/CmsWorkplaceMessages.java | CmsWorkplaceMessages.getResourceTypeDescription | public static String getResourceTypeDescription(CmsWorkplace wp, String name) {
"""
Returns the description of the given resource type name.<p>
If this key is not found, the value of the name input will be returned.<p>
@param wp an instance of a {@link CmsWorkplace} to resolve the key name with
@param name ... | java | public static String getResourceTypeDescription(CmsWorkplace wp, String name) {
// try to find the localized key
String key = OpenCms.getWorkplaceManager().getExplorerTypeSetting(name).getInfo();
return wp.keyDefault(key, name);
} | [
"public",
"static",
"String",
"getResourceTypeDescription",
"(",
"CmsWorkplace",
"wp",
",",
"String",
"name",
")",
"{",
"// try to find the localized key",
"String",
"key",
"=",
"OpenCms",
".",
"getWorkplaceManager",
"(",
")",
".",
"getExplorerTypeSetting",
"(",
"name... | Returns the description of the given resource type name.<p>
If this key is not found, the value of the name input will be returned.<p>
@param wp an instance of a {@link CmsWorkplace} to resolve the key name with
@param name the resource type name to generate the nice name for
@return the description of the given res... | [
"Returns",
"the",
"description",
"of",
"the",
"given",
"resource",
"type",
"name",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplaceMessages.java#L132-L137 |
lucee/Lucee | core/src/main/java/lucee/runtime/tag/Ftp.java | Ftp.actionGetFile | private AFTPClient actionGetFile() throws PageException, IOException {
"""
gets a file from server and copy it local
@return FTPCLient
@throws PageException
@throws IOException
"""
required("remotefile", remotefile);
required("localfile", localfile);
AFTPClient client = getClient();
Resource local = ... | java | private AFTPClient actionGetFile() throws PageException, IOException {
required("remotefile", remotefile);
required("localfile", localfile);
AFTPClient client = getClient();
Resource local = ResourceUtil.toResourceExistingParent(pageContext, localfile);// new File(localfile);
pageContext.getConfig().getSecurityMa... | [
"private",
"AFTPClient",
"actionGetFile",
"(",
")",
"throws",
"PageException",
",",
"IOException",
"{",
"required",
"(",
"\"remotefile\"",
",",
"remotefile",
")",
";",
"required",
"(",
"\"localfile\"",
",",
"localfile",
")",
";",
"AFTPClient",
"client",
"=",
"ge... | gets a file from server and copy it local
@return FTPCLient
@throws PageException
@throws IOException | [
"gets",
"a",
"file",
"from",
"server",
"and",
"copy",
"it",
"local"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Ftp.java#L424-L446 |
phax/ph-oton | ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/handler/AbstractWebPageActionHandlerMultiUndelete.java | AbstractWebPageActionHandlerMultiUndelete.createUndeleteToolbar | @Nonnull
@OverrideOnDemand
protected TOOLBAR_TYPE createUndeleteToolbar (@Nonnull final WPECTYPE aWPEC,
@Nonnull final FORM_TYPE aForm,
@Nonnull final ICommonsList <DATATYPE> aSelectedObjects) {
"""
Create toolbar f... | java | @Nonnull
@OverrideOnDemand
protected TOOLBAR_TYPE createUndeleteToolbar (@Nonnull final WPECTYPE aWPEC,
@Nonnull final FORM_TYPE aForm,
@Nonnull final ICommonsList <DATATYPE> aSelectedObjects)
{
final Locale aDispl... | [
"@",
"Nonnull",
"@",
"OverrideOnDemand",
"protected",
"TOOLBAR_TYPE",
"createUndeleteToolbar",
"(",
"@",
"Nonnull",
"final",
"WPECTYPE",
"aWPEC",
",",
"@",
"Nonnull",
"final",
"FORM_TYPE",
"aForm",
",",
"@",
"Nonnull",
"final",
"ICommonsList",
"<",
"DATATYPE",
">"... | Create toolbar for undeleting an existing object
@param aWPEC
The web page execution context
@param aForm
The handled form. Never <code>null</code>.
@param aSelectedObjects
Selected objects. Never <code>null</code>.
@return Never <code>null</code>. | [
"Create",
"toolbar",
"for",
"undeleting",
"an",
"existing",
"object"
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/handler/AbstractWebPageActionHandlerMultiUndelete.java#L134-L157 |
alkacon/opencms-core | src-gwt/org/opencms/ade/upload/client/ui/A_CmsUploadDialog.java | A_CmsUploadDialog.addClickHandlerToCheckBox | private void addClickHandlerToCheckBox(final CmsCheckBox check, final Widget unzipWidget, final CmsFileInfo file) {
"""
Adds a click handler for the given check box.<p>
@param check the check box
@param unzipWidget the un-zip check box
@param file the file
"""
check.addClickHandler(new ClickHandl... | java | private void addClickHandlerToCheckBox(final CmsCheckBox check, final Widget unzipWidget, final CmsFileInfo file) {
check.addClickHandler(new ClickHandler() {
/**
* @see com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent)
*/
... | [
"private",
"void",
"addClickHandlerToCheckBox",
"(",
"final",
"CmsCheckBox",
"check",
",",
"final",
"Widget",
"unzipWidget",
",",
"final",
"CmsFileInfo",
"file",
")",
"{",
"check",
".",
"addClickHandler",
"(",
"new",
"ClickHandler",
"(",
")",
"{",
"/**\n ... | Adds a click handler for the given check box.<p>
@param check the check box
@param unzipWidget the un-zip check box
@param file the file | [
"Adds",
"a",
"click",
"handler",
"for",
"the",
"given",
"check",
"box",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/upload/client/ui/A_CmsUploadDialog.java#L992-L1046 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/utils/AnnotationProcessorUtilis.java | AnnotationProcessorUtilis.infoOnGeneratedFile | public static void infoOnGeneratedFile(Class<BindDataSource> annotation, File schemaCreateFile) {
"""
Info on generated file.
@param annotation the annotation
@param schemaCreateFile the schema create file
"""
String msg = String.format("file '%s' in directory '%s' is generated by '@%s' annotation proces... | java | public static void infoOnGeneratedFile(Class<BindDataSource> annotation, File schemaCreateFile) {
String msg = String.format("file '%s' in directory '%s' is generated by '@%s' annotation processor", schemaCreateFile.getName(), schemaCreateFile.getParentFile(), annotation.getSimpleName());
printMessage(msg);
} | [
"public",
"static",
"void",
"infoOnGeneratedFile",
"(",
"Class",
"<",
"BindDataSource",
">",
"annotation",
",",
"File",
"schemaCreateFile",
")",
"{",
"String",
"msg",
"=",
"String",
".",
"format",
"(",
"\"file '%s' in directory '%s' is generated by '@%s' annotation proces... | Info on generated file.
@param annotation the annotation
@param schemaCreateFile the schema create file | [
"Info",
"on",
"generated",
"file",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/utils/AnnotationProcessorUtilis.java#L72-L76 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/utils/TernaryPatcher.java | TernaryPatcher.pre | public static void pre(OpcodeStack stack, int opcode) {
"""
called before the execution of the parent OpcodeStack.sawOpcode() to save user values if the opcode is a GOTO or GOTO_W.
@param stack
the OpcodeStack with the items containing user values
@param opcode
the opcode currently seen
"""
if (s... | java | public static void pre(OpcodeStack stack, int opcode) {
if (sawGOTO) {
return;
}
sawGOTO = (opcode == Const.GOTO) || (opcode == Const.GOTO_W);
if (sawGOTO) {
int depth = stack.getStackDepth();
if (depth > 0) {
userValues.clear();
... | [
"public",
"static",
"void",
"pre",
"(",
"OpcodeStack",
"stack",
",",
"int",
"opcode",
")",
"{",
"if",
"(",
"sawGOTO",
")",
"{",
"return",
";",
"}",
"sawGOTO",
"=",
"(",
"opcode",
"==",
"Const",
".",
"GOTO",
")",
"||",
"(",
"opcode",
"==",
"Const",
... | called before the execution of the parent OpcodeStack.sawOpcode() to save user values if the opcode is a GOTO or GOTO_W.
@param stack
the OpcodeStack with the items containing user values
@param opcode
the opcode currently seen | [
"called",
"before",
"the",
"execution",
"of",
"the",
"parent",
"OpcodeStack",
".",
"sawOpcode",
"()",
"to",
"save",
"user",
"values",
"if",
"the",
"opcode",
"is",
"a",
"GOTO",
"or",
"GOTO_W",
"."
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/utils/TernaryPatcher.java#L51-L66 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.beginGeneratevpnclientpackage | public String beginGeneratevpnclientpackage(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) {
"""
Generates VPN client package for P2S client of the virtual network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@par... | java | public String beginGeneratevpnclientpackage(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) {
return beginGeneratevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single().body();
} | [
"public",
"String",
"beginGeneratevpnclientpackage",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
",",
"VpnClientParameters",
"parameters",
")",
"{",
"return",
"beginGeneratevpnclientpackageWithServiceResponseAsync",
"(",
"resourceGroupName",
",... | Generates VPN client package for P2S client of the virtual network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@param parameters Parameters supplied to the generate virtual network gateway VP... | [
"Generates",
"VPN",
"client",
"package",
"for",
"P2S",
"client",
"of",
"the",
"virtual",
"network",
"gateway",
"in",
"the",
"specified",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L1540-L1542 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/protocols/channels/StoredServerChannel.java | StoredServerChannel.getOrCreateState | public synchronized PaymentChannelServerState getOrCreateState(Wallet wallet, TransactionBroadcaster broadcaster) throws VerificationException {
"""
Gets the canonical {@link PaymentChannelServerState} object for this channel, either by returning an existing one
or by creating a new one.
@param wallet The wall... | java | public synchronized PaymentChannelServerState getOrCreateState(Wallet wallet, TransactionBroadcaster broadcaster) throws VerificationException {
if (state == null) {
switch (majorVersion) {
case 1:
state = new PaymentChannelV1ServerState(this, wallet, broadcaster)... | [
"public",
"synchronized",
"PaymentChannelServerState",
"getOrCreateState",
"(",
"Wallet",
"wallet",
",",
"TransactionBroadcaster",
"broadcaster",
")",
"throws",
"VerificationException",
"{",
"if",
"(",
"state",
"==",
"null",
")",
"{",
"switch",
"(",
"majorVersion",
")... | Gets the canonical {@link PaymentChannelServerState} object for this channel, either by returning an existing one
or by creating a new one.
@param wallet The wallet which holds the {@link PaymentChannelServerState} in which this is saved and which will
be used to complete transactions
@param broadcaster The {@link Tra... | [
"Gets",
"the",
"canonical",
"{",
"@link",
"PaymentChannelServerState",
"}",
"object",
"for",
"this",
"channel",
"either",
"by",
"returning",
"an",
"existing",
"one",
"or",
"by",
"creating",
"a",
"new",
"one",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/protocols/channels/StoredServerChannel.java#L107-L122 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/io/sstable/AbstractSSTableSimpleWriter.java | AbstractSSTableSimpleWriter.addExpiringColumn | public void addExpiringColumn(ByteBuffer name, ByteBuffer value, long timestamp, int ttl, long expirationTimestampMS) throws IOException {
"""
Insert a new expiring column to the current row (and super column if applicable).
@param name the column name
@param value the column value
@param timestamp the column t... | java | public void addExpiringColumn(ByteBuffer name, ByteBuffer value, long timestamp, int ttl, long expirationTimestampMS) throws IOException
{
addColumn(new BufferExpiringCell(metadata.comparator.cellFromByteBuffer(name), value, timestamp, ttl, (int)(expirationTimestampMS / 1000)));
} | [
"public",
"void",
"addExpiringColumn",
"(",
"ByteBuffer",
"name",
",",
"ByteBuffer",
"value",
",",
"long",
"timestamp",
",",
"int",
"ttl",
",",
"long",
"expirationTimestampMS",
")",
"throws",
"IOException",
"{",
"addColumn",
"(",
"new",
"BufferExpiringCell",
"(",
... | Insert a new expiring column to the current row (and super column if applicable).
@param name the column name
@param value the column value
@param timestamp the column timestamp
@param ttl the column time to live in seconds
@param expirationTimestampMS the local expiration timestamp in milliseconds. This is the server ... | [
"Insert",
"a",
"new",
"expiring",
"column",
"to",
"the",
"current",
"row",
"(",
"and",
"super",
"column",
"if",
"applicable",
")",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/sstable/AbstractSSTableSimpleWriter.java#L156-L159 |
craftercms/core | src/main/java/org/craftercms/core/xml/mergers/impl/resolvers/UrlPatternMergeStrategyResolver.java | UrlPatternMergeStrategyResolver.getStrategy | public DescriptorMergeStrategy getStrategy(String descriptorUrl, Document descriptorDom) {
"""
Returns a {@link DescriptorMergeStrategy} for a given descriptor, picked by matching the descriptor URL to a
pattern associated to the strategy.
@param descriptorUrl the URL that identifies the descriptor
@param des... | java | public DescriptorMergeStrategy getStrategy(String descriptorUrl, Document descriptorDom) {
for (Map.Entry<String, DescriptorMergeStrategy> entry : urlPatternToStrategyMappings.entrySet()) {
if (descriptorUrl.matches(entry.getKey())) {
return entry.getValue();
}
}
... | [
"public",
"DescriptorMergeStrategy",
"getStrategy",
"(",
"String",
"descriptorUrl",
",",
"Document",
"descriptorDom",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"DescriptorMergeStrategy",
">",
"entry",
":",
"urlPatternToStrategyMappings",
".",
"e... | Returns a {@link DescriptorMergeStrategy} for a given descriptor, picked by matching the descriptor URL to a
pattern associated to the strategy.
@param descriptorUrl the URL that identifies the descriptor
@param descriptorDom the XML DOM of the descriptor
@return the {@link DescriptorMergeStrategy} for the descriptor,... | [
"Returns",
"a",
"{",
"@link",
"DescriptorMergeStrategy",
"}",
"for",
"a",
"given",
"descriptor",
"picked",
"by",
"matching",
"the",
"descriptor",
"URL",
"to",
"a",
"pattern",
"associated",
"to",
"the",
"strategy",
"."
] | train | https://github.com/craftercms/core/blob/d3ec74d669d3f8cfcf995177615d5f126edfa237/src/main/java/org/craftercms/core/xml/mergers/impl/resolvers/UrlPatternMergeStrategyResolver.java#L51-L59 |
k0shk0sh/PermissionHelper | permission/src/main/java/com/fastaccess/permission/base/activity/BasePermissionActivity.java | BasePermissionActivity.requestPermission | protected void requestPermission(final PermissionModel model) {
"""
internal usage to show dialog with explanation you provided and a button to ask the user to request the permission
"""
new AlertDialog.Builder(this)
.setTitle(model.getTitle())
.setMessage(model.getExpla... | java | protected void requestPermission(final PermissionModel model) {
new AlertDialog.Builder(this)
.setTitle(model.getTitle())
.setMessage(model.getExplanationMessage())
.setPositiveButton("Request", new DialogInterface.OnClickListener() {
@Override... | [
"protected",
"void",
"requestPermission",
"(",
"final",
"PermissionModel",
"model",
")",
"{",
"new",
"AlertDialog",
".",
"Builder",
"(",
"this",
")",
".",
"setTitle",
"(",
"model",
".",
"getTitle",
"(",
")",
")",
".",
"setMessage",
"(",
"model",
".",
"getE... | internal usage to show dialog with explanation you provided and a button to ask the user to request the permission | [
"internal",
"usage",
"to",
"show",
"dialog",
"with",
"explanation",
"you",
"provided",
"and",
"a",
"button",
"to",
"ask",
"the",
"user",
"to",
"request",
"the",
"permission"
] | train | https://github.com/k0shk0sh/PermissionHelper/blob/04edce2af49981d1dd321bcdfbe981a1000b29d7/permission/src/main/java/com/fastaccess/permission/base/activity/BasePermissionActivity.java#L257-L271 |
spring-projects/spring-flex | spring-flex-core/src/main/java/org/springframework/flex/core/AbstractServiceConfigProcessor.java | AbstractServiceConfigProcessor.addDefaultChannels | private void addDefaultChannels(MessageBroker broker, Service service) {
"""
Adds the default channels to the {@link Service} being configured. The <code>defaultChannels</code> will be
validated to ensure they exist in the {@link MessageBroker} before they are set.
@param broker the newly configured MessageBro... | java | private void addDefaultChannels(MessageBroker broker, Service service) {
List<String> defaultChannelList = new ArrayList<String>();
for (String channelId : this.defaultChannels) {
Assert.isTrue(broker.getChannelIds().contains(channelId), "The channel " + channelId + " is not known to the Mes... | [
"private",
"void",
"addDefaultChannels",
"(",
"MessageBroker",
"broker",
",",
"Service",
"service",
")",
"{",
"List",
"<",
"String",
">",
"defaultChannelList",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"String",
"channelId",
":"... | Adds the default channels to the {@link Service} being configured. The <code>defaultChannels</code> will be
validated to ensure they exist in the {@link MessageBroker} before they are set.
@param broker the newly configured MessageBroker
@param remotingService the newly created Service | [
"Adds",
"the",
"default",
"channels",
"to",
"the",
"{",
"@link",
"Service",
"}",
"being",
"configured",
".",
"The",
"<code",
">",
"defaultChannels<",
"/",
"code",
">",
"will",
"be",
"validated",
"to",
"ensure",
"they",
"exist",
"in",
"the",
"{",
"@link",
... | train | https://github.com/spring-projects/spring-flex/blob/85f2bff300d74e2d77d565f97a09d12d18e19adc/spring-flex-core/src/main/java/org/springframework/flex/core/AbstractServiceConfigProcessor.java#L166-L174 |
powermock/powermock | powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java | WhiteboxImpl.setInternalStateFromContext | public static void setInternalStateFromContext(Object object, Object context, Object[] additionalContexts) {
"""
Set the values of multiple instance fields defined in a context using
reflection. The values in the context will be assigned to values on the
{@code instance}. This method will traverse the class hier... | java | public static void setInternalStateFromContext(Object object, Object context, Object[] additionalContexts) {
setInternalStateFromContext(object, context, FieldMatchingStrategy.MATCHING);
if (additionalContexts != null && additionalContexts.length > 0) {
for (Object additionContext : addition... | [
"public",
"static",
"void",
"setInternalStateFromContext",
"(",
"Object",
"object",
",",
"Object",
"context",
",",
"Object",
"[",
"]",
"additionalContexts",
")",
"{",
"setInternalStateFromContext",
"(",
"object",
",",
"context",
",",
"FieldMatchingStrategy",
".",
"M... | Set the values of multiple instance fields defined in a context using
reflection. The values in the context will be assigned to values on the
{@code instance}. This method will traverse the class hierarchy when
searching for the fields. Example usage:
Given:
<pre>
public class MyContext {
private String myString = &q... | [
"Set",
"the",
"values",
"of",
"multiple",
"instance",
"fields",
"defined",
"in",
"a",
"context",
"using",
"reflection",
".",
"The",
"values",
"in",
"the",
"context",
"will",
"be",
"assigned",
"to",
"values",
"on",
"the",
"{",
"@code",
"instance",
"}",
".",... | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java#L2467-L2474 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java | SqlQueryStatement.appendBetweenCriteria | private void appendBetweenCriteria(TableAlias alias, PathInfo pathInfo, BetweenCriteria c, StringBuffer buf) {
"""
Answer the SQL-Clause for a BetweenCriteria
@param alias
@param pathInfo
@param c BetweenCriteria
@param buf
"""
appendColName(alias, pathInfo, c.isTranslateAttribute(), buf);
... | java | private void appendBetweenCriteria(TableAlias alias, PathInfo pathInfo, BetweenCriteria c, StringBuffer buf)
{
appendColName(alias, pathInfo, c.isTranslateAttribute(), buf);
buf.append(c.getClause());
appendParameter(c.getValue(), buf);
buf.append(" AND ");
appendParame... | [
"private",
"void",
"appendBetweenCriteria",
"(",
"TableAlias",
"alias",
",",
"PathInfo",
"pathInfo",
",",
"BetweenCriteria",
"c",
",",
"StringBuffer",
"buf",
")",
"{",
"appendColName",
"(",
"alias",
",",
"pathInfo",
",",
"c",
".",
"isTranslateAttribute",
"(",
")... | Answer the SQL-Clause for a BetweenCriteria
@param alias
@param pathInfo
@param c BetweenCriteria
@param buf | [
"Answer",
"the",
"SQL",
"-",
"Clause",
"for",
"a",
"BetweenCriteria"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java#L698-L705 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.updateApiKey | public JSONObject updateApiKey(String key, List<String> acls, int validity, int maxQueriesPerIPPerHour, int maxHitsPerQuery, RequestOptions requestOptions) throws AlgoliaException {
"""
Update an api key
@param acls the list of ACL for this key. Defined by an array of strings that
can contain... | java | public JSONObject updateApiKey(String key, List<String> acls, int validity, int maxQueriesPerIPPerHour, int maxHitsPerQuery, RequestOptions requestOptions) throws AlgoliaException {
try {
JSONObject jsonObject = generateUpdateUser(acls, validity, maxQueriesPerIPPerHour, maxHitsPerQuery);
return updateAp... | [
"public",
"JSONObject",
"updateApiKey",
"(",
"String",
"key",
",",
"List",
"<",
"String",
">",
"acls",
",",
"int",
"validity",
",",
"int",
"maxQueriesPerIPPerHour",
",",
"int",
"maxHitsPerQuery",
",",
"RequestOptions",
"requestOptions",
")",
"throws",
"AlgoliaExce... | Update an api key
@param acls the list of ACL for this key. Defined by an array of strings that
can contains the following values:
- search: allow to search (https and http)
- addObject: allows to add/update an object in the index (https only)
- deleteObject : allows to delete an existing object (htt... | [
"Update",
"an",
"api",
"key"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L1263-L1270 |
alkacon/opencms-core | src/org/opencms/site/CmsSiteManagerImpl.java | CmsSiteManagerImpl.setSiteMatcherSites | private void setSiteMatcherSites(Map<CmsSiteMatcher, CmsSite> siteMatcherSites) {
"""
Sets the class member variables {@link #m_siteMatcherSites} and {@link #m_siteMatchers}
from the provided map of configured site matchers.<p>
@param siteMatcherSites the site matches to set
"""
m_siteMatcherSite... | java | private void setSiteMatcherSites(Map<CmsSiteMatcher, CmsSite> siteMatcherSites) {
m_siteMatcherSites = Collections.unmodifiableMap(siteMatcherSites);
m_siteMatchers = Collections.unmodifiableList(new ArrayList<CmsSiteMatcher>(m_siteMatcherSites.keySet()));
} | [
"private",
"void",
"setSiteMatcherSites",
"(",
"Map",
"<",
"CmsSiteMatcher",
",",
"CmsSite",
">",
"siteMatcherSites",
")",
"{",
"m_siteMatcherSites",
"=",
"Collections",
".",
"unmodifiableMap",
"(",
"siteMatcherSites",
")",
";",
"m_siteMatchers",
"=",
"Collections",
... | Sets the class member variables {@link #m_siteMatcherSites} and {@link #m_siteMatchers}
from the provided map of configured site matchers.<p>
@param siteMatcherSites the site matches to set | [
"Sets",
"the",
"class",
"member",
"variables",
"{",
"@link",
"#m_siteMatcherSites",
"}",
"and",
"{",
"@link",
"#m_siteMatchers",
"}",
"from",
"the",
"provided",
"map",
"of",
"configured",
"site",
"matchers",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/site/CmsSiteManagerImpl.java#L1802-L1806 |
EdwardRaff/JSAT | JSAT/src/jsat/math/Complex.java | Complex.cMul | public static void cMul(double a, double b, double c, double d, double[] results) {
"""
Performs a complex multiplication
@param a the real part of the first number
@param b the imaginary part of the first number
@param c the real part of the second number
@param d the imaginary part of the second number
@p... | java | public static void cMul(double a, double b, double c, double d, double[] results)
{
results[0] = a*c-b*d;
results[1] = b*c+a*d;
} | [
"public",
"static",
"void",
"cMul",
"(",
"double",
"a",
",",
"double",
"b",
",",
"double",
"c",
",",
"double",
"d",
",",
"double",
"[",
"]",
"results",
")",
"{",
"results",
"[",
"0",
"]",
"=",
"a",
"*",
"c",
"-",
"b",
"*",
"d",
";",
"results",
... | Performs a complex multiplication
@param a the real part of the first number
@param b the imaginary part of the first number
@param c the real part of the second number
@param d the imaginary part of the second number
@param results an array to store the real and imaginary results in. First index is the real, 2nd is t... | [
"Performs",
"a",
"complex",
"multiplication"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/math/Complex.java#L145-L149 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/function/Bessel.java | Bessel.Y | public static double Y(int n, double x) {
"""
Bessel function of the second kind, of order n.
@param n Order.
@param x Value.
@return Y value.
"""
double by, bym, byp, tox;
if (n == 0) return Y0(x);
if (n == 1) return Y(x);
tox = 2.0 / x;
by = Y(x);
... | java | public static double Y(int n, double x) {
double by, bym, byp, tox;
if (n == 0) return Y0(x);
if (n == 1) return Y(x);
tox = 2.0 / x;
by = Y(x);
bym = Y0(x);
for (int j = 1; j < n; j++) {
byp = j * tox * by - bym;
bym = by;
... | [
"public",
"static",
"double",
"Y",
"(",
"int",
"n",
",",
"double",
"x",
")",
"{",
"double",
"by",
",",
"bym",
",",
"byp",
",",
"tox",
";",
"if",
"(",
"n",
"==",
"0",
")",
"return",
"Y0",
"(",
"x",
")",
";",
"if",
"(",
"n",
"==",
"1",
")",
... | Bessel function of the second kind, of order n.
@param n Order.
@param x Value.
@return Y value. | [
"Bessel",
"function",
"of",
"the",
"second",
"kind",
"of",
"order",
"n",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/function/Bessel.java#L253-L268 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/authentication/authenticationnegotiatepolicy_binding.java | authenticationnegotiatepolicy_binding.get | public static authenticationnegotiatepolicy_binding get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch authenticationnegotiatepolicy_binding resource of given name .
"""
authenticationnegotiatepolicy_binding obj = new authenticationnegotiatepolicy_binding();
obj.set_name(n... | java | public static authenticationnegotiatepolicy_binding get(nitro_service service, String name) throws Exception{
authenticationnegotiatepolicy_binding obj = new authenticationnegotiatepolicy_binding();
obj.set_name(name);
authenticationnegotiatepolicy_binding response = (authenticationnegotiatepolicy_binding) obj.ge... | [
"public",
"static",
"authenticationnegotiatepolicy_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"authenticationnegotiatepolicy_binding",
"obj",
"=",
"new",
"authenticationnegotiatepolicy_binding",
"(",
")",
";",
... | Use this API to fetch authenticationnegotiatepolicy_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"authenticationnegotiatepolicy_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/authentication/authenticationnegotiatepolicy_binding.java#L103-L108 |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/io/socket/SocketUtils.java | SocketUtils.findAvailableTcpPort | public static int findAvailableTcpPort(int minPortRange, int maxPortRange) {
"""
Finds an available TCP port.
@param minPortRange The minimum port range
@param maxPortRange The maximum port range
@return The available port
"""
ArgumentUtils.check(() -> minPortRange > MIN_PORT_RANGE)
.o... | java | public static int findAvailableTcpPort(int minPortRange, int maxPortRange) {
ArgumentUtils.check(() -> minPortRange > MIN_PORT_RANGE)
.orElseFail("Port minimum value must be greater than " + MIN_PORT_RANGE);
ArgumentUtils.check(() -> maxPortRange >= minPortRange)
.orElseFail("Max... | [
"public",
"static",
"int",
"findAvailableTcpPort",
"(",
"int",
"minPortRange",
",",
"int",
"maxPortRange",
")",
"{",
"ArgumentUtils",
".",
"check",
"(",
"(",
")",
"->",
"minPortRange",
">",
"MIN_PORT_RANGE",
")",
".",
"orElseFail",
"(",
"\"Port minimum value must ... | Finds an available TCP port.
@param minPortRange The minimum port range
@param maxPortRange The maximum port range
@return The available port | [
"Finds",
"an",
"available",
"TCP",
"port",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/io/socket/SocketUtils.java#L67-L80 |
elki-project/elki | elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/datasource/bundle/BundleWriter.java | BundleWriter.flushBuffer | private void flushBuffer(ByteBuffer buffer, WritableByteChannel output) throws IOException {
"""
Flush the current write buffer to disk.
@param buffer Buffer to write
@param output Output channel
@throws IOException on IO errors
"""
buffer.flip();
output.write(buffer);
buffer.flip();
buffe... | java | private void flushBuffer(ByteBuffer buffer, WritableByteChannel output) throws IOException {
buffer.flip();
output.write(buffer);
buffer.flip();
buffer.limit(buffer.capacity());
} | [
"private",
"void",
"flushBuffer",
"(",
"ByteBuffer",
"buffer",
",",
"WritableByteChannel",
"output",
")",
"throws",
"IOException",
"{",
"buffer",
".",
"flip",
"(",
")",
";",
"output",
".",
"write",
"(",
"buffer",
")",
";",
"buffer",
".",
"flip",
"(",
")",
... | Flush the current write buffer to disk.
@param buffer Buffer to write
@param output Output channel
@throws IOException on IO errors | [
"Flush",
"the",
"current",
"write",
"buffer",
"to",
"disk",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/datasource/bundle/BundleWriter.java#L126-L131 |
alkacon/opencms-core | src/org/opencms/ui/apps/CmsWorkplaceAppManager.java | CmsWorkplaceAppManager.getEditorForResource | public I_CmsEditor getEditorForResource(CmsResource resource, boolean plainText) {
"""
Returns the editor for the given resource.<p>
@param resource the resource to edit
@param plainText if plain text editing is required
@return the editor
"""
List<I_CmsEditor> editors = new ArrayList<I_CmsEdit... | java | public I_CmsEditor getEditorForResource(CmsResource resource, boolean plainText) {
List<I_CmsEditor> editors = new ArrayList<I_CmsEditor>();
for (int i = 0; i < EDITORS.length; i++) {
if (EDITORS[i].matchesResource(resource, plainText)) {
editors.add(EDITORS[i]);
... | [
"public",
"I_CmsEditor",
"getEditorForResource",
"(",
"CmsResource",
"resource",
",",
"boolean",
"plainText",
")",
"{",
"List",
"<",
"I_CmsEditor",
">",
"editors",
"=",
"new",
"ArrayList",
"<",
"I_CmsEditor",
">",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
... | Returns the editor for the given resource.<p>
@param resource the resource to edit
@param plainText if plain text editing is required
@return the editor | [
"Returns",
"the",
"editor",
"for",
"the",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/CmsWorkplaceAppManager.java#L467-L489 |
super-csv/super-csv | super-csv/src/main/java/org/supercsv/exception/SuperCsvCellProcessorException.java | SuperCsvCellProcessorException.getUnexpectedTypeMessage | private static String getUnexpectedTypeMessage(final Class<?> expectedType, final Object actualValue) {
"""
Assembles the exception message when the value received by a CellProcessor isn't of the correct type.
@param expectedType
the expected type
@param actualValue
the value received by the CellProcessor
@... | java | private static String getUnexpectedTypeMessage(final Class<?> expectedType, final Object actualValue) {
if( expectedType == null ) {
throw new NullPointerException("expectedType should not be null");
}
String expectedClassName = expectedType.getName();
String actualClassName = (actualValue != null) ? actualV... | [
"private",
"static",
"String",
"getUnexpectedTypeMessage",
"(",
"final",
"Class",
"<",
"?",
">",
"expectedType",
",",
"final",
"Object",
"actualValue",
")",
"{",
"if",
"(",
"expectedType",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\... | Assembles the exception message when the value received by a CellProcessor isn't of the correct type.
@param expectedType
the expected type
@param actualValue
the value received by the CellProcessor
@return the message
@throws NullPointerException
if expectedType is null | [
"Assembles",
"the",
"exception",
"message",
"when",
"the",
"value",
"received",
"by",
"a",
"CellProcessor",
"isn",
"t",
"of",
"the",
"correct",
"type",
"."
] | train | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/exception/SuperCsvCellProcessorException.java#L97-L104 |
apache/flink | flink-core/src/main/java/org/apache/flink/util/AbstractCloseableRegistry.java | AbstractCloseableRegistry.unregisterCloseable | public final boolean unregisterCloseable(C closeable) {
"""
Removes a {@link Closeable} from the registry.
@param closeable instance to remove from the registry.
@return true if the closeable was previously registered and became unregistered through this call.
"""
if (null == closeable) {
return fals... | java | public final boolean unregisterCloseable(C closeable) {
if (null == closeable) {
return false;
}
synchronized (getSynchronizationLock()) {
return doUnRegister(closeable, closeableToRef);
}
} | [
"public",
"final",
"boolean",
"unregisterCloseable",
"(",
"C",
"closeable",
")",
"{",
"if",
"(",
"null",
"==",
"closeable",
")",
"{",
"return",
"false",
";",
"}",
"synchronized",
"(",
"getSynchronizationLock",
"(",
")",
")",
"{",
"return",
"doUnRegister",
"(... | Removes a {@link Closeable} from the registry.
@param closeable instance to remove from the registry.
@return true if the closeable was previously registered and became unregistered through this call. | [
"Removes",
"a",
"{",
"@link",
"Closeable",
"}",
"from",
"the",
"registry",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/AbstractCloseableRegistry.java#L94-L103 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java | BoxApiBookmark.getRenameRequest | public BoxRequestsBookmark.UpdateBookmark getRenameRequest(String id, String newName) {
"""
Gets a request that renames a bookmark
@param id id of bookmark to rename
@param newName id of bookmark to retrieve info on
@return request to rename a bookmark
"""
BoxRequestsBookmark.UpdateB... | java | public BoxRequestsBookmark.UpdateBookmark getRenameRequest(String id, String newName) {
BoxRequestsBookmark.UpdateBookmark request = new BoxRequestsBookmark.UpdateBookmark(id, getBookmarkInfoUrl(id), mSession);
request.setName(newName);
return request;
} | [
"public",
"BoxRequestsBookmark",
".",
"UpdateBookmark",
"getRenameRequest",
"(",
"String",
"id",
",",
"String",
"newName",
")",
"{",
"BoxRequestsBookmark",
".",
"UpdateBookmark",
"request",
"=",
"new",
"BoxRequestsBookmark",
".",
"UpdateBookmark",
"(",
"id",
",",
"g... | Gets a request that renames a bookmark
@param id id of bookmark to rename
@param newName id of bookmark to retrieve info on
@return request to rename a bookmark | [
"Gets",
"a",
"request",
"that",
"renames",
"a",
"bookmark"
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java#L120-L124 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java | CassandraSchemaManager.onSetComment | private void onSetComment(CfDef cfDef, Properties cfProperties, StringBuilder builder) {
"""
On set comment.
@param cfDef
the cf def
@param cfProperties
the cf properties
@param builder
the builder
"""
String comment = cfProperties.getProperty(CassandraConstants.COMMENT);
if (comment !=... | java | private void onSetComment(CfDef cfDef, Properties cfProperties, StringBuilder builder)
{
String comment = cfProperties.getProperty(CassandraConstants.COMMENT);
if (comment != null)
{
if (builder != null)
{
String comment_Str = CQLTranslator.getKeyword(... | [
"private",
"void",
"onSetComment",
"(",
"CfDef",
"cfDef",
",",
"Properties",
"cfProperties",
",",
"StringBuilder",
"builder",
")",
"{",
"String",
"comment",
"=",
"cfProperties",
".",
"getProperty",
"(",
"CassandraConstants",
".",
"COMMENT",
")",
";",
"if",
"(",
... | On set comment.
@param cfDef
the cf def
@param cfProperties
the cf properties
@param builder
the builder | [
"On",
"set",
"comment",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java#L2564-L2585 |
feroult/yawp | yawp-core/src/main/java/io/yawp/commons/utils/ResourceFinder.java | ResourceFinder.mapAvailableStrings | public Map<String, String> mapAvailableStrings(String uri) throws IOException {
"""
Reads the contents of all non-directory URLs immediately under the specified
location and returns them in a map keyed by the file name.
<p/>
Individual URLs that cannot be read are skipped and added to the
list of 'resourcesNot... | java | public Map<String, String> mapAvailableStrings(String uri) throws IOException {
resourcesNotLoaded.clear();
Map<String, String> strings = new HashMap<>();
Map<String, URL> resourcesMap = getResourcesMap(uri);
for (Iterator iterator = resourcesMap.entrySet().iterator(); iterator.hasNext()... | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"mapAvailableStrings",
"(",
"String",
"uri",
")",
"throws",
"IOException",
"{",
"resourcesNotLoaded",
".",
"clear",
"(",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"strings",
"=",
"new",
"HashMap... | Reads the contents of all non-directory URLs immediately under the specified
location and returns them in a map keyed by the file name.
<p/>
Individual URLs that cannot be read are skipped and added to the
list of 'resourcesNotLoaded'
<p/>
Example classpath:
<p/>
META-INF/serializables/one
META-INF/serializables/two ... | [
"Reads",
"the",
"contents",
"of",
"all",
"non",
"-",
"directory",
"URLs",
"immediately",
"under",
"the",
"specified",
"location",
"and",
"returns",
"them",
"in",
"a",
"map",
"keyed",
"by",
"the",
"file",
"name",
".",
"<p",
"/",
">",
"Individual",
"URLs",
... | train | https://github.com/feroult/yawp/blob/b90deb905edd3fdb3009a5525e310cd17ead7f3d/yawp-core/src/main/java/io/yawp/commons/utils/ResourceFinder.java#L273-L289 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/grails/orm/HibernateCriteriaBuilder.java | HibernateCriteriaBuilder.createAlias | public Criteria createAlias(String associationPath, String alias, int joinType) {
"""
Join an association using the specified join-type, assigning an alias
to the joined association.
The joinType is expected to be one of CriteriaSpecification.INNER_JOIN (the default),
CriteriaSpecificationFULL_JOIN, or Criteria... | java | public Criteria createAlias(String associationPath, String alias, int joinType) {
return criteria.createAlias(associationPath, alias, JoinType.parse(joinType));
} | [
"public",
"Criteria",
"createAlias",
"(",
"String",
"associationPath",
",",
"String",
"alias",
",",
"int",
"joinType",
")",
"{",
"return",
"criteria",
".",
"createAlias",
"(",
"associationPath",
",",
"alias",
",",
"JoinType",
".",
"parse",
"(",
"joinType",
")"... | Join an association using the specified join-type, assigning an alias
to the joined association.
The joinType is expected to be one of CriteriaSpecification.INNER_JOIN (the default),
CriteriaSpecificationFULL_JOIN, or CriteriaSpecificationLEFT_JOIN.
@param associationPath A dot-seperated property path
@param alias ... | [
"Join",
"an",
"association",
"using",
"the",
"specified",
"join",
"-",
"type",
"assigning",
"an",
"alias",
"to",
"the",
"joined",
"association",
".",
"The",
"joinType",
"is",
"expected",
"to",
"be",
"one",
"of",
"CriteriaSpecification",
".",
"INNER_JOIN",
"(",... | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/grails/orm/HibernateCriteriaBuilder.java#L139-L141 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/LonePairElectronChecker.java | LonePairElectronChecker.isSaturated | public boolean isSaturated(IAtom atom, IAtomContainer ac) throws CDKException {
"""
Checks if an Atom is saturated their lone pair electrons
by comparing it with known AtomTypes.
@return True, if it's right saturated
"""
createAtomTypeFactory(ac.getBuilder());
IAtomType atomType = fac... | java | public boolean isSaturated(IAtom atom, IAtomContainer ac) throws CDKException {
createAtomTypeFactory(ac.getBuilder());
IAtomType atomType = factory.getAtomType(atom.getAtomTypeName());
int lpCount = (Integer) atomType.getProperty(CDKConstants.LONE_PAIR_COUNT);
int foundLPCount = ac.getC... | [
"public",
"boolean",
"isSaturated",
"(",
"IAtom",
"atom",
",",
"IAtomContainer",
"ac",
")",
"throws",
"CDKException",
"{",
"createAtomTypeFactory",
"(",
"ac",
".",
"getBuilder",
"(",
")",
")",
";",
"IAtomType",
"atomType",
"=",
"factory",
".",
"getAtomType",
"... | Checks if an Atom is saturated their lone pair electrons
by comparing it with known AtomTypes.
@return True, if it's right saturated | [
"Checks",
"if",
"an",
"Atom",
"is",
"saturated",
"their",
"lone",
"pair",
"electrons",
"by",
"comparing",
"it",
"with",
"known",
"AtomTypes",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/LonePairElectronChecker.java#L80-L86 |
samskivert/samskivert | src/main/java/com/samskivert/util/PropertiesUtil.java | PropertiesUtil.getSubProperties | public static Properties getSubProperties (Properties source, String prefix) {
"""
Extracts all properties from the supplied properties object with the specified prefix,
removes the prefix from the key for those properties and inserts them into a new properties
object which is then returned. This is useful for e... | java | public static Properties getSubProperties (Properties source, String prefix)
{
Properties dest = new Properties();
extractSubProperties(source, dest, prefix);
return dest;
} | [
"public",
"static",
"Properties",
"getSubProperties",
"(",
"Properties",
"source",
",",
"String",
"prefix",
")",
"{",
"Properties",
"dest",
"=",
"new",
"Properties",
"(",
")",
";",
"extractSubProperties",
"(",
"source",
",",
"dest",
",",
"prefix",
")",
";",
... | Extracts all properties from the supplied properties object with the specified prefix,
removes the prefix from the key for those properties and inserts them into a new properties
object which is then returned. This is useful for extracting properties from a global
configuration object that must be passed to a service t... | [
"Extracts",
"all",
"properties",
"from",
"the",
"supplied",
"properties",
"object",
"with",
"the",
"specified",
"prefix",
"removes",
"the",
"prefix",
"from",
"the",
"key",
"for",
"those",
"properties",
"and",
"inserts",
"them",
"into",
"a",
"new",
"properties",
... | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/PropertiesUtil.java#L53-L58 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/EntityDTO.java | EntityDTO.createDtoObject | public static <D extends EntityDTO, E extends JPAEntity> D createDtoObject(Class<D> clazz, E entity) {
"""
Creates BaseDto object and copies properties from entity object.
@param <D> BaseDto object type.
@param <E> Entity type.
@param clazz BaseDto entity class.
@param entity entity object... | java | public static <D extends EntityDTO, E extends JPAEntity> D createDtoObject(Class<D> clazz, E entity) {
D result = null;
try {
result = clazz.newInstance();
BeanUtils.copyProperties(result, entity);
// Now set IDs of JPA entity
result.setCreatedById(entit... | [
"public",
"static",
"<",
"D",
"extends",
"EntityDTO",
",",
"E",
"extends",
"JPAEntity",
">",
"D",
"createDtoObject",
"(",
"Class",
"<",
"D",
">",
"clazz",
",",
"E",
"entity",
")",
"{",
"D",
"result",
"=",
"null",
";",
"try",
"{",
"result",
"=",
"claz... | Creates BaseDto object and copies properties from entity object.
@param <D> BaseDto object type.
@param <E> Entity type.
@param clazz BaseDto entity class.
@param entity entity object.
@return BaseDto object.
@throws WebApplicationException The exception with 500 status will be thrown. | [
"Creates",
"BaseDto",
"object",
"and",
"copies",
"properties",
"from",
"entity",
"object",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/EntityDTO.java#L72-L86 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_IsValidReason.java | ST_IsValidReason.isValidReason | public static String isValidReason(Geometry geometry, int flag) {
"""
Returns text stating whether a geometry is valid.
If not, returns a reason why.
@param geometry
@param flag
@return
"""
if (geometry != null) {
if (flag == 0) {
return validReason(geometry, false);
... | java | public static String isValidReason(Geometry geometry, int flag) {
if (geometry != null) {
if (flag == 0) {
return validReason(geometry, false);
} else if (flag == 1) {
return validReason(geometry, true);
} else {
throw new Illeg... | [
"public",
"static",
"String",
"isValidReason",
"(",
"Geometry",
"geometry",
",",
"int",
"flag",
")",
"{",
"if",
"(",
"geometry",
"!=",
"null",
")",
"{",
"if",
"(",
"flag",
"==",
"0",
")",
"{",
"return",
"validReason",
"(",
"geometry",
",",
"false",
")"... | Returns text stating whether a geometry is valid.
If not, returns a reason why.
@param geometry
@param flag
@return | [
"Returns",
"text",
"stating",
"whether",
"a",
"geometry",
"is",
"valid",
".",
"If",
"not",
"returns",
"a",
"reason",
"why",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_IsValidReason.java#L67-L78 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/os/BundleUtils.java | BundleUtils.optBundle | @Nullable
public static Bundle optBundle(@Nullable Bundle bundle, @Nullable String key) {
"""
Returns a optional {@link android.os.Bundle} value. In other words, returns the value mapped by key if it exists and is a {@link android.os.Bundle}.
The bundle argument is allowed to be {@code null}. If the bundle is... | java | @Nullable
public static Bundle optBundle(@Nullable Bundle bundle, @Nullable String key) {
return optBundle(bundle, key, new Bundle());
} | [
"@",
"Nullable",
"public",
"static",
"Bundle",
"optBundle",
"(",
"@",
"Nullable",
"Bundle",
"bundle",
",",
"@",
"Nullable",
"String",
"key",
")",
"{",
"return",
"optBundle",
"(",
"bundle",
",",
"key",
",",
"new",
"Bundle",
"(",
")",
")",
";",
"}"
] | Returns a optional {@link android.os.Bundle} value. In other words, returns the value mapped by key if it exists and is a {@link android.os.Bundle}.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns null.
@param bundle a bundle. If the bundle is null, this method will return ... | [
"Returns",
"a",
"optional",
"{"
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/os/BundleUtils.java#L183-L186 |
openbase/jul | pattern/default/src/main/java/org/openbase/jul/pattern/CompletableFutureLite.java | CompletableFutureLite.get | @Override
public V get() throws InterruptedException, ExecutionException {
"""
Method blocks until the future is done. The method return the result if the future was normally completed.
If the future was exceptionally completed or canceled an exception is thrown.
@return the result of the task.
@throws ... | java | @Override
public V get() throws InterruptedException, ExecutionException {
synchronized (lock) {
if (value != null) {
return value;
}
lock.wait();
if (value != null) {
return value;
}
if (throwable != n... | [
"@",
"Override",
"public",
"V",
"get",
"(",
")",
"throws",
"InterruptedException",
",",
"ExecutionException",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"return",
"value",
";",
"}",
"lock",
".",
"wait",
"(",
... | Method blocks until the future is done. The method return the result if the future was normally completed.
If the future was exceptionally completed or canceled an exception is thrown.
@return the result of the task.
@throws InterruptedException is thrown if the thread was externally interrupted.
@throws ExecutionExc... | [
"Method",
"blocks",
"until",
"the",
"future",
"is",
"done",
".",
"The",
"method",
"return",
"the",
"result",
"if",
"the",
"future",
"was",
"normally",
"completed",
".",
"If",
"the",
"future",
"was",
"exceptionally",
"completed",
"or",
"canceled",
"an",
"exce... | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/pattern/default/src/main/java/org/openbase/jul/pattern/CompletableFutureLite.java#L150-L167 |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/photos/PhotosInterface.java | PhotosInterface.setMeta | public void setMeta(String photoId, String title, String description) throws FlickrException {
"""
Set the meta data for the photo.
This method requires authentication with 'write' permission.
@param photoId
The photo ID
@param title
The new title
@param description
The new description
@throws FlickrEx... | java | public void setMeta(String photoId, String title, String description) throws FlickrException {
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("method", METHOD_SET_META);
parameters.put("photo_id", photoId);
parameters.put("title", title);
pa... | [
"public",
"void",
"setMeta",
"(",
"String",
"photoId",
",",
"String",
"title",
",",
"String",
"description",
")",
"throws",
"FlickrException",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
... | Set the meta data for the photo.
This method requires authentication with 'write' permission.
@param photoId
The photo ID
@param title
The new title
@param description
The new description
@throws FlickrException | [
"Set",
"the",
"meta",
"data",
"for",
"the",
"photo",
"."
] | train | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/photos/PhotosInterface.java#L1201-L1213 |
tcurdt/jdeb | src/main/java/org/vafer/jdeb/ControlBuilder.java | ControlBuilder.createPackageControlFile | public BinaryPackageControlFile createPackageControlFile(File file, BigInteger pDataSize) throws IOException, ParseException {
"""
Creates a package control file from the specified file and adds the
<tt>Date</tt>, <tt>Distribution</tt> and <tt>Urgency</tt> fields if missing.
The <tt>Installed-Size</tt> field is ... | java | public BinaryPackageControlFile createPackageControlFile(File file, BigInteger pDataSize) throws IOException, ParseException {
FilteredFile controlFile = new FilteredFile(new FileInputStream(file), resolver);
BinaryPackageControlFile packageControlFile = new BinaryPackageControlFile(controlFile.toString... | [
"public",
"BinaryPackageControlFile",
"createPackageControlFile",
"(",
"File",
"file",
",",
"BigInteger",
"pDataSize",
")",
"throws",
"IOException",
",",
"ParseException",
"{",
"FilteredFile",
"controlFile",
"=",
"new",
"FilteredFile",
"(",
"new",
"FileInputStream",
"("... | Creates a package control file from the specified file and adds the
<tt>Date</tt>, <tt>Distribution</tt> and <tt>Urgency</tt> fields if missing.
The <tt>Installed-Size</tt> field is also initialized to the actual size of
the package. The <tt>Maintainer</tt> field is overridden by the <tt>DEBEMAIL</tt>
and <tt>DEBFULLNA... | [
"Creates",
"a",
"package",
"control",
"file",
"from",
"the",
"specified",
"file",
"and",
"adds",
"the",
"<tt",
">",
"Date<",
"/",
"tt",
">",
"<tt",
">",
"Distribution<",
"/",
"tt",
">",
"and",
"<tt",
">",
"Urgency<",
"/",
"tt",
">",
"fields",
"if",
"... | train | https://github.com/tcurdt/jdeb/blob/b899a7b1b3391356aafc491ab601f258961f67f0/src/main/java/org/vafer/jdeb/ControlBuilder.java#L173-L206 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/VMCommandLine.java | VMCommandLine.saveVMParameters | @Inline(value = "VMCommandLine.saveVMParameters((($1) != null) ? ($1).getCanonicalName() : null, ($2))",
imported = {
"""
Save parameters that permit to relaunch a VM with
{@link #relaunchVM()}.
@param classToLaunch is the class which contains a <code>main</code>.
@param parameters is the parameters to pas... | java | @Inline(value = "VMCommandLine.saveVMParameters((($1) != null) ? ($1).getCanonicalName() : null, ($2))",
imported = {VMCommandLine.class}, statementExpression = true)
public static void saveVMParameters(Class<?> classToLaunch, String... parameters) {
saveVMParameters(
(classToLaunch != null)
? classToL... | [
"@",
"Inline",
"(",
"value",
"=",
"\"VMCommandLine.saveVMParameters((($1) != null) ? ($1).getCanonicalName() : null, ($2))\"",
",",
"imported",
"=",
"{",
"VMCommandLine",
".",
"class",
"}",
",",
"statementExpression",
"=",
"true",
")",
"public",
"static",
"void",
"saveVMP... | Save parameters that permit to relaunch a VM with
{@link #relaunchVM()}.
@param classToLaunch is the class which contains a <code>main</code>.
@param parameters is the parameters to pass to the <code>main</code>. | [
"Save",
"parameters",
"that",
"permit",
"to",
"relaunch",
"a",
"VM",
"with",
"{",
"@link",
"#relaunchVM",
"()",
"}",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/VMCommandLine.java#L309-L316 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.serviceName_pca_pcaServiceName_PUT | public void serviceName_pca_pcaServiceName_PUT(String serviceName, String pcaServiceName, OvhAccount body) throws IOException {
"""
Alter this object properties
REST: PUT /cloud/{serviceName}/pca/{pcaServiceName}
@param body [required] New object properties
@param serviceName [required] The internal name of y... | java | public void serviceName_pca_pcaServiceName_PUT(String serviceName, String pcaServiceName, OvhAccount body) throws IOException {
String qPath = "/cloud/{serviceName}/pca/{pcaServiceName}";
StringBuilder sb = path(qPath, serviceName, pcaServiceName);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"serviceName_pca_pcaServiceName_PUT",
"(",
"String",
"serviceName",
",",
"String",
"pcaServiceName",
",",
"OvhAccount",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/{serviceName}/pca/{pcaServiceName}\"",
";",
"StringBuilder"... | Alter this object properties
REST: PUT /cloud/{serviceName}/pca/{pcaServiceName}
@param body [required] New object properties
@param serviceName [required] The internal name of your public cloud passport
@param pcaServiceName [required] The internal name of your PCA offer
@deprecated | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L2633-L2637 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/CommonG.java | CommonG.replaceJSONPathElement | public String replaceJSONPathElement(String jsonString, String key, String value) {
"""
The function searches over the array by certain field value,
and replaces occurences with the parameter provided.
@param jsonString Original json object
@param key Key to search
@param value Value to replace k... | java | public String replaceJSONPathElement(String jsonString, String key, String value) {
return JsonPath.parse(jsonString).set(key, value).jsonString();
} | [
"public",
"String",
"replaceJSONPathElement",
"(",
"String",
"jsonString",
",",
"String",
"key",
",",
"String",
"value",
")",
"{",
"return",
"JsonPath",
".",
"parse",
"(",
"jsonString",
")",
".",
"set",
"(",
"key",
",",
"value",
")",
".",
"jsonString",
"("... | The function searches over the array by certain field value,
and replaces occurences with the parameter provided.
@param jsonString Original json object
@param key Key to search
@param value Value to replace key with | [
"The",
"function",
"searches",
"over",
"the",
"array",
"by",
"certain",
"field",
"value",
"and",
"replaces",
"occurences",
"with",
"the",
"parameter",
"provided",
"."
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommonG.java#L1927-L1929 |
gotev/android-upload-service | uploadservice/src/main/java/net/gotev/uploadservice/MultipartUploadRequest.java | MultipartUploadRequest.addFileToUpload | public MultipartUploadRequest addFileToUpload(final String path, final String parameterName,
final String fileName)
throws FileNotFoundException, IllegalArgumentException {
"""
Adds a file to this upload request, without setting the content type, which ... | java | public MultipartUploadRequest addFileToUpload(final String path, final String parameterName,
final String fileName)
throws FileNotFoundException, IllegalArgumentException {
return addFileToUpload(path, parameterName, fileName, null);
} | [
"public",
"MultipartUploadRequest",
"addFileToUpload",
"(",
"final",
"String",
"path",
",",
"final",
"String",
"parameterName",
",",
"final",
"String",
"fileName",
")",
"throws",
"FileNotFoundException",
",",
"IllegalArgumentException",
"{",
"return",
"addFileToUpload",
... | Adds a file to this upload request, without setting the content type, which will be
automatically detected from the file extension. If you want to
manually set the content type, use {@link #addFileToUpload(String, String, String, String)}.
@param path Absolute path to the file that you want to upload
@param parameterNa... | [
"Adds",
"a",
"file",
"to",
"this",
"upload",
"request",
"without",
"setting",
"the",
"content",
"type",
"which",
"will",
"be",
"automatically",
"detected",
"from",
"the",
"file",
"extension",
".",
"If",
"you",
"want",
"to",
"manually",
"set",
"the",
"content... | train | https://github.com/gotev/android-upload-service/blob/0952fcbe4b32c100150ffd0a237de3be4942e0a8/uploadservice/src/main/java/net/gotev/uploadservice/MultipartUploadRequest.java#L135-L139 |
google/closure-compiler | src/com/google/javascript/jscomp/TypeInferencePass.java | TypeInferencePass.process | @Override
public void process(Node externsRoot, Node jsRoot) {
"""
Main entry point for type inference when running over the whole tree.
@param externsRoot The root of the externs parse tree.
@param jsRoot The root of the input parse tree to be checked.
"""
Node externsAndJs = jsRoot.getParent();
... | java | @Override
public void process(Node externsRoot, Node jsRoot) {
Node externsAndJs = jsRoot.getParent();
checkState(externsAndJs != null);
checkState(externsRoot == null || externsAndJs.hasChild(externsRoot));
inferAllScopes(externsAndJs);
} | [
"@",
"Override",
"public",
"void",
"process",
"(",
"Node",
"externsRoot",
",",
"Node",
"jsRoot",
")",
"{",
"Node",
"externsAndJs",
"=",
"jsRoot",
".",
"getParent",
"(",
")",
";",
"checkState",
"(",
"externsAndJs",
"!=",
"null",
")",
";",
"checkState",
"(",... | Main entry point for type inference when running over the whole tree.
@param externsRoot The root of the externs parse tree.
@param jsRoot The root of the input parse tree to be checked. | [
"Main",
"entry",
"point",
"for",
"type",
"inference",
"when",
"running",
"over",
"the",
"whole",
"tree",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeInferencePass.java#L61-L68 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/CopyableFile.java | CopyableFile.resolveReplicatedOwnerAndPermission | public static OwnerAndPermission resolveReplicatedOwnerAndPermission(FileSystem fs, Path path,
CopyConfiguration copyConfiguration) throws IOException {
"""
Computes the correct {@link OwnerAndPermission} obtained from replicating source owner and permissions and applying
the {@link PreserveAttributes} rule... | java | public static OwnerAndPermission resolveReplicatedOwnerAndPermission(FileSystem fs, Path path,
CopyConfiguration copyConfiguration) throws IOException {
PreserveAttributes preserve = copyConfiguration.getPreserve();
Optional<FileStatus> originFileStatus = copyConfiguration.getCopyContext().getFileStatus(... | [
"public",
"static",
"OwnerAndPermission",
"resolveReplicatedOwnerAndPermission",
"(",
"FileSystem",
"fs",
",",
"Path",
"path",
",",
"CopyConfiguration",
"copyConfiguration",
")",
"throws",
"IOException",
"{",
"PreserveAttributes",
"preserve",
"=",
"copyConfiguration",
".",
... | Computes the correct {@link OwnerAndPermission} obtained from replicating source owner and permissions and applying
the {@link PreserveAttributes} rules in copyConfiguration.
@throws IOException | [
"Computes",
"the",
"correct",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/CopyableFile.java#L307-L326 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPMeasurementUnitPersistenceImpl.java | CPMeasurementUnitPersistenceImpl.removeByG_P_T | @Override
public void removeByG_P_T(long groupId, boolean primary, int type) {
"""
Removes all the cp measurement units where groupId = ? and primary = ? and type = ? from the database.
@param groupId the group ID
@param primary the primary
@param type the type
"""
for (CPMeasurementUnit cp... | java | @Override
public void removeByG_P_T(long groupId, boolean primary, int type) {
for (CPMeasurementUnit cpMeasurementUnit : findByG_P_T(groupId,
primary, type, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(cpMeasurementUnit);
}
} | [
"@",
"Override",
"public",
"void",
"removeByG_P_T",
"(",
"long",
"groupId",
",",
"boolean",
"primary",
",",
"int",
"type",
")",
"{",
"for",
"(",
"CPMeasurementUnit",
"cpMeasurementUnit",
":",
"findByG_P_T",
"(",
"groupId",
",",
"primary",
",",
"type",
",",
"... | Removes all the cp measurement units where groupId = ? and primary = ? and type = ? from the database.
@param groupId the group ID
@param primary the primary
@param type the type | [
"Removes",
"all",
"the",
"cp",
"measurement",
"units",
"where",
"groupId",
"=",
"?",
";",
"and",
"primary",
"=",
"?",
";",
"and",
"type",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPMeasurementUnitPersistenceImpl.java#L3328-L3334 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/Flowable.java | Flowable.onBackpressureBuffer | @CheckReturnValue
@BackpressureSupport(BackpressureKind.SPECIAL)
@SchedulerSupport(SchedulerSupport.NONE)
public final Flowable<T> onBackpressureBuffer(int capacity, boolean delayError, boolean unbounded,
Action onOverflow) {
"""
Instructs a Publisher that is emitting items faster than its ... | java | @CheckReturnValue
@BackpressureSupport(BackpressureKind.SPECIAL)
@SchedulerSupport(SchedulerSupport.NONE)
public final Flowable<T> onBackpressureBuffer(int capacity, boolean delayError, boolean unbounded,
Action onOverflow) {
ObjectHelper.requireNonNull(onOverflow, "onOverflow is null");... | [
"@",
"CheckReturnValue",
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"SPECIAL",
")",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Flowable",
"<",
"T",
">",
"onBackpressureBuffer",
"(",
"int",
"capacity",
","... | Instructs a Publisher that is emitting items faster than its Subscriber can consume them to buffer up to
a given amount of items until they can be emitted. The resulting Publisher will signal
a {@code BufferOverflowException} via {@code onError} as soon as the buffer's capacity is exceeded, dropping all undelivered
ite... | [
"Instructs",
"a",
"Publisher",
"that",
"is",
"emitting",
"items",
"faster",
"than",
"its",
"Subscriber",
"can",
"consume",
"them",
"to",
"buffer",
"up",
"to",
"a",
"given",
"amount",
"of",
"items",
"until",
"they",
"can",
"be",
"emitted",
".",
"The",
"resu... | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Flowable.java#L11496-L11504 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/net/NetUtils.java | NetUtils.getInputStream | public static InputStream getInputStream(Socket socket, long timeout)
throws IOException {
"""
Returns InputStream for the socket. If the socket has an associated
SocketChannel then it returns a
{@link SocketInputStream} with the given timeout. If the socket does not
have a channel, {@link Socket#getInpu... | java | public static InputStream getInputStream(Socket socket, long timeout)
throws IOException {
return (socket.getChannel() == null) ?
socket.getInputStream() : new SocketInputStream(socket, timeout);
} | [
"public",
"static",
"InputStream",
"getInputStream",
"(",
"Socket",
"socket",
",",
"long",
"timeout",
")",
"throws",
"IOException",
"{",
"return",
"(",
"socket",
".",
"getChannel",
"(",
")",
"==",
"null",
")",
"?",
"socket",
".",
"getInputStream",
"(",
")",
... | Returns InputStream for the socket. If the socket has an associated
SocketChannel then it returns a
{@link SocketInputStream} with the given timeout. If the socket does not
have a channel, {@link Socket#getInputStream()} is returned. In the later
case, the timeout argument is ignored and the timeout set with
{@link Soc... | [
"Returns",
"InputStream",
"for",
"the",
"socket",
".",
"If",
"the",
"socket",
"has",
"an",
"associated",
"SocketChannel",
"then",
"it",
"returns",
"a",
"{",
"@link",
"SocketInputStream",
"}",
"with",
"the",
"given",
"timeout",
".",
"If",
"the",
"socket",
"do... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/net/NetUtils.java#L339-L343 |
katjahahn/PortEx | src/main/java/com/github/katjahahn/tools/visualizer/Visualizer.java | Visualizer.createEntropyImage | public BufferedImage createEntropyImage(File file) throws IOException {
"""
Creates an image of the local entropies of this file.
@param file
the PE file
@return image of local entropies
@throws IOException
if file can not be read
"""
resetAvailabilityFlags();
this.data = new PEData(null, null, null... | java | public BufferedImage createEntropyImage(File file) throws IOException {
resetAvailabilityFlags();
this.data = new PEData(null, null, null, null, null, file);
image = new BufferedImage(fileWidth, height, IMAGE_TYPE);
final int MIN_WINDOW_SIZE = 100;
// bytes to be read at once to calculate local entropy
fina... | [
"public",
"BufferedImage",
"createEntropyImage",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"resetAvailabilityFlags",
"(",
")",
";",
"this",
".",
"data",
"=",
"new",
"PEData",
"(",
"null",
",",
"null",
",",
"null",
",",
"null",
",",
"null",
",... | Creates an image of the local entropies of this file.
@param file
the PE file
@return image of local entropies
@throws IOException
if file can not be read | [
"Creates",
"an",
"image",
"of",
"the",
"local",
"entropies",
"of",
"this",
"file",
"."
] | train | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/tools/visualizer/Visualizer.java#L245-L274 |
google/error-prone | check_api/src/main/java/com/google/errorprone/matchers/Matchers.java | Matchers.hasArgumentWithValue | public static Matcher<AnnotationTree> hasArgumentWithValue(
String argumentName, Matcher<ExpressionTree> valueMatcher) {
"""
Matches an Annotation AST node if the argument to the annotation with the given name has a
value which matches the given matcher. For example, {@code hasArgumentWithValue("value",
st... | java | public static Matcher<AnnotationTree> hasArgumentWithValue(
String argumentName, Matcher<ExpressionTree> valueMatcher) {
return new AnnotationHasArgumentWithValue(argumentName, valueMatcher);
} | [
"public",
"static",
"Matcher",
"<",
"AnnotationTree",
">",
"hasArgumentWithValue",
"(",
"String",
"argumentName",
",",
"Matcher",
"<",
"ExpressionTree",
">",
"valueMatcher",
")",
"{",
"return",
"new",
"AnnotationHasArgumentWithValue",
"(",
"argumentName",
",",
"valueM... | Matches an Annotation AST node if the argument to the annotation with the given name has a
value which matches the given matcher. For example, {@code hasArgumentWithValue("value",
stringLiteral("one"))} matches {@code @Thing("one")} or {@code @Thing({"one", "two"})} or
{@code @Thing(value = "one")} | [
"Matches",
"an",
"Annotation",
"AST",
"node",
"if",
"the",
"argument",
"to",
"the",
"annotation",
"with",
"the",
"given",
"name",
"has",
"a",
"value",
"which",
"matches",
"the",
"given",
"matcher",
".",
"For",
"example",
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/matchers/Matchers.java#L717-L720 |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/CcgCategory.java | CcgCategory.fromSyntaxLf | public static CcgCategory fromSyntaxLf(HeadedSyntacticCategory cat, Expression2 lf) {
"""
Generates a CCG category with head and dependency information
automatically populated from the syntactic category and
logical form. The logical form itself is used as the semantic
head of the returned category.
@param c... | java | public static CcgCategory fromSyntaxLf(HeadedSyntacticCategory cat, Expression2 lf) {
String head = lf.toString();
head = head.replaceAll(" ", "_");
List<String> subjects = Lists.newArrayList();
List<Integer> argumentNums = Lists.newArrayList();
List<Integer> objects = Lists.newArrayList();
... | [
"public",
"static",
"CcgCategory",
"fromSyntaxLf",
"(",
"HeadedSyntacticCategory",
"cat",
",",
"Expression2",
"lf",
")",
"{",
"String",
"head",
"=",
"lf",
".",
"toString",
"(",
")",
";",
"head",
"=",
"head",
".",
"replaceAll",
"(",
"\" \"",
",",
"\"_\"",
"... | Generates a CCG category with head and dependency information
automatically populated from the syntactic category and
logical form. The logical form itself is used as the semantic
head of the returned category.
@param cat
@param logicalForm
@return | [
"Generates",
"a",
"CCG",
"category",
"with",
"head",
"and",
"dependency",
"information",
"automatically",
"populated",
"from",
"the",
"syntactic",
"category",
"and",
"logical",
"form",
".",
"The",
"logical",
"form",
"itself",
"is",
"used",
"as",
"the",
"semantic... | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/CcgCategory.java#L250-L273 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_serviceMonitoring_POST | public OvhServiceMonitoring serviceName_serviceMonitoring_POST(String serviceName, String challengeText, Boolean enabled, OvhMonitoringIntervalEnum interval, String ip, Long port, OvhMonitoringProtocolEnum protocol, String url) throws IOException {
"""
Add a new service monitoring
REST: POST /dedicated/server/{... | java | public OvhServiceMonitoring serviceName_serviceMonitoring_POST(String serviceName, String challengeText, Boolean enabled, OvhMonitoringIntervalEnum interval, String ip, Long port, OvhMonitoringProtocolEnum protocol, String url) throws IOException {
String qPath = "/dedicated/server/{serviceName}/serviceMonitoring";
... | [
"public",
"OvhServiceMonitoring",
"serviceName_serviceMonitoring_POST",
"(",
"String",
"serviceName",
",",
"String",
"challengeText",
",",
"Boolean",
"enabled",
",",
"OvhMonitoringIntervalEnum",
"interval",
",",
"String",
"ip",
",",
"Long",
"port",
",",
"OvhMonitoringProt... | Add a new service monitoring
REST: POST /dedicated/server/{serviceName}/serviceMonitoring
@param challengeText [required] The expected return
@param port [required] The service port to monitor
@param enabled [required] Is this service monitoring is enabled
@param protocol [required] The protocol to use
@param interval... | [
"Add",
"a",
"new",
"service",
"monitoring"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L2086-L2099 |
p6spy/p6spy | src/main/java/com/p6spy/engine/spy/appender/MultiLineFormat.java | MultiLineFormat.formatMessage | @Override
public String formatMessage(final int connectionId, final String now, final long elapsed, final String category, final String prepared, final String sql, final String url) {
"""
Formats a log message for the logging module
@param connectionId the id of the connection
@param now the current... | java | @Override
public String formatMessage(final int connectionId, final String now, final long elapsed, final String category, final String prepared, final String sql, final String url) {
return "#" + now + " | took " + elapsed + "ms | " + category + " | connection " + connectionId + "| url " + url + "\n" + prepared ... | [
"@",
"Override",
"public",
"String",
"formatMessage",
"(",
"final",
"int",
"connectionId",
",",
"final",
"String",
"now",
",",
"final",
"long",
"elapsed",
",",
"final",
"String",
"category",
",",
"final",
"String",
"prepared",
",",
"final",
"String",
"sql",
... | Formats a log message for the logging module
@param connectionId the id of the connection
@param now the current ime expressing in milliseconds
@param elapsed the time in milliseconds that the operation took to complete
@param category the category of the operation
@param prepared the SQL stateme... | [
"Formats",
"a",
"log",
"message",
"for",
"the",
"logging",
"module"
] | train | https://github.com/p6spy/p6spy/blob/c3c0fecd6e26156eecf90a90901c3c1c8a7dbdf2/src/main/java/com/p6spy/engine/spy/appender/MultiLineFormat.java#L38-L41 |
GerdHolz/TOVAL | src/de/invation/code/toval/validate/Validate.java | Validate.notNull | public static <O extends Object> void notNull(O o, String message) {
"""
Checks if the given object is <code>null</code>
@param o The object to validate.
@param message The error message to include in the Exception in case the validation fails.
@throws ParameterException if the given object is <code>null</code>... | java | public static <O extends Object> void notNull(O o, String message) {
if(!validation) return;
notNull(message);
if(o == null)
throw new ParameterException(ErrorCode.NULLPOINTER, message);
} | [
"public",
"static",
"<",
"O",
"extends",
"Object",
">",
"void",
"notNull",
"(",
"O",
"o",
",",
"String",
"message",
")",
"{",
"if",
"(",
"!",
"validation",
")",
"return",
";",
"notNull",
"(",
"message",
")",
";",
"if",
"(",
"o",
"==",
"null",
")",
... | Checks if the given object is <code>null</code>
@param o The object to validate.
@param message The error message to include in the Exception in case the validation fails.
@throws ParameterException if the given object is <code>null</code>. | [
"Checks",
"if",
"the",
"given",
"object",
"is",
"<code",
">",
"null<",
"/",
"code",
">"
] | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/validate/Validate.java#L42-L47 |
misha/iroh | src/main/java/com/github/msoliter/iroh/container/services/Injector.java | Injector.eagerlyInject | public void eagerlyInject(Object target, Field field) {
"""
Eagerly injects the target object's target field. Note that if the field
is marked for lazy injection, we still inject it, but with a "null"
reference. This reference is never seen by user code, and is used
internally by Iroh to detect when eager injec... | java | public void eagerlyInject(Object target, Field field) {
/**
* We only ever inject fields marked with the correct annotation.
*/
if (field.getAnnotation(Autowired.class) != null) {
field.setAccessible(true);
Autowired autowired = field.getAnnotation(A... | [
"public",
"void",
"eagerlyInject",
"(",
"Object",
"target",
",",
"Field",
"field",
")",
"{",
"/**\n * We only ever inject fields marked with the correct annotation.\n */",
"if",
"(",
"field",
".",
"getAnnotation",
"(",
"Autowired",
".",
"class",
")",
"!=",... | Eagerly injects the target object's target field. Note that if the field
is marked for lazy injection, we still inject it, but with a "null"
reference. This reference is never seen by user code, and is used
internally by Iroh to detect when eager injection has delegated the
injection process to lazy injection, thus pre... | [
"Eagerly",
"injects",
"the",
"target",
"object",
"s",
"target",
"field",
".",
"Note",
"that",
"if",
"the",
"field",
"is",
"marked",
"for",
"lazy",
"injection",
"we",
"still",
"inject",
"it",
"but",
"with",
"a",
"null",
"reference",
".",
"This",
"reference"... | train | https://github.com/misha/iroh/blob/5dc92a01d3b2f3ba63e8ad1bf9b5fe342d0b679a/src/main/java/com/github/msoliter/iroh/container/services/Injector.java#L75-L96 |
FlyingHe/UtilsMaven | src/main/java/com/github/flyinghe/tools/CommonUtils.java | CommonUtils.dateReservedYear | public static Date dateReservedYear(int year, boolean is000) {
"""
将某一年对应的日期的月,日,时,分,秒,毫秒调整为最大值或者最小值
@param year 年份
@param is000 true则调整为最小值,反之最大值
@return 被转化后的日期
@see #dateReservedYear000(Date)
@see #dateReservedYear000(Calendar)
@see #dateReservedYear999(Date)
@see #dateReservedYear999(Calendar)
""... | java | public static Date dateReservedYear(int year, boolean is000) {
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR, year);
return is000 ? dateReservedYear000(calendar) : dateReservedYear999(calendar);
} | [
"public",
"static",
"Date",
"dateReservedYear",
"(",
"int",
"year",
",",
"boolean",
"is000",
")",
"{",
"Calendar",
"calendar",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"calendar",
".",
"set",
"(",
"Calendar",
".",
"YEAR",
",",
"year",
")",
";"... | 将某一年对应的日期的月,日,时,分,秒,毫秒调整为最大值或者最小值
@param year 年份
@param is000 true则调整为最小值,反之最大值
@return 被转化后的日期
@see #dateReservedYear000(Date)
@see #dateReservedYear000(Calendar)
@see #dateReservedYear999(Date)
@see #dateReservedYear999(Calendar) | [
"将某一年对应的日期的月",
"日",
"时",
"分",
"秒",
"毫秒调整为最大值或者最小值"
] | train | https://github.com/FlyingHe/UtilsMaven/blob/d9605b7bfe0c28a05289252e12d163e114080b4a/src/main/java/com/github/flyinghe/tools/CommonUtils.java#L574-L579 |
alkacon/opencms-core | src/org/opencms/ade/sitemap/CmsModelPageHelper.java | CmsModelPageHelper.createPageInModelFolder | public CmsResource createPageInModelFolder(String name, String description, CmsUUID copyId) throws CmsException {
"""
Creates a new potential model page in the default folder for new model pages.<p>
@param name the title for the model page
@param description the description for the model page
@param copyId st... | java | public CmsResource createPageInModelFolder(String name, String description, CmsUUID copyId) throws CmsException {
CmsResource modelFolder = ensureModelFolder(m_rootResource);
String pattern = "templatemodel_%(number).html";
String newFilePath = OpenCms.getResourceManager().getNameGenerator().ge... | [
"public",
"CmsResource",
"createPageInModelFolder",
"(",
"String",
"name",
",",
"String",
"description",
",",
"CmsUUID",
"copyId",
")",
"throws",
"CmsException",
"{",
"CmsResource",
"modelFolder",
"=",
"ensureModelFolder",
"(",
"m_rootResource",
")",
";",
"String",
... | Creates a new potential model page in the default folder for new model pages.<p>
@param name the title for the model page
@param description the description for the model page
@param copyId structure id of the resource to use as a model for the model page, if any (may be null)
@return the created resource
@throws Cms... | [
"Creates",
"a",
"new",
"potential",
"model",
"page",
"in",
"the",
"default",
"folder",
"for",
"new",
"model",
"pages",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/sitemap/CmsModelPageHelper.java#L207-L234 |
moparisthebest/beehive | beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/SqlStatement.java | SqlStatement.doBatchUpdate | private void doBatchUpdate(PreparedStatement ps, Object[] args, Calendar cal) throws SQLException {
"""
Build a prepared statement for a batch update.
@param ps The PreparedStatement object.
@param args The parameter list of the jdbccontrol method.
@param cal A Calendar instance used to resolve date/time v... | java | private void doBatchUpdate(PreparedStatement ps, Object[] args, Calendar cal) throws SQLException {
final int[] sqlTypes = new int[args.length];
final Object[] objArrays = new Object[args.length];
// build an array of type values and object arrays
for (int i = 0; i < args.length; i++) ... | [
"private",
"void",
"doBatchUpdate",
"(",
"PreparedStatement",
"ps",
",",
"Object",
"[",
"]",
"args",
",",
"Calendar",
"cal",
")",
"throws",
"SQLException",
"{",
"final",
"int",
"[",
"]",
"sqlTypes",
"=",
"new",
"int",
"[",
"args",
".",
"length",
"]",
";"... | Build a prepared statement for a batch update.
@param ps The PreparedStatement object.
@param args The parameter list of the jdbccontrol method.
@param cal A Calendar instance used to resolve date/time values.
@throws SQLException If a batch update cannot be performed. | [
"Build",
"a",
"prepared",
"statement",
"for",
"a",
"batch",
"update",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/SqlStatement.java#L429-L447 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.writeUtf8Map | public static File writeUtf8Map(Map<?, ?> map, File file, String kvSeparator, boolean isAppend) throws IORuntimeException {
"""
将Map写入文件,每个键值对为一行,一行中键与值之间使用kvSeparator分隔
@param map Map
@param file 文件
@param kvSeparator 键和值之间的分隔符,如果传入null使用默认分隔符" = "
@param isAppend 是否追加
@return 目标文件
@throws IORuntimeExcept... | java | public static File writeUtf8Map(Map<?, ?> map, File file, String kvSeparator, boolean isAppend) throws IORuntimeException {
return FileWriter.create(file, CharsetUtil.CHARSET_UTF_8).writeMap(map, kvSeparator, isAppend);
} | [
"public",
"static",
"File",
"writeUtf8Map",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"map",
",",
"File",
"file",
",",
"String",
"kvSeparator",
",",
"boolean",
"isAppend",
")",
"throws",
"IORuntimeException",
"{",
"return",
"FileWriter",
".",
"create",
"(",
"fi... | 将Map写入文件,每个键值对为一行,一行中键与值之间使用kvSeparator分隔
@param map Map
@param file 文件
@param kvSeparator 键和值之间的分隔符,如果传入null使用默认分隔符" = "
@param isAppend 是否追加
@return 目标文件
@throws IORuntimeException IO异常
@since 4.0.5 | [
"将Map写入文件,每个键值对为一行,一行中键与值之间使用kvSeparator分隔"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L3086-L3088 |
Ardesco/selenium-standalone-server-plugin | src/main/java/com/lazerycode/selenium/download/DownloadHandler.java | DownloadHandler.downloadFile | protected File downloadFile(DriverDetails driverDetails, boolean shouldWeCheckFileHash) throws MojoExecutionException, IOException, URISyntaxException {
"""
Perform the file download
@param driverDetails Driver details extracted from Repositorymap.xml
@param shouldWeCheckFileHash true if file hash shou... | java | protected File downloadFile(DriverDetails driverDetails, boolean shouldWeCheckFileHash) throws MojoExecutionException, IOException, URISyntaxException {
URL remoteFileLocation = driverDetails.fileLocation;
final String filename = FilenameUtils.getName(remoteFileLocation.getFile());
for (int re... | [
"protected",
"File",
"downloadFile",
"(",
"DriverDetails",
"driverDetails",
",",
"boolean",
"shouldWeCheckFileHash",
")",
"throws",
"MojoExecutionException",
",",
"IOException",
",",
"URISyntaxException",
"{",
"URL",
"remoteFileLocation",
"=",
"driverDetails",
".",
"fileL... | Perform the file download
@param driverDetails Driver details extracted from Repositorymap.xml
@param shouldWeCheckFileHash true if file hash should be checked
@return File
@throws MojoExecutionException Unable to download file
@throws IOException Error writing to file system
@throws URISyntaxExcept... | [
"Perform",
"the",
"file",
"download"
] | train | https://github.com/Ardesco/selenium-standalone-server-plugin/blob/e0ecfad426c1a28115cab60def84731d7a4d7e6f/src/main/java/com/lazerycode/selenium/download/DownloadHandler.java#L61-L83 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPRulePersistenceImpl.java | CPRulePersistenceImpl.findByGroupId | @Override
public List<CPRule> findByGroupId(long groupId, int start, int end) {
"""
Returns a range of all the cp rules where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are ind... | java | @Override
public List<CPRule> findByGroupId(long groupId, int start, int end) {
return findByGroupId(groupId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPRule",
">",
"findByGroupId",
"(",
"long",
"groupId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the cp rules where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting b... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"rules",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPRulePersistenceImpl.java#L139-L142 |
liferay/com-liferay-commerce | commerce-product-type-virtual-order-service/src/main/java/com/liferay/commerce/product/type/virtual/order/service/persistence/impl/CommerceVirtualOrderItemPersistenceImpl.java | CommerceVirtualOrderItemPersistenceImpl.fetchByUUID_G | @Override
public CommerceVirtualOrderItem fetchByUUID_G(String uuid, long groupId) {
"""
Returns the commerce virtual order item where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param uuid the uuid
@param groupId the group ID
@return the ma... | java | @Override
public CommerceVirtualOrderItem fetchByUUID_G(String uuid, long groupId) {
return fetchByUUID_G(uuid, groupId, true);
} | [
"@",
"Override",
"public",
"CommerceVirtualOrderItem",
"fetchByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"{",
"return",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
",",
"true",
")",
";",
"}"
] | Returns the commerce virtual order item where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param uuid the uuid
@param groupId the group ID
@return the matching commerce virtual order item, or <code>null</code> if a matching commerce virtual order item ... | [
"Returns",
"the",
"commerce",
"virtual",
"order",
"item",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
".",
"Uses",
"the",
... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-type-virtual-order-service/src/main/java/com/liferay/commerce/product/type/virtual/order/service/persistence/impl/CommerceVirtualOrderItemPersistenceImpl.java#L706-L709 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/form/CmsForm.java | CmsForm.updateModelValidationStatus | protected void updateModelValidationStatus(String modelId, CmsValidationResult result) {
"""
Updates the model validation status.<p>
@param modelId the model id
@param result the validation result
"""
Collection<I_CmsFormField> fields = getFieldsByModelId(modelId);
for (I_CmsFormField fiel... | java | protected void updateModelValidationStatus(String modelId, CmsValidationResult result) {
Collection<I_CmsFormField> fields = getFieldsByModelId(modelId);
for (I_CmsFormField field : fields) {
updateFieldValidationStatus(field, result);
}
} | [
"protected",
"void",
"updateModelValidationStatus",
"(",
"String",
"modelId",
",",
"CmsValidationResult",
"result",
")",
"{",
"Collection",
"<",
"I_CmsFormField",
">",
"fields",
"=",
"getFieldsByModelId",
"(",
"modelId",
")",
";",
"for",
"(",
"I_CmsFormField",
"fiel... | Updates the model validation status.<p>
@param modelId the model id
@param result the validation result | [
"Updates",
"the",
"model",
"validation",
"status",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/form/CmsForm.java#L532-L539 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/SeaGlassLookAndFeel.java | SeaGlassLookAndFeel.defineSeparators | private void defineSeparators(UIDefaults d) {
"""
Initialize the separator settings.
@param d the UI defaults map.
"""
String c = PAINTER_PREFIX + "SeparatorPainter";
d.put("Separator.contentMargins", new InsetsUIResource(0, 0, 0, 0));
d.put("Separator[Enabled].backgroundPainter", ne... | java | private void defineSeparators(UIDefaults d) {
String c = PAINTER_PREFIX + "SeparatorPainter";
d.put("Separator.contentMargins", new InsetsUIResource(0, 0, 0, 0));
d.put("Separator[Enabled].backgroundPainter", new LazyPainter(c, SeparatorPainter.Which.BACKGROUND_ENABLED));
} | [
"private",
"void",
"defineSeparators",
"(",
"UIDefaults",
"d",
")",
"{",
"String",
"c",
"=",
"PAINTER_PREFIX",
"+",
"\"SeparatorPainter\"",
";",
"d",
".",
"put",
"(",
"\"Separator.contentMargins\"",
",",
"new",
"InsetsUIResource",
"(",
"0",
",",
"0",
",",
"0",... | Initialize the separator settings.
@param d the UI defaults map. | [
"Initialize",
"the",
"separator",
"settings",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/SeaGlassLookAndFeel.java#L1771-L1775 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/map/impl/query/QueryRunner.java | QueryRunner.runPartitionIndexOrPartitionScanQueryOnGivenOwnedPartition | public Result runPartitionIndexOrPartitionScanQueryOnGivenOwnedPartition(Query query, int partitionId) {
"""
for a single partition. If the index is global it won't be asked
"""
MapContainer mapContainer = mapServiceContext.getMapContainer(query.getMapName());
PartitionIdSet partitions = single... | java | public Result runPartitionIndexOrPartitionScanQueryOnGivenOwnedPartition(Query query, int partitionId) {
MapContainer mapContainer = mapServiceContext.getMapContainer(query.getMapName());
PartitionIdSet partitions = singletonPartitionIdSet(partitionCount, partitionId);
// first we optimize the ... | [
"public",
"Result",
"runPartitionIndexOrPartitionScanQueryOnGivenOwnedPartition",
"(",
"Query",
"query",
",",
"int",
"partitionId",
")",
"{",
"MapContainer",
"mapContainer",
"=",
"mapServiceContext",
".",
"getMapContainer",
"(",
"query",
".",
"getMapName",
"(",
")",
")"... | for a single partition. If the index is global it won't be asked | [
"for",
"a",
"single",
"partition",
".",
"If",
"the",
"index",
"is",
"global",
"it",
"won",
"t",
"be",
"asked"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/query/QueryRunner.java#L180-L203 |
tdomzal/junit-docker-rule | src/main/java/pl/domzal/junit/docker/rule/DockerRule.java | DockerRule.waitForLogMessage | public void waitForLogMessage(final String logSearchString, int waitTime) throws TimeoutException {
"""
Stop and wait till given string will show in container output.
@param logSearchString String to wait for in container output.
@param waitTime Wait time.
@throws TimeoutException On wait timeout.
"""
... | java | public void waitForLogMessage(final String logSearchString, int waitTime) throws TimeoutException {
WaitForContainer.waitForCondition(new LogChecker(this, logSearchString), waitTime, describe());
} | [
"public",
"void",
"waitForLogMessage",
"(",
"final",
"String",
"logSearchString",
",",
"int",
"waitTime",
")",
"throws",
"TimeoutException",
"{",
"WaitForContainer",
".",
"waitForCondition",
"(",
"new",
"LogChecker",
"(",
"this",
",",
"logSearchString",
")",
",",
... | Stop and wait till given string will show in container output.
@param logSearchString String to wait for in container output.
@param waitTime Wait time.
@throws TimeoutException On wait timeout. | [
"Stop",
"and",
"wait",
"till",
"given",
"string",
"will",
"show",
"in",
"container",
"output",
"."
] | train | https://github.com/tdomzal/junit-docker-rule/blob/5a0ba2fd095d201530d3f9e614bc5e88d0afaeb2/src/main/java/pl/domzal/junit/docker/rule/DockerRule.java#L361-L363 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/io/GVRCursorController.java | GVRCursorController.setPosition | public void setPosition(float x, float y, float z) {
"""
This call sets the position of the {@link GVRCursorController}.
Use this call to also set an initial position for the Cursor when a new
{@link GVRCursorController} is selected.
@param x the x value of the position.
@param y the y value of the positio... | java | public void setPosition(float x, float y, float z)
{
if (isEnabled())
{
position.set(x, y, z);
}
} | [
"public",
"void",
"setPosition",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"if",
"(",
"isEnabled",
"(",
")",
")",
"{",
"position",
".",
"set",
"(",
"x",
",",
"y",
",",
"z",
")",
";",
"}",
"}"
] | This call sets the position of the {@link GVRCursorController}.
Use this call to also set an initial position for the Cursor when a new
{@link GVRCursorController} is selected.
@param x the x value of the position.
@param y the y value of the position.
@param z the z value of the position. | [
"This",
"call",
"sets",
"the",
"position",
"of",
"the",
"{",
"@link",
"GVRCursorController",
"}",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/io/GVRCursorController.java#L639-L645 |
hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/FileIoUtil.java | FileIoUtil.getTextfileFromUrl | public static List<String> getTextfileFromUrl(String _url, Charset _charset) {
"""
Retrives a text file from an given URL and reads the content with the given charset.
Url could be remote (like http://) or local (file://)
If protocol is not specified by "protocol://" (like "http://" or "file://"),
"file://" i... | java | public static List<String> getTextfileFromUrl(String _url, Charset _charset) {
return getTextfileFromUrl(_url, _charset, false);
} | [
"public",
"static",
"List",
"<",
"String",
">",
"getTextfileFromUrl",
"(",
"String",
"_url",
",",
"Charset",
"_charset",
")",
"{",
"return",
"getTextfileFromUrl",
"(",
"_url",
",",
"_charset",
",",
"false",
")",
";",
"}"
] | Retrives a text file from an given URL and reads the content with the given charset.
Url could be remote (like http://) or local (file://)
If protocol is not specified by "protocol://" (like "http://" or "file://"),
"file://" is assumed.
@param _url
@param _charset
@return fileContent as List or null if file is empty ... | [
"Retrives",
"a",
"text",
"file",
"from",
"an",
"given",
"URL",
"and",
"reads",
"the",
"content",
"with",
"the",
"given",
"charset",
".",
"Url",
"could",
"be",
"remote",
"(",
"like",
"http",
":",
"//",
")",
"or",
"local",
"(",
"file",
":",
"//",
")"
] | train | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/FileIoUtil.java#L161-L163 |
anotheria/moskito | moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/AbstractInterceptor.java | AbstractInterceptor.getStats | protected final T getStats(OnDemandStatsProducer producer, String name) {
"""
Returns stats for producer.
@param producer {@link OnDemandStatsProducer}
@param name stats name
@return stats for producer
"""
try {
return getStatsClass().cast(producer.getStats(name));
} catch (Cla... | java | protected final T getStats(OnDemandStatsProducer producer, String name) {
try {
return getStatsClass().cast(producer.getStats(name));
} catch (ClassCastException e) {
LOGGER.error("getStats(): Unexpected stats type", e);
} catch (OnDemandStatsProducerException e) {
... | [
"protected",
"final",
"T",
"getStats",
"(",
"OnDemandStatsProducer",
"producer",
",",
"String",
"name",
")",
"{",
"try",
"{",
"return",
"getStatsClass",
"(",
")",
".",
"cast",
"(",
"producer",
".",
"getStats",
"(",
"name",
")",
")",
";",
"}",
"catch",
"(... | Returns stats for producer.
@param producer {@link OnDemandStatsProducer}
@param name stats name
@return stats for producer | [
"Returns",
"stats",
"for",
"producer",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/AbstractInterceptor.java#L104-L114 |
dlemmermann/CalendarFX | CalendarFXRecurrence/src/main/java/com/google/ical/util/DTBuilder.java | DTBuilder.toDateTime | public DateTimeValue toDateTime() {
"""
produces a normalized date time, using zero for the time fields if none
were provided.
@return not null
"""
normalize();
return new DateTimeValueImpl(year, month, day, hour, minute, second);
} | java | public DateTimeValue toDateTime() {
normalize();
return new DateTimeValueImpl(year, month, day, hour, minute, second);
} | [
"public",
"DateTimeValue",
"toDateTime",
"(",
")",
"{",
"normalize",
"(",
")",
";",
"return",
"new",
"DateTimeValueImpl",
"(",
"year",
",",
"month",
",",
"day",
",",
"hour",
",",
"minute",
",",
"second",
")",
";",
"}"
] | produces a normalized date time, using zero for the time fields if none
were provided.
@return not null | [
"produces",
"a",
"normalized",
"date",
"time",
"using",
"zero",
"for",
"the",
"time",
"fields",
"if",
"none",
"were",
"provided",
"."
] | train | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXRecurrence/src/main/java/com/google/ical/util/DTBuilder.java#L83-L86 |
kiegroup/drools | drools-core/src/main/java/org/drools/core/phreak/PhreakBranchNode.java | PhreakBranchNode.getBranchTuples | private BranchTuples getBranchTuples(LeftTupleSink sink, LeftTuple leftTuple) {
"""
A branch has two potential sinks. rtnSink is for the sink if the contained logic returns true.
mainSink is for propagations after the branch node, if they are allowed.
it may have one or the other or both. there is no state that... | java | private BranchTuples getBranchTuples(LeftTupleSink sink, LeftTuple leftTuple) {
BranchTuples branchTuples = new BranchTuples();
LeftTuple child = leftTuple.getFirstChild();
if ( child != null ) {
// assigns the correct main or rtn LeftTuple based on the identified sink
if... | [
"private",
"BranchTuples",
"getBranchTuples",
"(",
"LeftTupleSink",
"sink",
",",
"LeftTuple",
"leftTuple",
")",
"{",
"BranchTuples",
"branchTuples",
"=",
"new",
"BranchTuples",
"(",
")",
";",
"LeftTuple",
"child",
"=",
"leftTuple",
".",
"getFirstChild",
"(",
")",
... | A branch has two potential sinks. rtnSink is for the sink if the contained logic returns true.
mainSink is for propagations after the branch node, if they are allowed.
it may have one or the other or both. there is no state that indicates whether one or the other or both
are present, so all tuple children must be insp... | [
"A",
"branch",
"has",
"two",
"potential",
"sinks",
".",
"rtnSink",
"is",
"for",
"the",
"sink",
"if",
"the",
"contained",
"logic",
"returns",
"true",
".",
"mainSink",
"is",
"for",
"propagations",
"after",
"the",
"branch",
"node",
"if",
"they",
"are",
"allow... | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-core/src/main/java/org/drools/core/phreak/PhreakBranchNode.java#L220-L240 |
javalite/activejdbc | javalite-common/src/main/java/org/javalite/common/Convert.java | Convert.toSqlDate | public static java.sql.Date toSqlDate(Object value) {
"""
Expects a <code>java.sql.Date</code>, <code>java.sql.Timestamp</code>, <code>java.sql.Time</code>, <code>java.util.Date</code>,
<code>Long</code> or any object whose toString method has this format: <code>yyyy-mm-dd</code>.
@param value argument that is... | java | public static java.sql.Date toSqlDate(Object value){
if (value == null) {
return null;
} else if (value instanceof java.sql.Date) {
return (java.sql.Date) value;
} else if (value instanceof java.util.Date) {
return new java.sql.Date(((java.util.Date) value).ge... | [
"public",
"static",
"java",
".",
"sql",
".",
"Date",
"toSqlDate",
"(",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"value",
"instanceof",
"java",
".",
"sql",
".",
"Date",
"... | Expects a <code>java.sql.Date</code>, <code>java.sql.Timestamp</code>, <code>java.sql.Time</code>, <code>java.util.Date</code>,
<code>Long</code> or any object whose toString method has this format: <code>yyyy-mm-dd</code>.
@param value argument that is possible to convert to <code>java.sql.Date</code>.
@return <code>... | [
"Expects",
"a",
"<code",
">",
"java",
".",
"sql",
".",
"Date<",
"/",
"code",
">",
"<code",
">",
"java",
".",
"sql",
".",
"Timestamp<",
"/",
"code",
">",
"<code",
">",
"java",
".",
"sql",
".",
"Time<",
"/",
"code",
">",
"<code",
">",
"java",
".",
... | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/javalite-common/src/main/java/org/javalite/common/Convert.java#L138-L154 |
banq/jdonframework | src/main/java/com/jdon/container/pico/JdonPicoContainer.java | JdonPicoContainer.registerComponentInstance | public ComponentAdapter registerComponentInstance(Object componentKey, Object componentInstance) throws PicoRegistrationException {
"""
{@inheritDoc} The returned ComponentAdapter will be an
{@link InstanceComponentAdapter}.
"""
if (componentInstance instanceof MutablePicoContainer) {
MutablePicoContai... | java | public ComponentAdapter registerComponentInstance(Object componentKey, Object componentInstance) throws PicoRegistrationException {
if (componentInstance instanceof MutablePicoContainer) {
MutablePicoContainer pc = (MutablePicoContainer) componentInstance;
Object contrivedKey = new Object();
String contr... | [
"public",
"ComponentAdapter",
"registerComponentInstance",
"(",
"Object",
"componentKey",
",",
"Object",
"componentInstance",
")",
"throws",
"PicoRegistrationException",
"{",
"if",
"(",
"componentInstance",
"instanceof",
"MutablePicoContainer",
")",
"{",
"MutablePicoContainer... | {@inheritDoc} The returned ComponentAdapter will be an
{@link InstanceComponentAdapter}. | [
"{"
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/container/pico/JdonPicoContainer.java#L226-L244 |
Azure/azure-sdk-for-java | kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersInner.java | ClustersInner.beginCreateOrUpdateAsync | public Observable<ClusterInner> beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, ClusterInner parameters) {
"""
Create or update a Kusto cluster.
@param resourceGroupName The name of the resource group containing the Kusto cluster.
@param clusterName The name of the Kusto cluster.
@param... | java | public Observable<ClusterInner> beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, ClusterInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1<ServiceResponse<ClusterInner>, ClusterInner>() {
@Override
... | [
"public",
"Observable",
"<",
"ClusterInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"ClusterInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",... | Create or update a Kusto cluster.
@param resourceGroupName The name of the resource group containing the Kusto cluster.
@param clusterName The name of the Kusto cluster.
@param parameters The Kusto cluster parameters supplied to the CreateOrUpdate operation.
@throws IllegalArgumentException thrown if parameters fail t... | [
"Create",
"or",
"update",
"a",
"Kusto",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersInner.java#L335-L342 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java | MapUtil.getBool | public static Boolean getBool(Map<?, ?> map, Object key) {
"""
获取Map指定key的值,并转换为Bool
@param map Map
@param key 键
@return 值
@since 4.0.6
"""
return get(map, key, Boolean.class);
} | java | public static Boolean getBool(Map<?, ?> map, Object key) {
return get(map, key, Boolean.class);
} | [
"public",
"static",
"Boolean",
"getBool",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"map",
",",
"Object",
"key",
")",
"{",
"return",
"get",
"(",
"map",
",",
"key",
",",
"Boolean",
".",
"class",
")",
";",
"}"
] | 获取Map指定key的值,并转换为Bool
@param map Map
@param key 键
@return 值
@since 4.0.6 | [
"获取Map指定key的值,并转换为Bool"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java#L816-L818 |
linkedin/dexmaker | dexmaker-mockito-inline-extended/src/main/java/com/android/dx/mockito/inline/extended/ExtendedMockito.java | ExtendedMockito.doThrow | @SafeVarargs
public static StaticCapableStubber doThrow(Class<? extends Throwable> toBeThrown,
Class<? extends Throwable>... toBeThrownNext) {
"""
Same as {@link Mockito#doThrow(Class, Class...)} but adds the ability to stub static method
calls via {@link StaticC... | java | @SafeVarargs
public static StaticCapableStubber doThrow(Class<? extends Throwable> toBeThrown,
Class<? extends Throwable>... toBeThrownNext) {
return new StaticCapableStubber(Mockito.doThrow(toBeThrown, toBeThrownNext));
} | [
"@",
"SafeVarargs",
"public",
"static",
"StaticCapableStubber",
"doThrow",
"(",
"Class",
"<",
"?",
"extends",
"Throwable",
">",
"toBeThrown",
",",
"Class",
"<",
"?",
"extends",
"Throwable",
">",
"...",
"toBeThrownNext",
")",
"{",
"return",
"new",
"StaticCapableS... | Same as {@link Mockito#doThrow(Class, Class...)} but adds the ability to stub static method
calls via {@link StaticCapableStubber#when(MockedMethod)} and
{@link StaticCapableStubber#when(MockedVoidMethod)}. | [
"Same",
"as",
"{"
] | train | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker-mockito-inline-extended/src/main/java/com/android/dx/mockito/inline/extended/ExtendedMockito.java#L131-L135 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/scheduler/CmsEditScheduledJobInfoDialog.java | CmsEditScheduledJobInfoDialog.getComboCronExpressions | protected List<CmsSelectWidgetOption> getComboCronExpressions() {
"""
Returns the example cron expressions to show in the combo box.<p>
The result list elements are of type <code>{@link org.opencms.widgets.CmsSelectWidgetOption}</code>.<p>
@return the example cron expressions to show in the combo box
"""... | java | protected List<CmsSelectWidgetOption> getComboCronExpressions() {
List<CmsSelectWidgetOption> result = new ArrayList<CmsSelectWidgetOption>();
// 0 0 3 * * ? (daily at 3 am)
result.add(new CmsSelectWidgetOption("0 0 3 * * ?", false, null, key(Messages.GUI_EDITOR_CRONJOB_EXAMPLE1_0)));
... | [
"protected",
"List",
"<",
"CmsSelectWidgetOption",
">",
"getComboCronExpressions",
"(",
")",
"{",
"List",
"<",
"CmsSelectWidgetOption",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"CmsSelectWidgetOption",
">",
"(",
")",
";",
"// 0 0 3 * * ? (daily at 3 am)",
"result"... | Returns the example cron expressions to show in the combo box.<p>
The result list elements are of type <code>{@link org.opencms.widgets.CmsSelectWidgetOption}</code>.<p>
@return the example cron expressions to show in the combo box | [
"Returns",
"the",
"example",
"cron",
"expressions",
"to",
"show",
"in",
"the",
"combo",
"box",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/scheduler/CmsEditScheduledJobInfoDialog.java#L400-L422 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.listCustomPrebuiltModelsAsync | public Observable<List<CustomPrebuiltModel>> listCustomPrebuiltModelsAsync(UUID appId, String versionId) {
"""
Gets all custom prebuilt models information of this application.
@param appId The application ID.
@param versionId The version ID.
@throws IllegalArgumentException thrown if parameters fail the valid... | java | public Observable<List<CustomPrebuiltModel>> listCustomPrebuiltModelsAsync(UUID appId, String versionId) {
return listCustomPrebuiltModelsWithServiceResponseAsync(appId, versionId).map(new Func1<ServiceResponse<List<CustomPrebuiltModel>>, List<CustomPrebuiltModel>>() {
@Override
public L... | [
"public",
"Observable",
"<",
"List",
"<",
"CustomPrebuiltModel",
">",
">",
"listCustomPrebuiltModelsAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
")",
"{",
"return",
"listCustomPrebuiltModelsWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
")",
"... | Gets all custom prebuilt models information of this application.
@param appId The application ID.
@param versionId The version ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the List<CustomPrebuiltModel> object | [
"Gets",
"all",
"custom",
"prebuilt",
"models",
"information",
"of",
"this",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L6089-L6096 |
lionsoul2014/jcseg | jcseg-core/src/main/java/org/lionsoul/jcseg/util/ArrayUtil.java | ArrayUtil.indexOf | public static int indexOf(String ele, String[] arr) {
"""
check and search the specified element in the Array
@param ele
@param arr
@return int
"""
if ( arr == null ) {
return -1;
}
for ( int i = 0; i < arr.length; i++ ) {
if ( arr[i].equals(el... | java | public static int indexOf(String ele, String[] arr)
{
if ( arr == null ) {
return -1;
}
for ( int i = 0; i < arr.length; i++ ) {
if ( arr[i].equals(ele) ) {
return i;
}
}
return -1;
} | [
"public",
"static",
"int",
"indexOf",
"(",
"String",
"ele",
",",
"String",
"[",
"]",
"arr",
")",
"{",
"if",
"(",
"arr",
"==",
"null",
")",
"{",
"return",
"-",
"1",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"arr",
".",
"length... | check and search the specified element in the Array
@param ele
@param arr
@return int | [
"check",
"and",
"search",
"the",
"specified",
"element",
"in",
"the",
"Array"
] | train | https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/ArrayUtil.java#L42-L55 |
lisicnu/droidUtil | src/main/java/com/github/lisicnu/libDroid/helper/BitmapCacheLoader.java | BitmapCacheLoader.loadFile | public Bitmap loadFile(String fileName, String tmpDirectory, ImageCallBack imageCallBack,
boolean canRemove) {
"""
Load Steps:<br/>
1. load from caches. <br/>
2. if file not exist in caches, then load it from local storage.<br/>
3. if local storage not exist, then load it from tempora... | java | public Bitmap loadFile(String fileName, String tmpDirectory, ImageCallBack imageCallBack,
boolean canRemove) {
return loadFile(fileName, tmpDirectory, imageCallBack, canRemove, -1, -1);
} | [
"public",
"Bitmap",
"loadFile",
"(",
"String",
"fileName",
",",
"String",
"tmpDirectory",
",",
"ImageCallBack",
"imageCallBack",
",",
"boolean",
"canRemove",
")",
"{",
"return",
"loadFile",
"(",
"fileName",
",",
"tmpDirectory",
",",
"imageCallBack",
",",
"canRemov... | Load Steps:<br/>
1. load from caches. <br/>
2. if file not exist in caches, then load it from local storage.<br/>
3. if local storage not exist, then load it from temporary directory.<br/>
4. if file not exist in temporary directory. then download it.<br/>
5. after download, then callback will be added.<br/>
@param fi... | [
"Load",
"Steps",
":",
"<br",
"/",
">",
"1",
".",
"load",
"from",
"caches",
".",
"<br",
"/",
">",
"2",
".",
"if",
"file",
"not",
"exist",
"in",
"caches",
"then",
"load",
"it",
"from",
"local",
"storage",
".",
"<br",
"/",
">",
"3",
".",
"if",
"lo... | train | https://github.com/lisicnu/droidUtil/blob/e4d6cf3e3f60e5efb5a75672607ded94d1725519/src/main/java/com/github/lisicnu/libDroid/helper/BitmapCacheLoader.java#L162-L166 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java | VirtualMachinesInner.beginCreateOrUpdate | public VirtualMachineInner beginCreateOrUpdate(String resourceGroupName, String vmName, VirtualMachineInner parameters) {
"""
The operation to create or update a virtual machine.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine.
@param parameters Parameter... | java | public VirtualMachineInner beginCreateOrUpdate(String resourceGroupName, String vmName, VirtualMachineInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, parameters).toBlocking().single().body();
} | [
"public",
"VirtualMachineInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmName",
",",
"VirtualMachineInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmName",
",",
"p... | The operation to create or update a virtual machine.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine.
@param parameters Parameters supplied to the Create Virtual Machine operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws C... | [
"The",
"operation",
"to",
"create",
"or",
"update",
"a",
"virtual",
"machine",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java#L627-L629 |
denisneuling/apitrary.jar | apitrary-api-client/src/main/java/com/apitrary/api/client/util/ClassUtil.java | ClassUtil.getFieldAnnotationValue | @SuppressWarnings("unchecked")
public static <T> T getFieldAnnotationValue(String annotationProperty, Field field, Class<? extends Annotation> annotationClass, Class<T> ofType) {
"""
<p>
getFieldAnnotationValue.
</p>
@param annotationProperty
a {@link java.lang.String} object.
@param field
a {@link java.l... | java | @SuppressWarnings("unchecked")
public static <T> T getFieldAnnotationValue(String annotationProperty, Field field, Class<? extends Annotation> annotationClass, Class<T> ofType) {
Object annotation = field.getAnnotation(annotationClass);
T result = null;
if (annotation != null) {
try {
Method method = ann... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"getFieldAnnotationValue",
"(",
"String",
"annotationProperty",
",",
"Field",
"field",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClass",
",",
"Clas... | <p>
getFieldAnnotationValue.
</p>
@param annotationProperty
a {@link java.lang.String} object.
@param field
a {@link java.lang.reflect.Field} object.
@param annotationClass
a {@link java.lang.Class} object.
@param ofType
a {@link java.lang.Class} object.
@param <T>
a T object.
@return a T object. | [
"<p",
">",
"getFieldAnnotationValue",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/denisneuling/apitrary.jar/blob/b7f639a1e735c60ba2b1b62851926757f5de8628/apitrary-api-client/src/main/java/com/apitrary/api/client/util/ClassUtil.java#L394-L408 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java | CPInstancePersistenceImpl.findByGroupId | @Override
public List<CPInstance> findByGroupId(long groupId) {
"""
Returns all the cp instances where groupId = ?.
@param groupId the group ID
@return the matching cp instances
"""
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CPInstance> findByGroupId(long groupId) {
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPInstance",
">",
"findByGroupId",
"(",
"long",
"groupId",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the cp instances where groupId = ?.
@param groupId the group ID
@return the matching cp instances | [
"Returns",
"all",
"the",
"cp",
"instances",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java#L1507-L1510 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.