repo stringlengths 7 59 | path stringlengths 3 222 | func_name stringlengths 3 127 | original_string stringlengths 0 466k | language stringclasses 1
value | code stringlengths 0 466k | code_tokens listlengths 0 68.3k | docstring stringlengths 0 21.3k | docstring_tokens listlengths 0 1.93k | sha stringlengths 0 40 | url stringlengths 0 339 | partition stringclasses 3
values | summary stringlengths 0 250 | instruction stringlengths 38 3.13k | input stringclasses 1
value | output stringlengths 146 466k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/data/nvdcve/CveDB.java | CveDB.determineDatabaseProductName | private String determineDatabaseProductName(Connection conn) {
try {
final String databaseProductName = conn.getMetaData().getDatabaseProductName().toLowerCase();
LOGGER.debug("Database product: {}", databaseProductName);
return databaseProductName;
} catch (SQLExcept... | java | private String determineDatabaseProductName(Connection conn) {
try {
final String databaseProductName = conn.getMetaData().getDatabaseProductName().toLowerCase();
LOGGER.debug("Database product: {}", databaseProductName);
return databaseProductName;
} catch (SQLExcept... | [
"private",
"String",
"determineDatabaseProductName",
"(",
"Connection",
"conn",
")",
"{",
"try",
"{",
"final",
"String",
"databaseProductName",
"=",
"conn",
".",
"getMetaData",
"(",
")",
".",
"getDatabaseProductName",
"(",
")",
".",
"toLowerCase",
"(",
")",
";",... | Tries to determine the product name of the database.
@param conn the database connection
@return the product name of the database if successful, {@code null} else | [
"Tries",
"to",
"determine",
"the",
"product",
"name",
"of",
"the",
"database",
"."
] | 6cc7690ea12e4ca1454210ceaa2e9a5523f0926c | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/nvdcve/CveDB.java#L367-L376 | train | Determine the product name of the database. | Create a Java method that does the following: "Determine the product name of the database.". | Of course, here is the Java code you requested:
```java
private String determineDatabaseProductName(Connection conn) {
try {
final String databaseProductName = conn.getMetaData().getDatabaseProductName().toLowerCase();
LOGGER.debug("Database product: {}", databaseProductName);
... | |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/YearWeek.java | YearWeek.plusWeeks | public YearWeek plusWeeks(long weeksToAdd) {
if (weeksToAdd == 0) {
return this;
}
LocalDate mondayOfWeek = atDay(DayOfWeek.MONDAY).plusWeeks(weeksToAdd);
return YearWeek.from(mondayOfWeek);
} | java | public YearWeek plusWeeks(long weeksToAdd) {
if (weeksToAdd == 0) {
return this;
}
LocalDate mondayOfWeek = atDay(DayOfWeek.MONDAY).plusWeeks(weeksToAdd);
return YearWeek.from(mondayOfWeek);
} | [
"public",
"YearWeek",
"plusWeeks",
"(",
"long",
"weeksToAdd",
")",
"{",
"if",
"(",
"weeksToAdd",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"LocalDate",
"mondayOfWeek",
"=",
"atDay",
"(",
"DayOfWeek",
".",
"MONDAY",
")",
".",
"plusWeeks",
"(",
"wee... | Returns a copy of this year-week with the specified number of weeks added.
<p>
This instance is immutable and unaffected by this method call.
@param weeksToAdd the weeks to add, may be negative
@return the year-week with the weeks added, not null | [
"Returns",
"a",
"copy",
"of",
"this",
"year",
"-",
"week",
"with",
"the",
"specified",
"number",
"of",
"weeks",
"added",
".",
"<p",
">",
"This",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
"."
] | e94ecd3592ef70e54d6eea21095239ea9ffbab78 | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/YearWeek.java#L550-L556 | train | Add the specified number of weeks to the year. | Create a Java method that does the following: "Add the specified number of weeks to the year.". | Of course, here is the Java code you requested:
```java
public YearWeek plusWeeks(long weeksToAdd) {
if (weeksToAdd == 0) {
return this;
}
LocalDate mondayOfWeek = atDay(DayOfWeek.MONDAY).plusWeeks(weeksToAdd);
return YearWeek.from(mondayOfWeek);
}
```
Hope this helps! | |
zaproxy/zaproxy | src/org/zaproxy/zap/view/StandardFieldsDialog.java | StandardFieldsDialog.setFieldPopupMenu | public void setFieldPopupMenu(String fieldLabel, JPopupMenu popup) {
Component c = this.fieldMap.get(fieldLabel);
if (c != null) {
if (c instanceof JComponent) {
((JComponent) c).setComponentPopupMenu(popup);
} else {
handleUnexpectedFieldClass(fieldLabel, c);
}
}
} | java | public void setFieldPopupMenu(String fieldLabel, JPopupMenu popup) {
Component c = this.fieldMap.get(fieldLabel);
if (c != null) {
if (c instanceof JComponent) {
((JComponent) c).setComponentPopupMenu(popup);
} else {
handleUnexpectedFieldClass(fieldLabel, c);
}
}
} | [
"public",
"void",
"setFieldPopupMenu",
"(",
"String",
"fieldLabel",
",",
"JPopupMenu",
"popup",
")",
"{",
"Component",
"c",
"=",
"this",
".",
"fieldMap",
".",
"get",
"(",
"fieldLabel",
")",
";",
"if",
"(",
"c",
"!=",
"null",
")",
"{",
"if",
"(",
"c",
... | Sets the given pop up menu to the field with the given label.
<p>
The pop up menu is only set to {@link JComponent} fields.
@param fieldLabel the label of the field.
@param popup the pop up menu.
@since TODO add version
@see JComponent#setComponentPopupMenu(JPopupMenu) | [
"Sets",
"the",
"given",
"pop",
"up",
"menu",
"to",
"the",
"field",
"with",
"the",
"given",
"label",
".",
"<p",
">",
"The",
"pop",
"up",
"menu",
"is",
"only",
"set",
"to",
"{",
"@link",
"JComponent",
"}",
"fields",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/view/StandardFieldsDialog.java#L1742-L1751 | train | Sets the popup menu for the given field label. | Create a Java method that does the following: "Sets the popup menu for the given field label.". | Of course, here is the Java code you requested:
```java
public void setFieldPopupMenu(String fieldLabel, JPopupMenu popup) {
Component c = this.fieldMap.get(fieldLabel);
if (c != null) {
if (c instanceof JComponent) {
((JComponent) c).setComponentPopupMenu(popup);
} else {
handleUnexpectedFieldClass(... | |
zaproxy/zaproxy | src/org/zaproxy/zap/view/widgets/ContextSelectComboBox.java | ContextSelectComboBox.reloadContexts | public void reloadContexts(boolean keepSelected) {
Context selected = null;
if (keepSelected)
selected = (Context) getSelectedItem();
List<Context> contexts = Model.getSingleton().getSession().getContexts();
Context[] contextsArray = contexts.toArray(new Context[contexts.size()]);
ComboBoxModel<Context> m... | java | public void reloadContexts(boolean keepSelected) {
Context selected = null;
if (keepSelected)
selected = (Context) getSelectedItem();
List<Context> contexts = Model.getSingleton().getSession().getContexts();
Context[] contextsArray = contexts.toArray(new Context[contexts.size()]);
ComboBoxModel<Context> m... | [
"public",
"void",
"reloadContexts",
"(",
"boolean",
"keepSelected",
")",
"{",
"Context",
"selected",
"=",
"null",
";",
"if",
"(",
"keepSelected",
")",
"selected",
"=",
"(",
"Context",
")",
"getSelectedItem",
"(",
")",
";",
"List",
"<",
"Context",
">",
"con... | Reloads/refreshes the list of {@link Context Contexts} from the {@link Session}.
@param keepSelected whether the previously selected context is tried to be restored. If
{@code false}, defaults to no selection. | [
"Reloads",
"/",
"refreshes",
"the",
"list",
"of",
"{",
"@link",
"Context",
"Contexts",
"}",
"from",
"the",
"{",
"@link",
"Session",
"}",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/view/widgets/ContextSelectComboBox.java#L41-L54 | train | Reload the contexts from the session. | Create a Java method that does the following: "Reload the contexts from the session.". | Of course, here is the Java code you requested:
```java
public void reloadContexts(boolean keepSelected) {
Context selected = null;
if (keepSelected)
selected = (Context) getSelectedItem();
List<Context> contexts = Model.getSingleton().getSession().getContexts();
Context[] contextsArray = contexts.toArray(... | |
RogerParkinson/madura-objects-parent | madura-objects/src/main/java/com/sun/tools/xjc/addon/MaduraJAXBInterceptor.java | MaduraJAXBInterceptor.run | public boolean run(final Outline model, final Options opt, final ErrorHandler errorHandler) {
// CPluginCustomization c = co.target.getCustomizations().find(NS,"code");
// if(c==null)
// continue; // no customization --- nothing to inject here
// c.markAsAcknow... | java | public boolean run(final Outline model, final Options opt, final ErrorHandler errorHandler) {
// CPluginCustomization c = co.target.getCustomizations().find(NS,"code");
// if(c==null)
// continue; // no customization --- nothing to inject here
// c.markAsAcknow... | [
"public",
"boolean",
"run",
"(",
"final",
"Outline",
"model",
",",
"final",
"Options",
"opt",
",",
"final",
"ErrorHandler",
"errorHandler",
")",
"{",
"// CPluginCustomization c = co.target.getCustomizations().find(NS,\"code\");",
"// if(c==null)",
"// ... | } | [
"}"
] | 9b5385dd0437611f0ce8506f63646e018d06fb8e | https://github.com/RogerParkinson/madura-objects-parent/blob/9b5385dd0437611f0ce8506f63646e018d06fb8e/madura-objects/src/main/java/com/sun/tools/xjc/addon/MaduraJAXBInterceptor.java#L84-L128 | train | Run the command. | Create a Java method that does the following: "Run the command.". | Of course, here is the Java code you requested:
```java
public boolean run(final Outline model, final Options opt, final ErrorHandler errorHandler) {
// CPluginCustomization c = co.target.getCustomizations().find(NS,"code");
// if(c==null)
// continue; // no customization... | |
dlemmermann/CalendarFX | CalendarFXRecurrence/src/main/java/com/google/ical/values/RRule.java | RRule.approximateIntervalInDays | public int approximateIntervalInDays() {
int freqLengthDays;
int nPerPeriod = 0;
switch (this.freq) {
case DAILY:
freqLengthDays = 1;
break;
case WEEKLY:
freqLengthDays = 7;
if (!this.byDay.isEmpty()) {
... | java | public int approximateIntervalInDays() {
int freqLengthDays;
int nPerPeriod = 0;
switch (this.freq) {
case DAILY:
freqLengthDays = 1;
break;
case WEEKLY:
freqLengthDays = 7;
if (!this.byDay.isEmpty()) {
... | [
"public",
"int",
"approximateIntervalInDays",
"(",
")",
"{",
"int",
"freqLengthDays",
";",
"int",
"nPerPeriod",
"=",
"0",
";",
"switch",
"(",
"this",
".",
"freq",
")",
"{",
"case",
"DAILY",
":",
"freqLengthDays",
"=",
"1",
";",
"break",
";",
"case",
"WEE... | an approximate number of days between occurences. | [
"an",
"approximate",
"number",
"of",
"days",
"between",
"occurences",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXRecurrence/src/main/java/com/google/ical/values/RRule.java#L150-L205 | train | Returns the approximate interval in days. | Create a Java method that does the following: "Returns the approximate interval in days.". | Of course, here is the Java code you requested:
```java
public int approximateIntervalInDays() {
int freqLengthDays;
int nPerPeriod = 0;
switch (this.freq) {
case DAILY:
freqLengthDays = 1;
break;
case WEEKLY:
freqLengthDay... | |
jsonld-java/jsonld-java | core/src/main/java/com/github/jsonldjava/core/JsonLdApi.java | JsonLdApi.initialize | private void initialize(Object input, Object context) throws JsonLdError {
if (input instanceof List || input instanceof Map) {
this.value = JsonLdUtils.clone(input);
}
// TODO: string/IO input
this.context = new Context(opts);
if (context != null) {
this.... | java | private void initialize(Object input, Object context) throws JsonLdError {
if (input instanceof List || input instanceof Map) {
this.value = JsonLdUtils.clone(input);
}
// TODO: string/IO input
this.context = new Context(opts);
if (context != null) {
this.... | [
"private",
"void",
"initialize",
"(",
"Object",
"input",
",",
"Object",
"context",
")",
"throws",
"JsonLdError",
"{",
"if",
"(",
"input",
"instanceof",
"List",
"||",
"input",
"instanceof",
"Map",
")",
"{",
"this",
".",
"value",
"=",
"JsonLdUtils",
".",
"cl... | Initializes this object by cloning the input object using
{@link JsonLdUtils#clone(Object)}, and by parsing the context using
{@link Context#parse(Object)}.
@param input
The initial object, which is to be cloned and used in
operations.
@param context
The context object, which is to be parsed and used in
operations.
@t... | [
"Initializes",
"this",
"object",
"by",
"cloning",
"the",
"input",
"object",
"using",
"{",
"@link",
"JsonLdUtils#clone",
"(",
"Object",
")",
"}",
"and",
"by",
"parsing",
"the",
"context",
"using",
"{",
"@link",
"Context#parse",
"(",
"Object",
")",
"}",
"."
] | efeef6ee96029a0011649633457035fa6be42da1 | https://github.com/jsonld-java/jsonld-java/blob/efeef6ee96029a0011649633457035fa6be42da1/core/src/main/java/com/github/jsonldjava/core/JsonLdApi.java#L121-L130 | train | Initialize the object. | Create a Java method that does the following: "Initialize the object.". | Of course, here is the Java code you requested:
```java
private void initialize(Object input, Object context) throws JsonLdError {
if (input instanceof List || input instanceof Map) {
this.value = JsonLdUtils.clone(input);
}
// TODO: string/IO input
this.context = new Contex... | |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/db/record/ridbag/ORidBag.java | ORidBag.tryMerge | public boolean tryMerge(final ORidBag otherValue, boolean iMergeSingleItemsOfMultiValueFields) {
if (!isEmbedded() && !otherValue.isEmbedded()) {
final OSBTreeRidBag thisTree = (OSBTreeRidBag) delegate;
final OSBTreeRidBag otherTree = (OSBTreeRidBag) otherValue.delegate;
if (thisTree.getCollection... | java | public boolean tryMerge(final ORidBag otherValue, boolean iMergeSingleItemsOfMultiValueFields) {
if (!isEmbedded() && !otherValue.isEmbedded()) {
final OSBTreeRidBag thisTree = (OSBTreeRidBag) delegate;
final OSBTreeRidBag otherTree = (OSBTreeRidBag) otherValue.delegate;
if (thisTree.getCollection... | [
"public",
"boolean",
"tryMerge",
"(",
"final",
"ORidBag",
"otherValue",
",",
"boolean",
"iMergeSingleItemsOfMultiValueFields",
")",
"{",
"if",
"(",
"!",
"isEmbedded",
"(",
")",
"&&",
"!",
"otherValue",
".",
"isEmbedded",
"(",
")",
")",
"{",
"final",
"OSBTreeRi... | IMPORTANT! Only for internal usage. | [
"IMPORTANT!",
"Only",
"for",
"internal",
"usage",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/db/record/ridbag/ORidBag.java#L424-L457 | test | Try to merge two bag objects. | Create a Java method that does the following: "Try to merge two bag objects.". | Of course, here is the Java code you requested:
```java
public boolean tryMerge(final ORidBag otherValue, boolean iMergeSingleItemsOfMultiValueFields) {
if (!isEmbedded() && !otherValue.isEmbedded()) {
final OSBTreeRidBag thisTree = (OSBTreeRidBag) delegate;
final OSBTreeRidBag otherTree = (OSBTreeRidB... | |
buschmais/extended-objects | neo4j/remote/src/main/java/com/buschmais/xo/neo4j/remote/impl/datastore/RemoteDatastoreEntityManager.java | RemoteDatastoreEntityManager.getLabelExpression | private StringBuilder getLabelExpression(Set<RemoteLabel> remoteLabels) {
StringBuilder labels = new StringBuilder();
for (RemoteLabel remoteLabel : remoteLabels) {
labels.append(':').append(remoteLabel.getName());
}
return labels;
} | java | private StringBuilder getLabelExpression(Set<RemoteLabel> remoteLabels) {
StringBuilder labels = new StringBuilder();
for (RemoteLabel remoteLabel : remoteLabels) {
labels.append(':').append(remoteLabel.getName());
}
return labels;
} | [
"private",
"StringBuilder",
"getLabelExpression",
"(",
"Set",
"<",
"RemoteLabel",
">",
"remoteLabels",
")",
"{",
"StringBuilder",
"labels",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"RemoteLabel",
"remoteLabel",
":",
"remoteLabels",
")",
"{",
"labe... | Creates an expression for adding labels, e.g. ":Person:Customer".
@param remoteLabels
The labels.
@return The expression. | [
"Creates",
"an",
"expression",
"for",
"adding",
"labels",
"e",
".",
"g",
".",
":",
"Person",
":",
"Customer",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/neo4j/remote/src/main/java/com/buschmais/xo/neo4j/remote/impl/datastore/RemoteDatastoreEntityManager.java#L218-L224 | train | Get the label expression for the remoteLabels | Create a Java method that does the following: "Get the label expression for the remoteLabels". | Of course, here is the Java code you requested:
```java
private StringBuilder getLabelExpression(Set<RemoteLabel> remoteLabels) {
StringBuilder labels = new StringBuilder();
for (RemoteLabel remoteLabel : remoteLabels) {
labels.append(':').append(remoteLabel.getName());
}
re... | |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgFile.java | DwgFile.manageBlockEntity | private void manageBlockEntity( DwgObject entity, double[] bPoint, Point2D insPoint,
double[] scale, double rot, int id, Vector dwgObjectsWithoutBlocks ) {
if (entity instanceof DwgArc) {
// System.out.println("Encuentra un arco dentro de un bloque ...");
DwgArc transformedEn... | java | private void manageBlockEntity( DwgObject entity, double[] bPoint, Point2D insPoint,
double[] scale, double rot, int id, Vector dwgObjectsWithoutBlocks ) {
if (entity instanceof DwgArc) {
// System.out.println("Encuentra un arco dentro de un bloque ...");
DwgArc transformedEn... | [
"private",
"void",
"manageBlockEntity",
"(",
"DwgObject",
"entity",
",",
"double",
"[",
"]",
"bPoint",
",",
"Point2D",
"insPoint",
",",
"double",
"[",
"]",
"scale",
",",
"double",
"rot",
",",
"int",
"id",
",",
"Vector",
"dwgObjectsWithoutBlocks",
")",
"{",
... | Changes the location of an object extracted from a block. This location will be
obtained through the insertion parameters from the block and the corresponding
insert.
@param entity, the entity extracted from the block.
@param bPoint, offset for the coordinates of the entity.
@param insPoint, coordinates of the insertio... | [
"Changes",
"the",
"location",
"of",
"an",
"object",
"extracted",
"from",
"a",
"block",
".",
"This",
"location",
"will",
"be",
"obtained",
"through",
"the",
"insertion",
"parameters",
"from",
"the",
"block",
"and",
"the",
"corresponding",
"insert",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgFile.java#L653-L922 | train | Manage a block entity in a DWG file. | Create a Java method that does the following: "Manage a block entity in a DWG file.". | Of course, here is the Java code you requested:
```java
private void manageBlockEntity( DwgObject entity, double[] bPoint, Point2D insPoint,
double[] scale, double rot, int id, Vector dwgObjectsWithoutBlocks ) {
if (entity instanceof DwgArc) {
// System.out.println("Encuentra un arco de... | |
fuinorg/objects4j | src/main/java/org/fuin/objects4j/vo/DayOpeningHours.java | DayOpeningHours.remove | @Nullable
public final DayOpeningHours remove(@NotNull final DayOpeningHours other) {
Contract.requireArgNotNull("other", other);
return this.remove(other.hourRanges);
} | java | @Nullable
public final DayOpeningHours remove(@NotNull final DayOpeningHours other) {
Contract.requireArgNotNull("other", other);
return this.remove(other.hourRanges);
} | [
"@",
"Nullable",
"public",
"final",
"DayOpeningHours",
"remove",
"(",
"@",
"NotNull",
"final",
"DayOpeningHours",
"other",
")",
"{",
"Contract",
".",
"requireArgNotNull",
"(",
"\"other\"",
",",
"other",
")",
";",
"return",
"this",
".",
"remove",
"(",
"other",
... | Removes some hour ranges from this instance and returns a new one. The day of the argument is ignored.<br>
<br>
It is only allowed to call this method if the hour ranges represents only one day. This means a value like '18:00-03:00' will lead to
an error. To avoid this, call the {@link #normalize()} function before thi... | [
"Removes",
"some",
"hour",
"ranges",
"from",
"this",
"instance",
"and",
"returns",
"a",
"new",
"one",
".",
"The",
"day",
"of",
"the",
"argument",
"is",
"ignored",
".",
"<br",
">",
"<br",
">",
"It",
"is",
"only",
"allowed",
"to",
"call",
"this",
"method... | e7f278b5bae073ebb6a76053650571c718f36246 | https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/vo/DayOpeningHours.java#L339-L344 | train | Removes the given day opening hours from this calendar. | Create a Java method that does the following: "Removes the given day opening hours from this calendar.". | Of course, here is the Java code you requested:
```java
@Nullable
public final DayOpeningHours remove(@NotNull final DayOpeningHours other) {
Contract.requireArgNotNull("other", other);
return this.remove(other.hourRanges);
}
```
Hope this helps! | |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkWatchersInner.java | NetworkWatchersInner.getNetworkConfigurationDiagnosticWithServiceResponseAsync | public Observable<ServiceResponse<NetworkConfigurationDiagnosticResponseInner>> getNetworkConfigurationDiagnosticWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) {
if (resourceGroupName == null) {
throw new IllegalArgu... | java | public Observable<ServiceResponse<NetworkConfigurationDiagnosticResponseInner>> getNetworkConfigurationDiagnosticWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) {
if (resourceGroupName == null) {
throw new IllegalArgu... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"NetworkConfigurationDiagnosticResponseInner",
">",
">",
"getNetworkConfigurationDiagnosticWithServiceResponseAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"NetworkConfigurationDiagnosticPara... | Get network configuration diagnostic.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher.
@param parameters Parameters to get network configuration diagnostic.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observabl... | [
"Get",
"network",
"configuration",
"diagnostic",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkWatchersInner.java#L2702-L2719 | train | Get a diagnostic message for a specific network configuration. | Create a Java method that does the following: "Get a diagnostic message for a specific network configuration.". | Of course, here is the Java code you requested:
```java
public Observable<ServiceResponse<NetworkConfigurationDiagnosticResponseInner>> getNetworkConfigurationDiagnosticWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) {
if (resou... | |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/seg/common/CWSEvaluator.java | CWSEvaluator.evaluate | public static Result evaluate(String goldFile, String predFile, String dictPath) throws IOException
{
IOUtil.LineIterator goldIter = new IOUtil.LineIterator(goldFile);
IOUtil.LineIterator predIter = new IOUtil.LineIterator(predFile);
CWSEvaluator evaluator = new CWSEvaluator(dictPath);
... | java | public static Result evaluate(String goldFile, String predFile, String dictPath) throws IOException
{
IOUtil.LineIterator goldIter = new IOUtil.LineIterator(goldFile);
IOUtil.LineIterator predIter = new IOUtil.LineIterator(predFile);
CWSEvaluator evaluator = new CWSEvaluator(dictPath);
... | [
"public",
"static",
"Result",
"evaluate",
"(",
"String",
"goldFile",
",",
"String",
"predFile",
",",
"String",
"dictPath",
")",
"throws",
"IOException",
"{",
"IOUtil",
".",
"LineIterator",
"goldIter",
"=",
"new",
"IOUtil",
".",
"LineIterator",
"(",
"goldFile",
... | 在标准答案与分词结果上执行评测
@param goldFile
@param predFile
@return | [
"在标准答案与分词结果上执行评测"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/seg/common/CWSEvaluator.java#L235-L245 | train | Evaluate the CWSE formula. | Create a Java method that does the following: "Evaluate the CWSE formula.". | Of course, here is the Java code you requested:
```java
public static Result evaluate(String goldFile, String predFile, String dictPath) throws IOException
{
IOUtil.LineIterator goldIter = new IOUtil.LineIterator(goldFile);
IOUtil.LineIterator predIter = new IOUtil.LineIterator(predFile);
C... | |
52inc/android-52Kit | library/src/main/java/com/ftinc/kit/util/MediaUtils.java | MediaUtils.getChooseMediaIntent | public static Intent getChooseMediaIntent(String mimeType){
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType(mimeType);
return intent;
} | java | public static Intent getChooseMediaIntent(String mimeType){
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType(mimeType);
return intent;
} | [
"public",
"static",
"Intent",
"getChooseMediaIntent",
"(",
"String",
"mimeType",
")",
"{",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
"Intent",
".",
"ACTION_GET_CONTENT",
")",
";",
"intent",
".",
"addCategory",
"(",
"Intent",
".",
"CATEGORY_OPENABLE",
")",
... | Generate the appropriate intent to launch the document chooser to allow the user
to pick an image to upload.
@see #PICK_MEDIA_REQUEST_CODE
@param mimeType the MIME type you want to constrict the chooser to
@return the choose media intent | [
"Generate",
"the",
"appropriate",
"intent",
"to",
"launch",
"the",
"document",
"chooser",
"to",
"allow",
"the",
"user",
"to",
"pick",
"an",
"image",
"to",
"upload",
"."
] | 8644fab0f633477b1bb1dddd8147a9ef8bc03516 | https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library/src/main/java/com/ftinc/kit/util/MediaUtils.java#L101-L106 | train | Get an intent to choose a media type from the application. | Create a Java method that does the following: "Get an intent to choose a media type from the application.". | Of course, here is the Java code you requested:
```java
public static Intent getChooseMediaIntent(String mimeType){
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType(mimeType);
return intent;
}
```
Hope this helps! | |
JadiraOrg/jadira | bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java | BasicBinder.convertTo | public <S, T> T convertTo(ConverterKey<S,T> key, Object object) {
if (object == null) {
return null;
}
Converter<S, T> conv = findConverter(key.getInputClass(), key.getOutputClass(), key.getQualifierAnnotation() == null ? DefaultBinding.class : key.getQualifierAnnotation());
if (conv == null) ... | java | public <S, T> T convertTo(ConverterKey<S,T> key, Object object) {
if (object == null) {
return null;
}
Converter<S, T> conv = findConverter(key.getInputClass(), key.getOutputClass(), key.getQualifierAnnotation() == null ? DefaultBinding.class : key.getQualifierAnnotation());
if (conv == null) ... | [
"public",
"<",
"S",
",",
"T",
">",
"T",
"convertTo",
"(",
"ConverterKey",
"<",
"S",
",",
"T",
">",
"key",
",",
"Object",
"object",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Converter",
"<",
"S",
",",
"T... | Convert an object which is an instance of source class to the given target class
@param key The converter key to use
@param object The object to be converted | [
"Convert",
"an",
"object",
"which",
"is",
"an",
"instance",
"of",
"source",
"class",
"to",
"the",
"given",
"target",
"class"
] | d55d0238395f0cb900531f1f08b4b2d87fa9a4f6 | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java#L815-L830 | train | Converts an object to an object of the specified type using the specified converter key. | Create a Java method that does the following: "Converts an object to an object of the specified type using the specified converter key.". | Of course, here is the Java code you requested:
```java
public <S, T> T convertTo(ConverterKey<S,T> key, Object object) {
if (object == null) {
return null;
}
Converter<S, T> conv = findConverter(key.getInputClass(), key.getOutputClass(), key.getQualifierAnnotation() == null ? DefaultBinding.class :... | |
maven-nar/nar-maven-plugin | src/main/java/com/github/maven_nar/cpptasks/DistributerDef.java | DistributerDef.getHosts | public String getHosts() {
if (isReference()) {
final DistributerDef refDistributer = (DistributerDef) getCheckedRef(DistributerDef.class, "DistributerDef");
return refDistributer.getHosts();
}
return this.hosts;
} | java | public String getHosts() {
if (isReference()) {
final DistributerDef refDistributer = (DistributerDef) getCheckedRef(DistributerDef.class, "DistributerDef");
return refDistributer.getHosts();
}
return this.hosts;
} | [
"public",
"String",
"getHosts",
"(",
")",
"{",
"if",
"(",
"isReference",
"(",
")",
")",
"{",
"final",
"DistributerDef",
"refDistributer",
"=",
"(",
"DistributerDef",
")",
"getCheckedRef",
"(",
"DistributerDef",
".",
"class",
",",
"\"DistributerDef\"",
")",
";"... | Gets hosts.
@return hosts, may be null. | [
"Gets",
"hosts",
"."
] | 3c622e2024296b4203431bbae3bde290a01dac00 | https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/DistributerDef.java#L101-L107 | train | Gets the hosts. | Create a Java method that does the following: "Gets the hosts.". | Of course, here is the Java code you requested:
```java
public String getHosts() {
if (isReference()) {
final DistributerDef refDistributer = (DistributerDef) getCheckedRef(DistributerDef.class, "DistributerDef");
return refDistributer.getHosts();
}
return this.hosts;
}
```
Hope this helps! | |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java | ClassWriterImpl.addSuperInterfacesInfo | @Override
public void addSuperInterfacesInfo(Content classInfoTree) {
SortedSet<TypeMirror> interfaces =
new TreeSet<>(utils.makeTypeMirrorIndexUseComparator());
interfaces.addAll(utils.getAllInterfaces(typeElement));
if (utils.isInterface(typeElement) && !interfaces.isEmpty... | java | @Override
public void addSuperInterfacesInfo(Content classInfoTree) {
SortedSet<TypeMirror> interfaces =
new TreeSet<>(utils.makeTypeMirrorIndexUseComparator());
interfaces.addAll(utils.getAllInterfaces(typeElement));
if (utils.isInterface(typeElement) && !interfaces.isEmpty... | [
"@",
"Override",
"public",
"void",
"addSuperInterfacesInfo",
"(",
"Content",
"classInfoTree",
")",
"{",
"SortedSet",
"<",
"TypeMirror",
">",
"interfaces",
"=",
"new",
"TreeSet",
"<>",
"(",
"utils",
".",
"makeTypeMirrorIndexUseComparator",
"(",
")",
")",
";",
"in... | {@inheritDoc} | [
"{"
] | a53d069bbdb2c60232ed3811c19b65e41c3e60e0 | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java#L537-L550 | train | Add the super interfaces info. | Create a Java method that does the following: "Add the super interfaces info.". | Of course, here is the Java code you requested:
```java
@Override
public void addSuperInterfacesInfo(Content classInfoTree) {
SortedSet<TypeMirror> interfaces =
new TreeSet<>(utils.makeTypeMirrorIndexUseComparator());
interfaces.addAll(utils.getAllInterfaces(typeElement));
... | |
apache/groovy | src/main/java/org/codehaus/groovy/control/io/AbstractReaderSource.java | AbstractReaderSource.cleanup | public void cleanup() {
if (lineSource != null) {
try {
lineSource.close();
} catch (Exception e) {
// Ignore
}
}
lineSource = null;
line = null;
number = 0;
} | java | public void cleanup() {
if (lineSource != null) {
try {
lineSource.close();
} catch (Exception e) {
// Ignore
}
}
lineSource = null;
line = null;
number = 0;
} | [
"public",
"void",
"cleanup",
"(",
")",
"{",
"if",
"(",
"lineSource",
"!=",
"null",
")",
"{",
"try",
"{",
"lineSource",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"// Ignore",
"}",
"}",
"lineSource",
"=",
"null",
";"... | Cleans up any cached resources used by getLine(). | [
"Cleans",
"up",
"any",
"cached",
"resources",
"used",
"by",
"getLine",
"()",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/control/io/AbstractReaderSource.java#L103-L115 | train | Clean up the data structures. | Create a Java method that does the following: "Clean up the data structures.". | Of course, here is the Java code you requested:
```java
public void cleanup() {
if (lineSource != null) {
try {
lineSource.close();
} catch (Exception e) {
// Ignore
}
}
lineSource = null;
line = null;
number =... | |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/json/JsonFactory.java | JsonFactory.fromInputStream | public final <T> T fromInputStream(InputStream inputStream, Class<T> destinationClass)
throws IOException {
return createJsonParser(inputStream).parseAndClose(destinationClass);
} | java | public final <T> T fromInputStream(InputStream inputStream, Class<T> destinationClass)
throws IOException {
return createJsonParser(inputStream).parseAndClose(destinationClass);
} | [
"public",
"final",
"<",
"T",
">",
"T",
"fromInputStream",
"(",
"InputStream",
"inputStream",
",",
"Class",
"<",
"T",
">",
"destinationClass",
")",
"throws",
"IOException",
"{",
"return",
"createJsonParser",
"(",
"inputStream",
")",
".",
"parseAndClose",
"(",
"... | Parse and close an input stream as a JSON object, array, or value into a new instance of the
given destination class using {@link JsonParser#parseAndClose(Class)}.
<p>Tries to detect the charset of the input stream automatically.
@param inputStream JSON value in an input stream
@param destinationClass destination cla... | [
"Parse",
"and",
"close",
"an",
"input",
"stream",
"as",
"a",
"JSON",
"object",
"array",
"or",
"value",
"into",
"a",
"new",
"instance",
"of",
"the",
"given",
"destination",
"class",
"using",
"{",
"@link",
"JsonParser#parseAndClose",
"(",
"Class",
")",
"}",
... | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/json/JsonFactory.java#L197-L200 | train | Create a new object from an input stream. | Create a Java method that does the following: "Create a new object from an input stream.". | Of course, here is the Java code you requested:
```java
public final <T> T fromInputStream(InputStream inputStream, Class<T> destinationClass)
throws IOException {
return createJsonParser(inputStream).parseAndClose(destinationClass);
}
```
Hope this helps! | |
lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/deser/RawExceptionMessage.java | RawExceptionMessage.messageAsText | public String messageAsText() {
if (protocol.charset().isPresent()) {
return message.decodeString(protocol.charset().get());
} else {
return Base64.getEncoder().encodeToString(message.toArray());
}
} | java | public String messageAsText() {
if (protocol.charset().isPresent()) {
return message.decodeString(protocol.charset().get());
} else {
return Base64.getEncoder().encodeToString(message.toArray());
}
} | [
"public",
"String",
"messageAsText",
"(",
")",
"{",
"if",
"(",
"protocol",
".",
"charset",
"(",
")",
".",
"isPresent",
"(",
")",
")",
"{",
"return",
"message",
".",
"decodeString",
"(",
"protocol",
".",
"charset",
"(",
")",
".",
"get",
"(",
")",
")",... | Get the message as text.
If this is a binary message (that is, the message protocol does not define a charset), encodes it using Base64.
@return The message as text. | [
"Get",
"the",
"message",
"as",
"text",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/deser/RawExceptionMessage.java#L73-L79 | train | Returns the message as text. | Create a Java method that does the following: "Returns the message as text.". | Of course, here is the Java code you requested:
```java
public String messageAsText() {
if (protocol.charset().isPresent()) {
return message.decodeString(protocol.charset().get());
} else {
return Base64.getEncoder().encodeToString(message.toArray());
}
}
```
Hope t... | |
ykrasik/jaci | jaci-core/src/main/java/com/github/ykrasik/jaci/reflection/param/ReflectionParamProcessor.java | ReflectionParamProcessor.createParam | public ParamDef<?> createParam(Object instance, ReflectionParameter param) {
Objects.requireNonNull(instance, "instance");
Objects.requireNonNull(param, "param");
try {
for (MethodParamFactory<?> factory : factories) {
final Opt<? extends ParamDef<?>> def = factory.cr... | java | public ParamDef<?> createParam(Object instance, ReflectionParameter param) {
Objects.requireNonNull(instance, "instance");
Objects.requireNonNull(param, "param");
try {
for (MethodParamFactory<?> factory : factories) {
final Opt<? extends ParamDef<?>> def = factory.cr... | [
"public",
"ParamDef",
"<",
"?",
">",
"createParam",
"(",
"Object",
"instance",
",",
"ReflectionParameter",
"param",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"instance",
",",
"\"instance\"",
")",
";",
"Objects",
".",
"requireNonNull",
"(",
"param",
",",... | Create a {@link ParamDef}s out of a method parameter with optional annotations, through reflection.
Since parameter names aren't always available to be reflected, parameter names can only be set through
the annotation. If absent, a name will be generated for the parameter.
@param instance The instance that contains th... | [
"Create",
"a",
"{",
"@link",
"ParamDef",
"}",
"s",
"out",
"of",
"a",
"method",
"parameter",
"with",
"optional",
"annotations",
"through",
"reflection",
".",
"Since",
"parameter",
"names",
"aren",
"t",
"always",
"available",
"to",
"be",
"reflected",
"parameter"... | 4615edef7c76288ad5ea8d678132b161645ca1e3 | https://github.com/ykrasik/jaci/blob/4615edef7c76288ad5ea8d678132b161645ca1e3/jaci-core/src/main/java/com/github/ykrasik/jaci/reflection/param/ReflectionParamProcessor.java#L69-L85 | train | Create a param from an instance and reflection parameter. | Create a Java method that does the following: "Create a param from an instance and reflection parameter.". | Of course, here is the Java code you requested:
```java
public ParamDef<?> createParam(Object instance, ReflectionParameter param) {
Objects.requireNonNull(instance, "instance");
Objects.requireNonNull(param, "param");
try {
for (MethodParamFactory<?> factory : factories) {
... | |
phax/peppol-directory | peppol-directory-indexer/src/main/java/com/helger/pd/indexer/index/IndexerWorkItemQueue.java | IndexerWorkItemQueue.stop | @Nonnull
@ReturnsMutableCopy
public ICommonsList <IIndexerWorkItem> stop ()
{
// don't take any more actions
m_aImmediateCollector.stopQueuingNewObjects ();
// Get all remaining objects and save them for late reuse
final ICommonsList <IIndexerWorkItem> aRemainingItems = m_aImmediateCollector.drai... | java | @Nonnull
@ReturnsMutableCopy
public ICommonsList <IIndexerWorkItem> stop ()
{
// don't take any more actions
m_aImmediateCollector.stopQueuingNewObjects ();
// Get all remaining objects and save them for late reuse
final ICommonsList <IIndexerWorkItem> aRemainingItems = m_aImmediateCollector.drai... | [
"@",
"Nonnull",
"@",
"ReturnsMutableCopy",
"public",
"ICommonsList",
"<",
"IIndexerWorkItem",
">",
"stop",
"(",
")",
"{",
"// don't take any more actions",
"m_aImmediateCollector",
".",
"stopQueuingNewObjects",
"(",
")",
";",
"// Get all remaining objects and save them for la... | Stop the indexer work queue immediately.
@return The list of all remaining objects in the queue. Never
<code>null</code>. | [
"Stop",
"the",
"indexer",
"work",
"queue",
"immediately",
"."
] | 98da26da29fb7178371d6b029516cbf01be223fb | https://github.com/phax/peppol-directory/blob/98da26da29fb7178371d6b029516cbf01be223fb/peppol-directory-indexer/src/main/java/com/helger/pd/indexer/index/IndexerWorkItemQueue.java#L83-L97 | train | Stop all the items in the CRT. | Create a Java method that does the following: "Stop all the items in the CRT.". | Of course, here is the Java code you requested:
```java
@Nonnull
@ReturnsMutableCopy
public ICommonsList <IIndexerWorkItem> stop ()
{
// don't take any more actions
m_aImmediateCollector.stopQueuingNewObjects ();
// Get all remaining objects and save them for late reuse
final ICommonsList <IInde... | |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/job/InstallRequest.java | InstallRequest.setExtensionProperty | public Object setExtensionProperty(String key, Object value)
{
return getExtensionProperties().put(key, value);
} | java | public Object setExtensionProperty(String key, Object value)
{
return getExtensionProperties().put(key, value);
} | [
"public",
"Object",
"setExtensionProperty",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"return",
"getExtensionProperties",
"(",
")",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Sets a custom extension property to be set on each of the extensions that are going to be installed from this
request.
@param key the property name
@param value the new property value
@return the previous property value
@since 7.0M2 | [
"Sets",
"a",
"custom",
"extension",
"property",
"to",
"be",
"set",
"on",
"each",
"of",
"the",
"extensions",
"that",
"are",
"going",
"to",
"be",
"installed",
"from",
"this",
"request",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/job/InstallRequest.java#L84-L87 | train | Sets an extension property. | Create a Java method that does the following: "Sets an extension property.". | Of course, here is the Java code you requested:
```java
public Object setExtensionProperty(String key, Object value)
{
return getExtensionProperties().put(key, value);
}
```
Hope this helps! | |
lagom/lagom | persistence/javadsl/src/main/java/com/lightbend/lagom/javadsl/persistence/PersistentEntityRef.java | PersistentEntityRef.ask | @SuppressWarnings("unchecked")
public <Reply, Cmd extends Object & PersistentEntity.ReplyType<Reply>> CompletionStage<Reply> ask(Cmd command) {
CompletionStage<Object> future = Patterns.ask(region, new CommandEnvelope(entityId, command), timeout);
return future.thenCompose(result -> {
if (result insta... | java | @SuppressWarnings("unchecked")
public <Reply, Cmd extends Object & PersistentEntity.ReplyType<Reply>> CompletionStage<Reply> ask(Cmd command) {
CompletionStage<Object> future = Patterns.ask(region, new CommandEnvelope(entityId, command), timeout);
return future.thenCompose(result -> {
if (result insta... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"Reply",
",",
"Cmd",
"extends",
"Object",
"&",
"PersistentEntity",
".",
"ReplyType",
"<",
"Reply",
">",
">",
"CompletionStage",
"<",
"Reply",
">",
"ask",
"(",
"Cmd",
"command",
")",
"{",
"C... | Send the <code>command</code> to the {@link PersistentEntity}. The returned
<code>CompletionStage</code> will be completed with the reply from the <code>PersistentEntity</code>.
The type of the reply is defined by the command (see {@link PersistentEntity.ReplyType}).
<p>
The <code>CompletionStage</code> may also be com... | [
"Send",
"the",
"<code",
">",
"command<",
"/",
"code",
">",
"to",
"the",
"{"
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/persistence/javadsl/src/main/java/com/lightbend/lagom/javadsl/persistence/PersistentEntityRef.java#L67-L82 | train | Ask for a new CRS command. | Create a Java method that does the following: "Ask for a new CRS command.". | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public <Reply, Cmd extends Object & PersistentEntity.ReplyType<Reply>> CompletionStage<Reply> ask(Cmd command) {
CompletionStage<Object> future = Patterns.ask(region, new CommandEnvelope(entityId, command), timeout);
ret... | |
oblac/jodd | jodd-proxetta/src/main/java/jodd/asm7/MethodWriter.java | MethodWriter.putMethodInfo | void putMethodInfo(final ByteVector output) {
boolean useSyntheticAttribute = symbolTable.getMajorVersion() < Opcodes.V1_5;
int mask = useSyntheticAttribute ? Opcodes.ACC_SYNTHETIC : 0;
output.putShort(accessFlags & ~mask).putShort(nameIndex).putShort(descriptorIndex);
// If this method_info must be cop... | java | void putMethodInfo(final ByteVector output) {
boolean useSyntheticAttribute = symbolTable.getMajorVersion() < Opcodes.V1_5;
int mask = useSyntheticAttribute ? Opcodes.ACC_SYNTHETIC : 0;
output.putShort(accessFlags & ~mask).putShort(nameIndex).putShort(descriptorIndex);
// If this method_info must be cop... | [
"void",
"putMethodInfo",
"(",
"final",
"ByteVector",
"output",
")",
"{",
"boolean",
"useSyntheticAttribute",
"=",
"symbolTable",
".",
"getMajorVersion",
"(",
")",
"<",
"Opcodes",
".",
"V1_5",
";",
"int",
"mask",
"=",
"useSyntheticAttribute",
"?",
"Opcodes",
".",... | Puts the content of the method_info JVMS structure generated by this MethodWriter into the
given ByteVector.
@param output where the method_info structure must be put. | [
"Puts",
"the",
"content",
"of",
"the",
"method_info",
"JVMS",
"structure",
"generated",
"by",
"this",
"MethodWriter",
"into",
"the",
"given",
"ByteVector",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/MethodWriter.java#L2208-L2430 | test | Put the method_info into the given ByteVector. | Create a Java method that does the following: "Put the method_info into the given ByteVector.". | Of course, here is the Java code you requested:
```java
void putMethodInfo(final ByteVector output) {
boolean useSyntheticAttribute = symbolTable.getMajorVersion() < Opcodes.V1_5;
int mask = useSyntheticAttribute ? Opcodes.ACC_SYNTHETIC : 0;
output.putShort(accessFlags & ~mask).putShort(nameIndex).putShort... | |
zaproxy/zaproxy | src/org/zaproxy/zap/control/AddOn.java | AddOn.getExtensionAddOnClassnames | public AddOnClassnames getExtensionAddOnClassnames(String classname) {
if (extensionsWithDeps.isEmpty() || classname == null || classname.isEmpty()) {
return AddOnClassnames.ALL_ALLOWED;
}
for (ExtensionWithDeps extension : extensionsWithDeps) {
if (classname.equals(extension.getClassname())) {
... | java | public AddOnClassnames getExtensionAddOnClassnames(String classname) {
if (extensionsWithDeps.isEmpty() || classname == null || classname.isEmpty()) {
return AddOnClassnames.ALL_ALLOWED;
}
for (ExtensionWithDeps extension : extensionsWithDeps) {
if (classname.equals(extension.getClassname())) {
... | [
"public",
"AddOnClassnames",
"getExtensionAddOnClassnames",
"(",
"String",
"classname",
")",
"{",
"if",
"(",
"extensionsWithDeps",
".",
"isEmpty",
"(",
")",
"||",
"classname",
"==",
"null",
"||",
"classname",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"AddO... | Returns the classnames that can be loaded for the given {@code Extension} (with dependencies).
@param classname the classname of the extension
@return the classnames that can be loaded
@since 2.4.3
@see #hasExtensionsWithDeps() | [
"Returns",
"the",
"classnames",
"that",
"can",
"be",
"loaded",
"for",
"the",
"given",
"{",
"@code",
"Extension",
"}",
"(",
"with",
"dependencies",
")",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/control/AddOn.java#L857-L868 | train | Gets the add - on classnames for the given classname. | Create a Java method that does the following: "Gets the add - on classnames for the given classname.". | Of course, here is the Java code you requested:
```java
public AddOnClassnames getExtensionAddOnClassnames(String classname) {
if (extensionsWithDeps.isEmpty() || classname == null || classname.isEmpty()) {
return AddOnClassnames.ALL_ALLOWED;
}
for (ExtensionWithDeps extension : extensionsWithDeps) {
... | |
HanSolo/tilesfx | src/main/java/eu/hansolo/tilesfx/Tile.java | Tile.setSectionsAlwaysVisible | public void setSectionsAlwaysVisible(final boolean VISIBLE) {
if (null == sectionsAlwaysVisible) {
_sectionsAlwaysVisible = VISIBLE;
fireTileEvent(REDRAW_EVENT);
} else {
sectionsAlwaysVisible.set(VISIBLE);
}
} | java | public void setSectionsAlwaysVisible(final boolean VISIBLE) {
if (null == sectionsAlwaysVisible) {
_sectionsAlwaysVisible = VISIBLE;
fireTileEvent(REDRAW_EVENT);
} else {
sectionsAlwaysVisible.set(VISIBLE);
}
} | [
"public",
"void",
"setSectionsAlwaysVisible",
"(",
"final",
"boolean",
"VISIBLE",
")",
"{",
"if",
"(",
"null",
"==",
"sectionsAlwaysVisible",
")",
"{",
"_sectionsAlwaysVisible",
"=",
"VISIBLE",
";",
"fireTileEvent",
"(",
"REDRAW_EVENT",
")",
";",
"}",
"else",
"{... | Defines if the sections will always be visible.
This is currently only used in the IndicatorSkin
@param VISIBLE | [
"Defines",
"if",
"the",
"sections",
"will",
"always",
"be",
"visible",
".",
"This",
"is",
"currently",
"only",
"used",
"in",
"the",
"IndicatorSkin"
] | 36eb07b1119017beb851dad95256439224d1fcf4 | https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L3337-L3344 | train | Defines if the sections should be shown in the image. | Create a Java method that does the following: "Defines if the sections should be shown in the image.". | Of course, here is the Java code you requested:
```java
public void setSectionsAlwaysVisible(final boolean VISIBLE) {
if (null == sectionsAlwaysVisible) {
_sectionsAlwaysVisible = VISIBLE;
fireTileEvent(REDRAW_EVENT);
} else {
sectionsAlwaysVisible.set(VISIBLE);
... | |
bwkimmel/java-util | src/main/java/ca/eandb/util/io/FileUtil.java | FileUtil.readObjectFromFile | public static Object readObjectFromFile(File file) throws IOException, ClassNotFoundException {
FileInputStream fs = new FileInputStream(file);
ObjectInputStream os = new ObjectInputStream(fs);
Object object = os.readObject();
os.close();
return object;
} | java | public static Object readObjectFromFile(File file) throws IOException, ClassNotFoundException {
FileInputStream fs = new FileInputStream(file);
ObjectInputStream os = new ObjectInputStream(fs);
Object object = os.readObject();
os.close();
return object;
} | [
"public",
"static",
"Object",
"readObjectFromFile",
"(",
"File",
"file",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"FileInputStream",
"fs",
"=",
"new",
"FileInputStream",
"(",
"file",
")",
";",
"ObjectInputStream",
"os",
"=",
"new",
"Object... | Reads a single object from a file.
@param file The <code>File</code> to read from.
@return The <code>Object</code> read from the file.
@throws IOException If the file could not be read.
@throws ClassNotFoundException If the object's class could not be found. | [
"Reads",
"a",
"single",
"object",
"from",
"a",
"file",
"."
] | 0c03664d42f0e6b111f64447f222aa73c2819e5c | https://github.com/bwkimmel/java-util/blob/0c03664d42f0e6b111f64447f222aa73c2819e5c/src/main/java/ca/eandb/util/io/FileUtil.java#L175-L181 | train | Read an object from a file. | Create a Java method that does the following: "Read an object from a file.". | Of course, here is the Java code you requested:
```java
public static Object readObjectFromFile(File file) throws IOException, ClassNotFoundException {
FileInputStream fs = new FileInputStream(file);
ObjectInputStream os = new ObjectInputStream(fs);
Object object = os.readObject();
os.close();
retu... | |
alkacon/opencms-core | src-setup/org/opencms/setup/CmsAutoSetupProperties.java | CmsAutoSetupProperties.addProperty | private String addProperty(String key) {
if (System.getProperty(key) != null) {
m_configuration.put(key, System.getProperty(key));
}
return m_configuration.get(key);
} | java | private String addProperty(String key) {
if (System.getProperty(key) != null) {
m_configuration.put(key, System.getProperty(key));
}
return m_configuration.get(key);
} | [
"private",
"String",
"addProperty",
"(",
"String",
"key",
")",
"{",
"if",
"(",
"System",
".",
"getProperty",
"(",
"key",
")",
"!=",
"null",
")",
"{",
"m_configuration",
".",
"put",
"(",
"key",
",",
"System",
".",
"getProperty",
"(",
"key",
")",
")",
... | Adds and returns the property for the given key.<p>
@param key the key to add the property
@return the value of that property | [
"Adds",
"and",
"returns",
"the",
"property",
"for",
"the",
"given",
"key",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/CmsAutoSetupProperties.java#L568-L574 | train | Add a property to the configuration. | Create a Java method that does the following: "Add a property to the configuration.". | Of course, here is the Java code you requested:
```java
private String addProperty(String key) {
if (System.getProperty(key) != null) {
m_configuration.put(key, System.getProperty(key));
}
return m_configuration.get(key);
}
```
Hope this helps! | |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/application/StateManagerImpl.java | StateManagerImpl.saveView | @Override
public Object saveView(FacesContext facesContext)
{
UIViewRoot uiViewRoot = facesContext.getViewRoot();
if (uiViewRoot.isTransient())
{
return null;
}
Object serializedView = null;
ResponseStateManager responseStateManager =... | java | @Override
public Object saveView(FacesContext facesContext)
{
UIViewRoot uiViewRoot = facesContext.getViewRoot();
if (uiViewRoot.isTransient())
{
return null;
}
Object serializedView = null;
ResponseStateManager responseStateManager =... | [
"@",
"Override",
"public",
"Object",
"saveView",
"(",
"FacesContext",
"facesContext",
")",
"{",
"UIViewRoot",
"uiViewRoot",
"=",
"facesContext",
".",
"getViewRoot",
"(",
")",
";",
"if",
"(",
"uiViewRoot",
".",
"isTransient",
"(",
")",
")",
"{",
"return",
"nu... | Wrap the original method and redirect to VDL StateManagementStrategy when
necessary | [
"Wrap",
"the",
"original",
"method",
"and",
"redirect",
"to",
"VDL",
"StateManagementStrategy",
"when",
"necessary"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/application/StateManagerImpl.java#L182-L294 | train | Save the view. | Create a Java method that does the following: "Save the view.". | Of course, here is the Java code you requested:
```java
@Override
public Object saveView(FacesContext facesContext)
{
UIViewRoot uiViewRoot = facesContext.getViewRoot();
if (uiViewRoot.isTransient())
{
return null;
}
Object serializedView = ... | |
glyptodon/guacamole-client | extensions/guacamole-auth-openid/src/main/java/org/apache/guacamole/auth/openid/AuthenticationProviderService.java | AuthenticationProviderService.authenticateUser | public AuthenticatedUser authenticateUser(Credentials credentials)
throws GuacamoleException {
String username = null;
// Validate OpenID token in request, if present, and derive username
HttpServletRequest request = credentials.getRequest();
if (request != null) {
... | java | public AuthenticatedUser authenticateUser(Credentials credentials)
throws GuacamoleException {
String username = null;
// Validate OpenID token in request, if present, and derive username
HttpServletRequest request = credentials.getRequest();
if (request != null) {
... | [
"public",
"AuthenticatedUser",
"authenticateUser",
"(",
"Credentials",
"credentials",
")",
"throws",
"GuacamoleException",
"{",
"String",
"username",
"=",
"null",
";",
"// Validate OpenID token in request, if present, and derive username",
"HttpServletRequest",
"request",
"=",
... | Returns an AuthenticatedUser representing the user authenticated by the
given credentials.
@param credentials
The credentials to use for authentication.
@return
An AuthenticatedUser representing the user authenticated by the
given credentials.
@throws GuacamoleException
If an error occurs while authenticating the us... | [
"Returns",
"an",
"AuthenticatedUser",
"representing",
"the",
"user",
"authenticated",
"by",
"the",
"given",
"credentials",
"."
] | ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9 | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-openid/src/main/java/org/apache/guacamole/auth/openid/AuthenticationProviderService.java#L89-L130 | train | Authenticate a user using the OpenID token provided in the given credentials. | Create a Java method that does the following: "Authenticate a user using the OpenID token provided in the given credentials.". | Of course, here is the Java code you requested:
```java
public AuthenticatedUser authenticateUser(Credentials credentials)
throws GuacamoleException {
String username = null;
// Validate OpenID token in request, if present, and derive username
HttpServletRequest request = credenti... | |
biojava/biojava | biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/AminoAcidProperties.java | AminoAcidProperties.isCharged | public static final boolean isCharged(char aa) {
if (negChargedAAs.contains(String.valueOf(aa))) {
return true;
}
else if (posChargedAAs.contains(String.valueOf(aa))) {
return true;
}
return false;
} | java | public static final boolean isCharged(char aa) {
if (negChargedAAs.contains(String.valueOf(aa))) {
return true;
}
else if (posChargedAAs.contains(String.valueOf(aa))) {
return true;
}
return false;
} | [
"public",
"static",
"final",
"boolean",
"isCharged",
"(",
"char",
"aa",
")",
"{",
"if",
"(",
"negChargedAAs",
".",
"contains",
"(",
"String",
".",
"valueOf",
"(",
"aa",
")",
")",
")",
"{",
"return",
"true",
";",
"}",
"else",
"if",
"(",
"posChargedAAs",... | At pH=7, two are negative charged: aspartic acid (Asp, D) and glutamic acid (Glu, E) (acidic side chains),
and three are positive charged: lysine (Lys, K), arginine (Arg, R) and histidine (His, H) (basic side chains).
@param aa The one-letter amino acid code
@return true if amino acid is charged | [
"At",
"pH",
"=",
"7",
"two",
"are",
"negative",
"charged",
":",
"aspartic",
"acid",
"(",
"Asp",
"D",
")",
"and",
"glutamic",
"acid",
"(",
"Glu",
"E",
")",
"(",
"acidic",
"side",
"chains",
")",
"and",
"three",
"are",
"positive",
"charged",
":",
"lysin... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/AminoAcidProperties.java#L46-L54 | train | Checks if a character is charged. | Create a Java method that does the following: "Checks if a character is charged.". | Of course, here is the Java code you requested:
```java
public static final boolean isCharged(char aa) {
if (negChargedAAs.contains(String.valueOf(aa))) {
return true;
}
else if (posChargedAAs.contains(String.valueOf(aa))) {
return true;
}
return false;
}
```
Hope this helps! | |
Samsung/GearVRf | GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/data_types/MFInt32.java | MFInt32.setValue | public void setValue(int size, int[] newValue) {
try {
for (int i = 0; i < size; i++) {
value.add(i, newValue[i]);
//value.set( i, newValue );
}
}
catch (IndexOutOfBoundsException e) {
Log.e(TAG, ... | java | public void setValue(int size, int[] newValue) {
try {
for (int i = 0; i < size; i++) {
value.add(i, newValue[i]);
//value.set( i, newValue );
}
}
catch (IndexOutOfBoundsException e) {
Log.e(TAG, ... | [
"public",
"void",
"setValue",
"(",
"int",
"size",
",",
"int",
"[",
"]",
"newValue",
")",
"{",
"try",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"size",
";",
"i",
"++",
")",
"{",
"value",
".",
"add",
"(",
"i",
",",
"newValue",
"[",
... | Assign an array subset to this field.
@param size - number of new values | [
"Assign",
"an",
"array",
"subset",
"to",
"this",
"field",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/data_types/MFInt32.java#L144-L157 | train | Sets the value of the MFInt32. | Create a Java method that does the following: "Sets the value of the MFInt32.". | Of course, here is the Java code you requested:
```java
public void setValue(int size, int[] newValue) {
try {
for (int i = 0; i < size; i++) {
value.add(i, newValue[i]);
//value.set( i, newValue );
}
}
catch (I... | |
ReactiveX/RxJava | src/main/java/io/reactivex/Observable.java | Observable.concatMap | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final <R> Observable<R> concatMap(Function<? super T, ? extends ObservableSource<? extends R>> mapper, int prefetch) {
ObjectHelper.requireNonNull(mapper, "mapper is null");
ObjectHelper.verifyPositive(prefetch, "prefetch");
... | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final <R> Observable<R> concatMap(Function<? super T, ? extends ObservableSource<? extends R>> mapper, int prefetch) {
ObjectHelper.requireNonNull(mapper, "mapper is null");
ObjectHelper.verifyPositive(prefetch, "prefetch");
... | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"<",
"R",
">",
"Observable",
"<",
"R",
">",
"concatMap",
"(",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"ObservableSource",
"<",
... | Returns a new Observable that emits items resulting from applying a function that you supply to each item
emitted by the source ObservableSource, where that function returns an ObservableSource, and then emitting the items
that result from concatenating those resulting ObservableSources.
<p>
<img width="640" height="30... | [
"Returns",
"a",
"new",
"Observable",
"that",
"emits",
"items",
"resulting",
"from",
"applying",
"a",
"function",
"that",
"you",
"supply",
"to",
"each",
"item",
"emitted",
"by",
"the",
"source",
"ObservableSource",
"where",
"that",
"function",
"returns",
"an",
... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L6466-L6480 | test | Concatenates the source observable with the result of applying the supplied function to each element of the source observable. | Create a Java method that does the following: "Concatenates the source observable with the result of applying the supplied function to each element of the source observable.". | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final <R> Observable<R> concatMap(Function<? super T, ? extends ObservableSource<? extends R>> mapper, int prefetch) {
ObjectHelper.requireNonNull(mapper, "mapper is null");
... | |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/TaskInProgress.java | TaskInProgress.setDispatchTime | public void setDispatchTime(TaskAttemptID taskid, long disTime){
dispatchTimeMap.put(taskid, disTime);
this.lastDispatchTime = disTime;
} | java | public void setDispatchTime(TaskAttemptID taskid, long disTime){
dispatchTimeMap.put(taskid, disTime);
this.lastDispatchTime = disTime;
} | [
"public",
"void",
"setDispatchTime",
"(",
"TaskAttemptID",
"taskid",
",",
"long",
"disTime",
")",
"{",
"dispatchTimeMap",
".",
"put",
"(",
"taskid",
",",
"disTime",
")",
";",
"this",
".",
"lastDispatchTime",
"=",
"disTime",
";",
"}"
] | Set the dispatch time | [
"Set",
"the",
"dispatch",
"time"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java#L342-L345 | train | Sets the dispatch time for a task. | Create a Java method that does the following: "Sets the dispatch time for a task.". | Of course, here is the Java code you requested:
```java
public void setDispatchTime(TaskAttemptID taskid, long disTime){
dispatchTimeMap.put(taskid, disTime);
this.lastDispatchTime = disTime;
}
```
Hope this helps! | |
mdeverdelhan/ta4j-origins | ta4j/src/main/java/eu/verdelhan/ta4j/TimeSeriesManager.java | TimeSeriesManager.run | public TradingRecord run(Strategy strategy, OrderType orderType, Decimal amount) {
return run(strategy, orderType, amount, timeSeries.getBeginIndex(), timeSeries.getEndIndex());
} | java | public TradingRecord run(Strategy strategy, OrderType orderType, Decimal amount) {
return run(strategy, orderType, amount, timeSeries.getBeginIndex(), timeSeries.getEndIndex());
} | [
"public",
"TradingRecord",
"run",
"(",
"Strategy",
"strategy",
",",
"OrderType",
"orderType",
",",
"Decimal",
"amount",
")",
"{",
"return",
"run",
"(",
"strategy",
",",
"orderType",
",",
"amount",
",",
"timeSeries",
".",
"getBeginIndex",
"(",
")",
",",
"time... | Runs the provided strategy over the managed series.
<p>
@param strategy the trading strategy
@param orderType the {@link OrderType} used to open the trades
@param amount the amount used to open/close the trades
@return the trading record coming from the run | [
"Runs",
"the",
"provided",
"strategy",
"over",
"the",
"managed",
"series",
".",
"<p",
">"
] | 0441468c09cfd98754497cd9c0f1da9cf70fc4b9 | https://github.com/mdeverdelhan/ta4j-origins/blob/0441468c09cfd98754497cd9c0f1da9cf70fc4b9/ta4j/src/main/java/eu/verdelhan/ta4j/TimeSeriesManager.java#L130-L132 | valid | Run a TradingRecord on the time series. | Create a Java method that does the following: "Run a TradingRecord on the time series.". | Of course, here is the Java code you requested:
```java
public TradingRecord run(Strategy strategy, OrderType orderType, Decimal amount) {
return run(strategy, orderType, amount, timeSeries.getBeginIndex(), timeSeries.getEndIndex());
}
```
Hope this helps! | |
aws/aws-sdk-java | aws-java-sdk-transcribe/src/main/java/com/amazonaws/services/transcribe/model/transform/VocabularyInfoMarshaller.java | VocabularyInfoMarshaller.marshall | public void marshall(VocabularyInfo vocabularyInfo, ProtocolMarshaller protocolMarshaller) {
if (vocabularyInfo == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(vocabularyInfo.getVocabularyName(), V... | java | public void marshall(VocabularyInfo vocabularyInfo, ProtocolMarshaller protocolMarshaller) {
if (vocabularyInfo == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(vocabularyInfo.getVocabularyName(), V... | [
"public",
"void",
"marshall",
"(",
"VocabularyInfo",
"vocabularyInfo",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"vocabularyInfo",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Invalid argument passed to marshall(...)\""... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-transcribe/src/main/java/com/amazonaws/services/transcribe/model/transform/VocabularyInfoMarshaller.java#L48-L62 | train | marshalls the given vocabularyInfo to the given protocolMarshaller. | Create a Java method that does the following: "marshalls the given vocabularyInfo to the given protocolMarshaller.". | Of course, here is the Java code you requested:
```java
public void marshall(VocabularyInfo vocabularyInfo, ProtocolMarshaller protocolMarshaller) {
if (vocabularyInfo == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocol... | |
opentelecoms-org/jsmpp | jsmpp/src/main/java/org/jsmpp/session/AbstractSession.java | AbstractSession.executeSendCommandWithNoResponse | protected void executeSendCommandWithNoResponse(SendCommandTask task)
throws PDUException, IOException {
int seqNum = sequence.nextValue();
try {
task.executeTask(connection().getOutputStream(), seqNum);
} catch (IOException e) {
logger.error("Failed sending " + ... | java | protected void executeSendCommandWithNoResponse(SendCommandTask task)
throws PDUException, IOException {
int seqNum = sequence.nextValue();
try {
task.executeTask(connection().getOutputStream(), seqNum);
} catch (IOException e) {
logger.error("Failed sending " + ... | [
"protected",
"void",
"executeSendCommandWithNoResponse",
"(",
"SendCommandTask",
"task",
")",
"throws",
"PDUException",
",",
"IOException",
"{",
"int",
"seqNum",
"=",
"sequence",
".",
"nextValue",
"(",
")",
";",
"try",
"{",
"task",
".",
"executeTask",
"(",
"conn... | Execute send command command task.
@param task is the task.
@throws PDUException if there is invalid PDU parameter found.
@throws IOException if there is an IO error found. | [
"Execute",
"send",
"command",
"command",
"task",
"."
] | acc15e73e7431deabc803731971b15323315baaf | https://github.com/opentelecoms-org/jsmpp/blob/acc15e73e7431deabc803731971b15323315baaf/jsmpp/src/main/java/org/jsmpp/session/AbstractSession.java#L316-L327 | train | Execute a SendCommandTask with no response. | Create a Java method that does the following: "Execute a SendCommandTask with no response.". | Of course, here is the Java code you requested:
```java
protected void executeSendCommandWithNoResponse(SendCommandTask task)
throws PDUException, IOException {
int seqNum = sequence.nextValue();
try {
task.executeTask(connection().getOutputStream(), seqNum);
} catch (IOExc... | |
aws/aws-sdk-java | aws-java-sdk-dms/src/main/java/com/amazonaws/services/databasemigrationservice/model/transform/CreateEventSubscriptionRequestMarshaller.java | CreateEventSubscriptionRequestMarshaller.marshall | public void marshall(CreateEventSubscriptionRequest createEventSubscriptionRequest, ProtocolMarshaller protocolMarshaller) {
if (createEventSubscriptionRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshalle... | java | public void marshall(CreateEventSubscriptionRequest createEventSubscriptionRequest, ProtocolMarshaller protocolMarshaller) {
if (createEventSubscriptionRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshalle... | [
"public",
"void",
"marshall",
"(",
"CreateEventSubscriptionRequest",
"createEventSubscriptionRequest",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"createEventSubscriptionRequest",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dms/src/main/java/com/amazonaws/services/databasemigrationservice/model/transform/CreateEventSubscriptionRequestMarshaller.java#L55-L72 | train | marshalls the given EventSubscriptionRequest to the JSON object. | Create a Java method that does the following: "marshalls the given EventSubscriptionRequest to the JSON object.". | Of course, here is the Java code you requested:
```java
public void marshall(CreateEventSubscriptionRequest createEventSubscriptionRequest, ProtocolMarshaller protocolMarshaller) {
if (createEventSubscriptionRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)"... | |
opensourceBIM/BIMserver | PluginBase/generated/org/bimserver/models/ifc4/impl/Ifc4PackageImpl.java | Ifc4PackageImpl.getIfcRelConnectsStructuralMember | @Override
public EClass getIfcRelConnectsStructuralMember() {
if (ifcRelConnectsStructuralMemberEClass == null) {
ifcRelConnectsStructuralMemberEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(539);
}
return ifcRelConnectsStructuralMemberEClass;
... | java | @Override
public EClass getIfcRelConnectsStructuralMember() {
if (ifcRelConnectsStructuralMemberEClass == null) {
ifcRelConnectsStructuralMemberEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(539);
}
return ifcRelConnectsStructuralMemberEClass;
... | [
"@",
"Override",
"public",
"EClass",
"getIfcRelConnectsStructuralMember",
"(",
")",
"{",
"if",
"(",
"ifcRelConnectsStructuralMemberEClass",
"==",
"null",
")",
"{",
"ifcRelConnectsStructuralMemberEClass",
"=",
"(",
"EClass",
")",
"EPackage",
".",
"Registry",
".",
"INST... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 116803c3047d1b32217366757cee1bb3880fda63 | https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc4/impl/Ifc4PackageImpl.java#L29196-L29203 | train | Create a subtype of the IfcRelConnectsStructuralMember feature. | Create a Java method that does the following: "Create a subtype of the IfcRelConnectsStructuralMember feature.". | Of course, here is the Java code you requested:
```java
@Override
public EClass getIfcRelConnectsStructuralMember() {
if (ifcRelConnectsStructuralMemberEClass == null) {
ifcRelConnectsStructuralMemberEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(539... | |
alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/generated/ShellComponent.java | ShellComponent.isSet | public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case EXECUTION_COMMAND:
return is_set_execution_command();
case SCRIPT:
return is_set_script();
}
throw new IllegalStateException();
} | java | public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case EXECUTION_COMMAND:
return is_set_execution_command();
case SCRIPT:
return is_set_script();
}
throw new IllegalStateException();
} | [
"public",
"boolean",
"isSet",
"(",
"_Fields",
"field",
")",
"{",
"if",
"(",
"field",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"switch",
"(",
"field",
")",
"{",
"case",
"EXECUTION_COMMAND",
":",
"return",
"is... | Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise | [
"Returns",
"true",
"if",
"field",
"corresponding",
"to",
"fieldID",
"is",
"set",
"(",
"has",
"been",
"assigned",
"a",
"value",
")",
"and",
"false",
"otherwise"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/generated/ShellComponent.java#L257-L269 | train | Checks if the specified field is set to a value of a CIS value. | Create a Java method that does the following: "Checks if the specified field is set to a value of a CIS value.". | Of course, here is the Java code you requested:
```java
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case EXECUTION_COMMAND:
return is_set_execution_command();
case SCRIPT:
return is_set_script();
}
th... | |
elki-project/elki | addons/xtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/xtree/AbstractXTreeNode.java | AbstractXTreeNode.readSuperNode | public <T extends AbstractXTree<N>> void readSuperNode(ObjectInput in, T tree) throws IOException, ClassNotFoundException {
readExternal(in);
if(capacity_to_be_filled <= 0 || !isSuperNode()) {
throw new IllegalStateException("This node does not appear to be a supernode");
}
if(isLeaf) {
thro... | java | public <T extends AbstractXTree<N>> void readSuperNode(ObjectInput in, T tree) throws IOException, ClassNotFoundException {
readExternal(in);
if(capacity_to_be_filled <= 0 || !isSuperNode()) {
throw new IllegalStateException("This node does not appear to be a supernode");
}
if(isLeaf) {
thro... | [
"public",
"<",
"T",
"extends",
"AbstractXTree",
"<",
"N",
">",
">",
"void",
"readSuperNode",
"(",
"ObjectInput",
"in",
",",
"T",
"tree",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"readExternal",
"(",
"in",
")",
";",
"if",
"(",
"capa... | Reads the id of this supernode, the numEntries and the entries array from
the specified stream.
@param in the stream to read data from in order to restore the object
@param tree the tree this supernode is to be assigned to
@throws java.io.IOException if I/O errors occur
@throws ClassNotFoundException If the class for ... | [
"Reads",
"the",
"id",
"of",
"this",
"supernode",
"the",
"numEntries",
"and",
"the",
"entries",
"array",
"from",
"the",
"specified",
"stream",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/xtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/xtree/AbstractXTreeNode.java#L238-L260 | train | Read the supernode of this node. | Create a Java method that does the following: "Read the supernode of this node.". | Of course, here is the Java code you requested:
```java
public <T extends AbstractXTree<N>> void readSuperNode(ObjectInput in, T tree) throws IOException, ClassNotFoundException {
readExternal(in);
if(capacity_to_be_filled <= 0 || !isSuperNode()) {
throw new IllegalStateException("This node does not appe... | |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java | FSNamesystem.internalReleaseLease | void internalReleaseLease(Lease lease, String src,
INodeFileUnderConstruction pendingFile) throws IOException {
if (lease.hasPath()) {
// make a copy of the paths because internalReleaseLeaseOne removes
// pathnames from the lease record.
String[] leasePaths = new String[lease.getPaths().siz... | java | void internalReleaseLease(Lease lease, String src,
INodeFileUnderConstruction pendingFile) throws IOException {
if (lease.hasPath()) {
// make a copy of the paths because internalReleaseLeaseOne removes
// pathnames from the lease record.
String[] leasePaths = new String[lease.getPaths().siz... | [
"void",
"internalReleaseLease",
"(",
"Lease",
"lease",
",",
"String",
"src",
",",
"INodeFileUnderConstruction",
"pendingFile",
")",
"throws",
"IOException",
"{",
"if",
"(",
"lease",
".",
"hasPath",
"(",
")",
")",
"{",
"// make a copy of the paths because internalRelea... | This is invoked when a lease expires. On lease expiry,
all the files that were written from that dfsclient should be
recovered. | [
"This",
"is",
"invoked",
"when",
"a",
"lease",
"expires",
".",
"On",
"lease",
"expiry",
"all",
"the",
"files",
"that",
"were",
"written",
"from",
"that",
"dfsclient",
"should",
"be",
"recovered",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java#L4137-L4152 | train | Release a lease. | Create a Java method that does the following: "Release a lease.". | Of course, here is the Java code you requested:
```java
void internalReleaseLease(Lease lease, String src,
INodeFileUnderConstruction pendingFile) throws IOException {
if (lease.hasPath()) {
// make a copy of the paths because internalReleaseLeaseOne removes
// pathnames from the lease record.
... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConnectionImpl.java | ConnectionImpl.removeBifurcatedConsumerSession | void removeBifurcatedConsumerSession(BifurcatedConsumerSessionImpl bifurcatedConsumer)
{
if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled())
SibTr.entry(CoreSPIConnection.tc, "removeBifurcatedConsumerSession",
new Object[] { this, bifurcated... | java | void removeBifurcatedConsumerSession(BifurcatedConsumerSessionImpl bifurcatedConsumer)
{
if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled())
SibTr.entry(CoreSPIConnection.tc, "removeBifurcatedConsumerSession",
new Object[] { this, bifurcated... | [
"void",
"removeBifurcatedConsumerSession",
"(",
"BifurcatedConsumerSessionImpl",
"bifurcatedConsumer",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"CoreSPIConnection",
".",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
"."... | Remove a bifurcated consumer from the connection list.
@param bifurcatedConsumer | [
"Remove",
"a",
"bifurcated",
"consumer",
"from",
"the",
"connection",
"list",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConnectionImpl.java#L6025-L6039 | train | Remove a bifurcated consumer from the list of bifurcated consumers. | Create a Java method that does the following: "Remove a bifurcated consumer from the list of bifurcated consumers.". | Of course, here is the Java code you requested:
```java
void removeBifurcatedConsumerSession(BifurcatedConsumerSessionImpl bifurcatedConsumer)
{
if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled())
SibTr.entry(CoreSPIConnection.tc, "removeBifurcatedConsumerSession"... | |
Azure/azure-sdk-for-java | iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java | IotHubResourcesInner.getEndpointHealth | public PagedList<EndpointHealthDataInner> getEndpointHealth(final String resourceGroupName, final String iotHubName) {
ServiceResponse<Page<EndpointHealthDataInner>> response = getEndpointHealthSinglePageAsync(resourceGroupName, iotHubName).toBlocking().single();
return new PagedList<EndpointHealthDataI... | java | public PagedList<EndpointHealthDataInner> getEndpointHealth(final String resourceGroupName, final String iotHubName) {
ServiceResponse<Page<EndpointHealthDataInner>> response = getEndpointHealthSinglePageAsync(resourceGroupName, iotHubName).toBlocking().single();
return new PagedList<EndpointHealthDataI... | [
"public",
"PagedList",
"<",
"EndpointHealthDataInner",
">",
"getEndpointHealth",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"iotHubName",
")",
"{",
"ServiceResponse",
"<",
"Page",
"<",
"EndpointHealthDataInner",
">>",
"response",
"=",
"getEnd... | Get the health for routing endpoints.
Get the health for routing endpoints.
@param resourceGroupName the String value
@param iotHubName the String value
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorDetailsException thrown if the request is rejected by server
@throws RuntimeExc... | [
"Get",
"the",
"health",
"for",
"routing",
"endpoints",
".",
"Get",
"the",
"health",
"for",
"routing",
"endpoints",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java#L2432-L2440 | train | Get the endpoint health of an IoT hub. | Create a Java method that does the following: "Get the endpoint health of an IoT hub.". | Of course, here is the Java code you requested:
```java
public PagedList<EndpointHealthDataInner> getEndpointHealth(final String resourceGroupName, final String iotHubName) {
ServiceResponse<Page<EndpointHealthDataInner>> response = getEndpointHealthSinglePageAsync(resourceGroupName, iotHubName).toBlocking().s... | |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/media/MediaClient.java | MediaClient.getJob | @Deprecated
public GetJobResponse getJob(GetJobRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
checkStringNotEmpty(request.getJobId(), "The parameter jobId should NOT be null or empty string.");
InternalRequest internalRequest = createRequest(HttpMethod... | java | @Deprecated
public GetJobResponse getJob(GetJobRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
checkStringNotEmpty(request.getJobId(), "The parameter jobId should NOT be null or empty string.");
InternalRequest internalRequest = createRequest(HttpMethod... | [
"@",
"Deprecated",
"public",
"GetJobResponse",
"getJob",
"(",
"GetJobRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"The parameter request should NOT be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getJobId",
"(",
")",
",",
... | Retrieve the status of a job.
@param request The request object containing all options for retrieving job status.
@return The status of a job.
@deprecated As of release 0.8.5, replaced by {@link #getTranscodingJob(GetTranscodingJobRequest)} | [
"Retrieve",
"the",
"status",
"of",
"a",
"job",
"."
] | f7140f28dd82121515c88ded7bfe769a37d0ec4a | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/media/MediaClient.java#L281-L288 | train | Get the detail information of a specific TRANSCODE_JOB. | Create a Java method that does the following: "Get the detail information of a specific TRANSCODE_JOB.". | Of course, here is the Java code you requested:
```java
@Deprecated
public GetJobResponse getJob(GetJobRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
checkStringNotEmpty(request.getJobId(), "The parameter jobId should NOT be null or empty string.");
I... | |
apereo/cas | core/cas-server-core-authentication-attributes/src/main/java/org/apereo/cas/services/AbstractRegisteredServiceAttributeReleasePolicy.java | AbstractRegisteredServiceAttributeReleasePolicy.insertPrincipalIdAsAttributeIfNeeded | protected void insertPrincipalIdAsAttributeIfNeeded(final Principal principal, final Map<String, List<Object>> attributesToRelease,
final Service service, final RegisteredService registeredService) {
if (StringUtils.isNotBlank(getPrincipalIdAttribute())) {... | java | protected void insertPrincipalIdAsAttributeIfNeeded(final Principal principal, final Map<String, List<Object>> attributesToRelease,
final Service service, final RegisteredService registeredService) {
if (StringUtils.isNotBlank(getPrincipalIdAttribute())) {... | [
"protected",
"void",
"insertPrincipalIdAsAttributeIfNeeded",
"(",
"final",
"Principal",
"principal",
",",
"final",
"Map",
"<",
"String",
",",
"List",
"<",
"Object",
">",
">",
"attributesToRelease",
",",
"final",
"Service",
"service",
",",
"final",
"RegisteredService... | Release principal id as attribute if needed.
@param principal the principal
@param attributesToRelease the attributes to release
@param service the service
@param registeredService the registered service | [
"Release",
"principal",
"id",
"as",
"attribute",
"if",
"needed",
"."
] | b4b306433a8782cef803a39bea5b1f96740e0e9b | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-authentication-attributes/src/main/java/org/apereo/cas/services/AbstractRegisteredServiceAttributeReleasePolicy.java#L183-L191 | train | Insert principal id as attribute if it is not blank. | Create a Java method that does the following: "Insert principal id as attribute if it is not blank.". | Of course, here is the Java code you requested:
```java
protected void insertPrincipalIdAsAttributeIfNeeded(final Principal principal, final Map<String, List<Object>> attributesToRelease,
final Service service, final RegisteredService registeredService) {
... | |
aws/aws-sdk-java | aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java | AWSMediaLiveClient.describeInput | @Override
public DescribeInputResult describeInput(DescribeInputRequest request) {
request = beforeClientExecution(request);
return executeDescribeInput(request);
} | java | @Override
public DescribeInputResult describeInput(DescribeInputRequest request) {
request = beforeClientExecution(request);
return executeDescribeInput(request);
} | [
"@",
"Override",
"public",
"DescribeInputResult",
"describeInput",
"(",
"DescribeInputRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeDescribeInput",
"(",
"request",
")",
";",
"}"
] | Produces details about an input
@param describeInputRequest
Placeholder documentation for DescribeInputRequest
@return Result of the DescribeInput operation returned by the service.
@throws BadRequestException
This request was invalid
@throws InternalServerErrorException
Internal Service Error
@throws ForbiddenExcepti... | [
"Produces",
"details",
"about",
"an",
"input"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/AWSMediaLiveClient.java#L890-L894 | train | Returns a description of an input source. | Create a Java method that does the following: "Returns a description of an input source.". | Of course, here is the Java code you requested:
```java
@Override
public DescribeInputResult describeInput(DescribeInputRequest request) {
request = beforeClientExecution(request);
return executeDescribeInput(request);
}
```
Hope this helps! | |
beangle/beangle3 | commons/core/src/main/java/org/beangle/commons/collection/FastHashMap.java | FastHashMap.writeObject | private void writeObject(ObjectOutputStream stream) throws IOException {
stream.writeInt(_capacity);
stream.writeInt(_size);
int count = 0;
EntryImpl<K, V> entry = _mapFirst;
while (entry != null) {
stream.writeObject(entry._key);
stream.writeObject(entry._value);
count++;
en... | java | private void writeObject(ObjectOutputStream stream) throws IOException {
stream.writeInt(_capacity);
stream.writeInt(_size);
int count = 0;
EntryImpl<K, V> entry = _mapFirst;
while (entry != null) {
stream.writeObject(entry._key);
stream.writeObject(entry._value);
count++;
en... | [
"private",
"void",
"writeObject",
"(",
"ObjectOutputStream",
"stream",
")",
"throws",
"IOException",
"{",
"stream",
".",
"writeInt",
"(",
"_capacity",
")",
";",
"stream",
".",
"writeInt",
"(",
"_size",
")",
";",
"int",
"count",
"=",
"0",
";",
"EntryImpl",
... | Requires special handling during serialization process.
@param stream the object output stream.
@throws IOException if an I/O error occurs. | [
"Requires",
"special",
"handling",
"during",
"serialization",
"process",
"."
] | 33df2873a5f38e28ac174a1d3b8144eb2f808e64 | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/core/src/main/java/org/beangle/commons/collection/FastHashMap.java#L793-L805 | train | Write the object in the FastMap. | Create a Java method that does the following: "Write the object in the FastMap.". | Of course, here is the Java code you requested:
```java
private void writeObject(ObjectOutputStream stream) throws IOException {
stream.writeInt(_capacity);
stream.writeInt(_size);
int count = 0;
EntryImpl<K, V> entry = _mapFirst;
while (entry != null) {
stream.writeObject(entry._key);
... | |
advantageous/qbit | qbit/core/src/main/java/io/advantageous/qbit/reakt/Reakt.java | Reakt.convertCallback | public static <T> Callback<T> convertCallback(final io.advantageous.reakt.CallbackHandler<T> callback) {
return convertReaktCallbackToQBitCallback(callback, CallbackBuilder.callbackBuilder());
} | java | public static <T> Callback<T> convertCallback(final io.advantageous.reakt.CallbackHandler<T> callback) {
return convertReaktCallbackToQBitCallback(callback, CallbackBuilder.callbackBuilder());
} | [
"public",
"static",
"<",
"T",
">",
"Callback",
"<",
"T",
">",
"convertCallback",
"(",
"final",
"io",
".",
"advantageous",
".",
"reakt",
".",
"CallbackHandler",
"<",
"T",
">",
"callback",
")",
"{",
"return",
"convertReaktCallbackToQBitCallback",
"(",
"callback"... | Converts a Reakt callback into a QBit callback.
@param callback reakt callback
@param <T> type of result
@return QBit callback | [
"Converts",
"a",
"Reakt",
"callback",
"into",
"a",
"QBit",
"callback",
"."
] | 533b3671785f238d576b02b5290c6525ed60f583 | https://github.com/advantageous/qbit/blob/533b3671785f238d576b02b5290c6525ed60f583/qbit/core/src/main/java/io/advantageous/qbit/reakt/Reakt.java#L50-L52 | valid | Convert a Reakt Callback to a QBit Callback. | Create a Java method that does the following: "Convert a Reakt Callback to a QBit Callback.". | Of course, here is the Java code you requested:
```java
public static <T> Callback<T> convertCallback(final io.advantageous.reakt.CallbackHandler<T> callback) {
return convertReaktCallbackToQBitCallback(callback, CallbackBuilder.callbackBuilder());
}
```
Hope this helps! | |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/html/HTMLUtils.java | HTMLUtils.stripHTMLEnvelope | public static void stripHTMLEnvelope(Document document)
{
org.w3c.dom.Element root = document.getDocumentElement();
if (root.getNodeName().equalsIgnoreCase(HTMLConstants.TAG_HTML)) {
// Look for a head element below the root element and for a body element
Node bodyNode = null... | java | public static void stripHTMLEnvelope(Document document)
{
org.w3c.dom.Element root = document.getDocumentElement();
if (root.getNodeName().equalsIgnoreCase(HTMLConstants.TAG_HTML)) {
// Look for a head element below the root element and for a body element
Node bodyNode = null... | [
"public",
"static",
"void",
"stripHTMLEnvelope",
"(",
"Document",
"document",
")",
"{",
"org",
".",
"w3c",
".",
"dom",
".",
"Element",
"root",
"=",
"document",
".",
"getDocumentElement",
"(",
")",
";",
"if",
"(",
"root",
".",
"getNodeName",
"(",
")",
"."... | Strip the HTML envelope if it exists. Precisely this means removing the head tag and move all tags in the body
tag directly under the html element. This is useful for example if you wish to insert an HTML fragment into an
existing HTML page.
@param document the w3c Document to strip | [
"Strip",
"the",
"HTML",
"envelope",
"if",
"it",
"exists",
".",
"Precisely",
"this",
"means",
"removing",
"the",
"head",
"tag",
"and",
"move",
"all",
"tags",
"in",
"the",
"body",
"tag",
"directly",
"under",
"the",
"html",
"element",
".",
"This",
"is",
"us... | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/html/HTMLUtils.java#L269-L299 | train | Removes the HTML envelope from the document. | Create a Java method that does the following: "Removes the HTML envelope from the document.". | Of course, here is the Java code you requested:
```java
public static void stripHTMLEnvelope(Document document)
{
org.w3c.dom.Element root = document.getDocumentElement();
if (root.getNodeName().equalsIgnoreCase(HTMLConstants.TAG_HTML)) {
// Look for a head element below the root elemen... | |
future-architect/uroborosql | src/main/java/jp/co/future/uroborosql/AbstractResultSetWrapper.java | AbstractResultSetWrapper.updateClob | @Override
public void updateClob(final int columnIndex, final Clob x) throws SQLException {
wrapped.updateClob(columnIndex, x);
} | java | @Override
public void updateClob(final int columnIndex, final Clob x) throws SQLException {
wrapped.updateClob(columnIndex, x);
} | [
"@",
"Override",
"public",
"void",
"updateClob",
"(",
"final",
"int",
"columnIndex",
",",
"final",
"Clob",
"x",
")",
"throws",
"SQLException",
"{",
"wrapped",
".",
"updateClob",
"(",
"columnIndex",
",",
"x",
")",
";",
"}"
] | {@inheritDoc}
@see java.sql.ResultSet#updateClob(int, java.sql.Clob) | [
"{",
"@inheritDoc",
"}"
] | 4c26db51defdac3c6ed16866e33ab45e190e2e0c | https://github.com/future-architect/uroborosql/blob/4c26db51defdac3c6ed16866e33ab45e190e2e0c/src/main/java/jp/co/future/uroborosql/AbstractResultSetWrapper.java#L1457-L1460 | train | Updates the designated column with a Clob object. | Create a Java method that does the following: "Updates the designated column with a Clob object.". | Of course, here is the Java code you requested:
```java
@Override
public void updateClob(final int columnIndex, final Clob x) throws SQLException {
wrapped.updateClob(columnIndex, x);
}
```
Hope this helps! | |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputChannel.java | InputChannel.increaseBackoff | protected boolean increaseBackoff() {
// Backoff is disabled
if (currentBackoff < 0) {
return false;
}
// This is the first time backing off
if (currentBackoff == 0) {
currentBackoff = initialBackoff;
return true;
}
// Continue backing off
else if (currentBackoff < maxBackoff) {
currentBa... | java | protected boolean increaseBackoff() {
// Backoff is disabled
if (currentBackoff < 0) {
return false;
}
// This is the first time backing off
if (currentBackoff == 0) {
currentBackoff = initialBackoff;
return true;
}
// Continue backing off
else if (currentBackoff < maxBackoff) {
currentBa... | [
"protected",
"boolean",
"increaseBackoff",
"(",
")",
"{",
"// Backoff is disabled",
"if",
"(",
"currentBackoff",
"<",
"0",
")",
"{",
"return",
"false",
";",
"}",
"// This is the first time backing off",
"if",
"(",
"currentBackoff",
"==",
"0",
")",
"{",
"currentBac... | Increases the current backoff and returns whether the operation was successful.
@return <code>true</code>, iff the operation was successful. Otherwise, <code>false</code>. | [
"Increases",
"the",
"current",
"backoff",
"and",
"returns",
"whether",
"the",
"operation",
"was",
"successful",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputChannel.java#L223-L245 | train | Increase the backoff value. | Create a Java method that does the following: "Increase the backoff value.". | Of course, here is the Java code you requested:
```java
protected boolean increaseBackoff() {
// Backoff is disabled
if (currentBackoff < 0) {
return false;
}
// This is the first time backing off
if (currentBackoff == 0) {
currentBackoff = initialBackoff;
return true;
}
// Continue backing o... | |
pdef/pdef-java | pdef/src/main/java/io/pdef/rpc/RpcProtocol.java | RpcProtocol.getRequest | public RpcRequest getRequest(final Invocation invocation) {
if (invocation == null) throw new NullPointerException("invocation");
MethodDescriptor<?, ?> method = invocation.getMethod();
if (!method.isTerminal()) {
throw new IllegalArgumentException("Last invocation method must be terminal");
}
RpcRequest... | java | public RpcRequest getRequest(final Invocation invocation) {
if (invocation == null) throw new NullPointerException("invocation");
MethodDescriptor<?, ?> method = invocation.getMethod();
if (!method.isTerminal()) {
throw new IllegalArgumentException("Last invocation method must be terminal");
}
RpcRequest... | [
"public",
"RpcRequest",
"getRequest",
"(",
"final",
"Invocation",
"invocation",
")",
"{",
"if",
"(",
"invocation",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"invocation\"",
")",
";",
"MethodDescriptor",
"<",
"?",
",",
"?",
">",
"method"... | Converts an invocation into an rpc request. | [
"Converts",
"an",
"invocation",
"into",
"an",
"rpc",
"request",
"."
] | 7776c44d1aab0f3dbf7267b0c32b8f9282fe6167 | https://github.com/pdef/pdef-java/blob/7776c44d1aab0f3dbf7267b0c32b8f9282fe6167/pdef/src/main/java/io/pdef/rpc/RpcProtocol.java#L46-L60 | train | Gets the request for the given invocation. | Create a Java method that does the following: "Gets the request for the given invocation.". | Of course, here is the Java code you requested:
```java
public RpcRequest getRequest(final Invocation invocation) {
if (invocation == null) throw new NullPointerException("invocation");
MethodDescriptor<?, ?> method = invocation.getMethod();
if (!method.isTerminal()) {
throw new IllegalArgumentException("Las... | |
opencb/biodata | biodata-formats/src/main/java/org/opencb/biodata/formats/drug/drugbank/v43jaxb/ObjectFactory.java | ObjectFactory.createSnpEffectTypeAllele | @XmlElementDecl(namespace = "http://www.drugbank.ca", name = "allele", scope = SnpEffectType.class)
public JAXBElement<String> createSnpEffectTypeAllele(String value) {
return new JAXBElement<String>(_SnpAdverseDrugReactionTypeAllele_QNAME, String.class, SnpEffectType.class, value);
} | java | @XmlElementDecl(namespace = "http://www.drugbank.ca", name = "allele", scope = SnpEffectType.class)
public JAXBElement<String> createSnpEffectTypeAllele(String value) {
return new JAXBElement<String>(_SnpAdverseDrugReactionTypeAllele_QNAME, String.class, SnpEffectType.class, value);
} | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"http://www.drugbank.ca\"",
",",
"name",
"=",
"\"allele\"",
",",
"scope",
"=",
"SnpEffectType",
".",
"class",
")",
"public",
"JAXBElement",
"<",
"String",
">",
"createSnpEffectTypeAllele",
"(",
"String",
"value",
")"... | Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} | [
"Create",
"an",
"instance",
"of",
"{",
"@link",
"JAXBElement",
"}",
"{",
"@code",
"<",
"}",
"{",
"@link",
"String",
"}",
"{",
"@code",
">",
"}}"
] | 21b3d51d71f578efab908422aca4bab7a73097b1 | https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-formats/src/main/java/org/opencb/biodata/formats/drug/drugbank/v43jaxb/ObjectFactory.java#L802-L805 | train | Create an instance of a snpspace allele. | Create a Java method that does the following: "Create an instance of a snpspace allele.". | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "http://www.drugbank.ca", name = "allele", scope = SnpEffectType.class)
public JAXBElement<String> createSnpEffectTypeAllele(String value) {
return new JAXBElement<String>(_SnpAdverseDrugReactionTypeAllele_QNAME, String.cla... | |
LMAX-Exchange/disruptor | src/main/java/com/lmax/disruptor/RingBuffer.java | RingBuffer.createMultiProducer | public static <E> RingBuffer<E> createMultiProducer(EventFactory<E> factory, int bufferSize)
{
return createMultiProducer(factory, bufferSize, new BlockingWaitStrategy());
} | java | public static <E> RingBuffer<E> createMultiProducer(EventFactory<E> factory, int bufferSize)
{
return createMultiProducer(factory, bufferSize, new BlockingWaitStrategy());
} | [
"public",
"static",
"<",
"E",
">",
"RingBuffer",
"<",
"E",
">",
"createMultiProducer",
"(",
"EventFactory",
"<",
"E",
">",
"factory",
",",
"int",
"bufferSize",
")",
"{",
"return",
"createMultiProducer",
"(",
"factory",
",",
"bufferSize",
",",
"new",
"Blockin... | Create a new multiple producer RingBuffer using the default wait strategy {@link BlockingWaitStrategy}.
@param <E> Class of the event stored in the ring buffer.
@param factory used to create the events within the ring buffer.
@param bufferSize number of elements to create within the ring buffer.
@return a construc... | [
"Create",
"a",
"new",
"multiple",
"producer",
"RingBuffer",
"using",
"the",
"default",
"wait",
"strategy",
"{",
"@link",
"BlockingWaitStrategy",
"}",
"."
] | 4266d00c5250190313446fdd7c8aa7a4edb5c818 | https://github.com/LMAX-Exchange/disruptor/blob/4266d00c5250190313446fdd7c8aa7a4edb5c818/src/main/java/com/lmax/disruptor/RingBuffer.java#L153-L156 | train | Creates a new RingBuffer with a BlockingWaitStrategy. | Create a Java method that does the following: "Creates a new RingBuffer with a BlockingWaitStrategy.". | Of course, here is the Java code you requested:
```java
public static <E> RingBuffer<E> createMultiProducer(EventFactory<E> factory, int bufferSize)
{
return createMultiProducer(factory, bufferSize, new BlockingWaitStrategy());
}
```
Hope this helps! | |
jboss/jboss-jsp-api_spec | src/main/java/javax/servlet/jsp/tagext/TagInfo.java | TagInfo.isValid | public boolean isValid(TagData data) {
TagExtraInfo tei = getTagExtraInfo();
if (tei == null) {
return true;
}
return tei.isValid(data);
} | java | public boolean isValid(TagData data) {
TagExtraInfo tei = getTagExtraInfo();
if (tei == null) {
return true;
}
return tei.isValid(data);
} | [
"public",
"boolean",
"isValid",
"(",
"TagData",
"data",
")",
"{",
"TagExtraInfo",
"tei",
"=",
"getTagExtraInfo",
"(",
")",
";",
"if",
"(",
"tei",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"return",
"tei",
".",
"isValid",
"(",
"data",
")",
"... | Translation-time validation of the attributes.
This is a convenience method on the associated TagExtraInfo class.
@param data The translation-time TagData instance.
@return Whether the data is valid. | [
"Translation",
"-",
"time",
"validation",
"of",
"the",
"attributes",
".",
"This",
"is",
"a",
"convenience",
"method",
"on",
"the",
"associated",
"TagExtraInfo",
"class",
"."
] | da53166619f33a5134dc3315a3264990cc1f541f | https://github.com/jboss/jboss-jsp-api_spec/blob/da53166619f33a5134dc3315a3264990cc1f541f/src/main/java/javax/servlet/jsp/tagext/TagInfo.java#L289-L295 | train | Check if the tag data is valid. | Create a Java method that does the following: "Check if the tag data is valid.". | Of course, here is the Java code you requested:
```java
public boolean isValid(TagData data) {
TagExtraInfo tei = getTagExtraInfo();
if (tei == null) {
return true;
}
return tei.isValid(data);
}
```
Hope this helps! | |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.context/src/com/ibm/ws/security/context/internal/SecurityContextImpl.java | SecurityContextImpl.writeObject | private void writeObject(ObjectOutputStream out) throws IOException {
final boolean trace = TraceComponent.isAnyTracingEnabled();
if (trace && tc.isEntryEnabled())
Tr.entry(this, tc, "writeObject",
new Object[] { "caller/invocation subjects:", callerSubject, invocationSu... | java | private void writeObject(ObjectOutputStream out) throws IOException {
final boolean trace = TraceComponent.isAnyTracingEnabled();
if (trace && tc.isEntryEnabled())
Tr.entry(this, tc, "writeObject",
new Object[] { "caller/invocation subjects:", callerSubject, invocationSu... | [
"private",
"void",
"writeObject",
"(",
"ObjectOutputStream",
"out",
")",
"throws",
"IOException",
"{",
"final",
"boolean",
"trace",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"trace",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")... | Serialize security context.
@param out The stream to which this object is serialized.
@throws IOException if there is more than one WSPrincipal in the subject or if I/O error occurs | [
"Serialize",
"security",
"context",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.context/src/com/ibm/ws/security/context/internal/SecurityContextImpl.java#L259-L299 | train | Serialize the Subject Cache Key. | Create a Java method that does the following: "Serialize the Subject Cache Key.". | Of course, here is the Java code you requested:
```java
private void writeObject(ObjectOutputStream out) throws IOException {
final boolean trace = TraceComponent.isAnyTracingEnabled();
if (trace && tc.isEntryEnabled())
Tr.entry(this, tc, "writeObject",
new Object[] { "... | |
reactor/reactor-core | reactor-core/src/main/java/reactor/core/publisher/Flux.java | Flux.generate | public static <T> Flux<T> generate(Consumer<SynchronousSink<T>> generator) {
Objects.requireNonNull(generator, "generator");
return onAssembly(new FluxGenerate<>(generator));
} | java | public static <T> Flux<T> generate(Consumer<SynchronousSink<T>> generator) {
Objects.requireNonNull(generator, "generator");
return onAssembly(new FluxGenerate<>(generator));
} | [
"public",
"static",
"<",
"T",
">",
"Flux",
"<",
"T",
">",
"generate",
"(",
"Consumer",
"<",
"SynchronousSink",
"<",
"T",
">",
">",
"generator",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"generator",
",",
"\"generator\"",
")",
";",
"return",
"onAss... | Programmatically create a {@link Flux} by generating signals one-by-one via a
consumer callback.
<p>
<img class="marble" src="doc-files/marbles/generateStateless.svg" alt="">
@param <T> the value type emitted
@param generator Consume the {@link SynchronousSink} provided per-subscriber by Reactor
to generate a <strong>... | [
"Programmatically",
"create",
"a",
"{",
"@link",
"Flux",
"}",
"by",
"generating",
"signals",
"one",
"-",
"by",
"-",
"one",
"via",
"a",
"consumer",
"callback",
".",
"<p",
">",
"<img",
"class",
"=",
"marble",
"src",
"=",
"doc",
"-",
"files",
"/",
"marble... | df2eba4ab7d2393e1a942ce972c3307fbbd47ff9 | https://github.com/reactor/reactor-core/blob/df2eba4ab7d2393e1a942ce972c3307fbbd47ff9/reactor-core/src/main/java/reactor/core/publisher/Flux.java#L1027-L1030 | valid | Creates a sequence of futures that produce the results of the given generator. | Create a Java method that does the following: "Creates a sequence of futures that produce the results of the given generator.". | Of course, here is the Java code you requested:
```java
public static <T> Flux<T> generate(Consumer<SynchronousSink<T>> generator) {
Objects.requireNonNull(generator, "generator");
return onAssembly(new FluxGenerate<>(generator));
}
```
Hope this helps! | |
google/guice | core/src/com/google/inject/Guice.java | Guice.createInjector | public static Injector createInjector(Stage stage, Module... modules) {
return createInjector(stage, Arrays.asList(modules));
} | java | public static Injector createInjector(Stage stage, Module... modules) {
return createInjector(stage, Arrays.asList(modules));
} | [
"public",
"static",
"Injector",
"createInjector",
"(",
"Stage",
"stage",
",",
"Module",
"...",
"modules",
")",
"{",
"return",
"createInjector",
"(",
"stage",
",",
"Arrays",
".",
"asList",
"(",
"modules",
")",
")",
";",
"}"
] | Creates an injector for the given set of modules, in a given development stage.
@throws CreationException if one or more errors occur during injector creation. | [
"Creates",
"an",
"injector",
"for",
"the",
"given",
"set",
"of",
"modules",
"in",
"a",
"given",
"development",
"stage",
"."
] | a0552a16d813ead98fe73737fb001db336650251 | https://github.com/google/guice/blob/a0552a16d813ead98fe73737fb001db336650251/core/src/com/google/inject/Guice.java#L77-L79 | test | Create an injector for the given stage and modules. | Create a Java method that does the following: "Create an injector for the given stage and modules.". | Of course, here is the Java code you requested:
```java
public static Injector createInjector(Stage stage, Module... modules) {
return createInjector(stage, Arrays.asList(modules));
}
```
Hope this helps! | |
roboconf/roboconf-platform | karaf/roboconf-karaf-commands-dm/src/main/java/net/roboconf/karaf/commands/dm/KarafDmCommandsUtils.java | KarafDmCommandsUtils.findInstances | public static RbcfInfo findInstances(
Manager manager,
String applicationName,
String scopedInstancePath,
PrintStream out ) {
ManagedApplication ma = null;
List<Instance> scopedInstances = new ArrayList<> ();
Instance scopedInstance;
if(( ma = manager.applicationMngr().findManagedApplicationByName... | java | public static RbcfInfo findInstances(
Manager manager,
String applicationName,
String scopedInstancePath,
PrintStream out ) {
ManagedApplication ma = null;
List<Instance> scopedInstances = new ArrayList<> ();
Instance scopedInstance;
if(( ma = manager.applicationMngr().findManagedApplicationByName... | [
"public",
"static",
"RbcfInfo",
"findInstances",
"(",
"Manager",
"manager",
",",
"String",
"applicationName",
",",
"String",
"scopedInstancePath",
",",
"PrintStream",
"out",
")",
"{",
"ManagedApplication",
"ma",
"=",
"null",
";",
"List",
"<",
"Instance",
">",
"s... | Finds instances for a given application.
@param manager
@param applicationName
@param scopedInstancePath
@param out
@return an object with non-null list of instances and a (nullable) managed application | [
"Finds",
"instances",
"for",
"a",
"given",
"application",
"."
] | add54eead479effb138d0ff53a2d637902b82702 | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/karaf/roboconf-karaf-commands-dm/src/main/java/net/roboconf/karaf/commands/dm/KarafDmCommandsUtils.java#L59-L85 | train | Find instances. | Create a Java method that does the following: "Find instances.". | Of course, here is the Java code you requested:
```java
public static RbcfInfo findInstances(
Manager manager,
String applicationName,
String scopedInstancePath,
PrintStream out ) {
ManagedApplication ma = null;
List<Instance> scopedInstances = new ArrayList<> ();
Instance scopedInstance;
if(( ma... | |
aws/aws-sdk-java | aws-java-sdk-inspector/src/main/java/com/amazonaws/services/inspector/AmazonInspectorClient.java | AmazonInspectorClient.describeAssessmentRuns | @Override
public DescribeAssessmentRunsResult describeAssessmentRuns(DescribeAssessmentRunsRequest request) {
request = beforeClientExecution(request);
return executeDescribeAssessmentRuns(request);
} | java | @Override
public DescribeAssessmentRunsResult describeAssessmentRuns(DescribeAssessmentRunsRequest request) {
request = beforeClientExecution(request);
return executeDescribeAssessmentRuns(request);
} | [
"@",
"Override",
"public",
"DescribeAssessmentRunsResult",
"describeAssessmentRuns",
"(",
"DescribeAssessmentRunsRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeDescribeAssessmentRuns",
"(",
"request",
")",... | <p>
Describes the assessment runs that are specified by the ARNs of the assessment runs.
</p>
@param describeAssessmentRunsRequest
@return Result of the DescribeAssessmentRuns operation returned by the service.
@throws InternalException
Internal server error.
@throws InvalidInputException
The request was rejected beca... | [
"<p",
">",
"Describes",
"the",
"assessment",
"runs",
"that",
"are",
"specified",
"by",
"the",
"ARNs",
"of",
"the",
"assessment",
"runs",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-inspector/src/main/java/com/amazonaws/services/inspector/AmazonInspectorClient.java#L878-L882 | train | Retrieves the description of an assessment run. | Create a Java method that does the following: "Retrieves the description of an assessment run.". | Of course, here is the Java code you requested:
```java
@Override
public DescribeAssessmentRunsResult describeAssessmentRuns(DescribeAssessmentRunsRequest request) {
request = beforeClientExecution(request);
return executeDescribeAssessmentRuns(request);
}
```
Hope this helps! | |
zmarko/sss | src/main/java/rs/in/zivanovic/sss/SasUtils.java | SasUtils.encodeStringToInteger | public static BigInteger encodeStringToInteger(String str) {
byte[] bytes = str.getBytes(StandardCharsets.UTF_8);
byte[] res;
if ((bytes[0] & 0b1000_0000) >> 7 == 1) {
res = new byte[bytes.length + 1];
res[0] = 0;
System.arraycopy(bytes, 0, res, 1, bytes.lengt... | java | public static BigInteger encodeStringToInteger(String str) {
byte[] bytes = str.getBytes(StandardCharsets.UTF_8);
byte[] res;
if ((bytes[0] & 0b1000_0000) >> 7 == 1) {
res = new byte[bytes.length + 1];
res[0] = 0;
System.arraycopy(bytes, 0, res, 1, bytes.lengt... | [
"public",
"static",
"BigInteger",
"encodeStringToInteger",
"(",
"String",
"str",
")",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"str",
".",
"getBytes",
"(",
"StandardCharsets",
".",
"UTF_8",
")",
";",
"byte",
"[",
"]",
"res",
";",
"if",
"(",
"(",
"bytes",
"... | Encode any valid Unicode string to integer.
@param str string to encode as integer.
@return integer representation of the secret string. | [
"Encode",
"any",
"valid",
"Unicode",
"string",
"to",
"integer",
"."
] | a41d9d39ca9a4ca1a2719c441c88e209ffc511f5 | https://github.com/zmarko/sss/blob/a41d9d39ca9a4ca1a2719c441c88e209ffc511f5/src/main/java/rs/in/zivanovic/sss/SasUtils.java#L49-L62 | train | Encode string to integer. | Create a Java method that does the following: "Encode string to integer.". | Of course, here is the Java code you requested:
```java
public static BigInteger encodeStringToInteger(String str) {
byte[] bytes = str.getBytes(StandardCharsets.UTF_8);
byte[] res;
if ((bytes[0] & 0b1000_0000) >> 7 == 1) {
res = new byte[bytes.length + 1];
res[0] = 0;
... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/AliasChainValidator.java | AliasChainValidator.getFirstInChain | public CompoundName getFirstInChain()
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "getFirstInChain");
CompoundName firstInChain = collector.getFirst();
if (tc.isEntryEnabled())
SibTr.exit(tc, "getFirstInChain", firstInChain);
return firstInChain;
} | java | public CompoundName getFirstInChain()
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "getFirstInChain");
CompoundName firstInChain = collector.getFirst();
if (tc.isEntryEnabled())
SibTr.exit(tc, "getFirstInChain", firstInChain);
return firstInChain;
} | [
"public",
"CompoundName",
"getFirstInChain",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getFirstInChain\"",
")",
";",
"CompoundName",
"firstInChain",
"=",
"collector",
".",
"getFirst",
"(",... | Get the first compound name in any alias chain we're validating.
@return Will return null if no chain has yet been built up. | [
"Get",
"the",
"first",
"compound",
"name",
"in",
"any",
"alias",
"chain",
"we",
"re",
"validating",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/AliasChainValidator.java#L53-L64 | train | Get the first compound name in the chain | Create a Java method that does the following: "Get the first compound name in the chain". | Of course, here is the Java code you requested:
```java
public CompoundName getFirstInChain()
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "getFirstInChain");
CompoundName firstInChain = collector.getFirst();
if (tc.isEntryEnabled())
SibTr.exit(tc, "getFirstInChain", firstInChain);
... | |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/extension/style/FeatureStyleExtension.java | FeatureStyleExtension.deleteIcon | public void deleteIcon(String featureTable, long featureId,
GeometryType geometryType) {
deleteMapping(getIconMappingDao(featureTable), featureId, geometryType);
} | java | public void deleteIcon(String featureTable, long featureId,
GeometryType geometryType) {
deleteMapping(getIconMappingDao(featureTable), featureId, geometryType);
} | [
"public",
"void",
"deleteIcon",
"(",
"String",
"featureTable",
",",
"long",
"featureId",
",",
"GeometryType",
"geometryType",
")",
"{",
"deleteMapping",
"(",
"getIconMappingDao",
"(",
"featureTable",
")",
",",
"featureId",
",",
"geometryType",
")",
";",
"}"
] | Delete the feature row icon for the geometry type
@param featureTable feature table
@param featureId feature id
@param geometryType geometry type | [
"Delete",
"the",
"feature",
"row",
"icon",
"for",
"the",
"geometry",
"type"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/extension/style/FeatureStyleExtension.java#L1754-L1757 | test | Delete an icon from the feature table | Create a Java method that does the following: "Delete an icon from the feature table". | Of course, here is the Java code you requested:
```java
public void deleteIcon(String featureTable, long featureId,
GeometryType geometryType) {
deleteMapping(getIconMappingDao(featureTable), featureId, geometryType);
}
```
Hope this helps! | |
Bernardo-MG/maven-site-fixer | src/main/java/com/bernardomg/velocity/tool/HtmlTool.java | HtmlTool.wrap | public final void wrap(final Element root, final String selector,
final String wrapper) {
final Iterable<Element> elements; // Selected elements
checkNotNull(root, "Received a null pointer as root element");
checkNotNull(selector, "Received a null pointer as selector");
chec... | java | public final void wrap(final Element root, final String selector,
final String wrapper) {
final Iterable<Element> elements; // Selected elements
checkNotNull(root, "Received a null pointer as root element");
checkNotNull(selector, "Received a null pointer as selector");
chec... | [
"public",
"final",
"void",
"wrap",
"(",
"final",
"Element",
"root",
",",
"final",
"String",
"selector",
",",
"final",
"String",
"wrapper",
")",
"{",
"final",
"Iterable",
"<",
"Element",
">",
"elements",
";",
"// Selected elements",
"checkNotNull",
"(",
"root",... | Finds a set of elements through a CSS selector and wraps them with the
received wrapper element.
@param root
root element for the selection
@param selector
CSS selector for the elements to wrap
@param wrapper
HTML to use for wrapping the selected elements | [
"Finds",
"a",
"set",
"of",
"elements",
"through",
"a",
"CSS",
"selector",
"and",
"wraps",
"them",
"with",
"the",
"received",
"wrapper",
"element",
"."
] | e064472faa7edb0fca11647a22d90ad72089baa3 | https://github.com/Bernardo-MG/maven-site-fixer/blob/e064472faa7edb0fca11647a22d90ad72089baa3/src/main/java/com/bernardomg/velocity/tool/HtmlTool.java#L227-L240 | train | Wrap the elements in the elements in the root element. | Create a Java method that does the following: "Wrap the elements in the elements in the root element.". | Of course, here is the Java code you requested:
```java
public final void wrap(final Element root, final String selector,
final String wrapper) {
final Iterable<Element> elements; // Selected elements
checkNotNull(root, "Received a null pointer as root element");
checkNotNull(selec... | |
tango-controls/JTango | dao/src/main/java/fr/esrf/TangoApi/DeviceProxyDAODefaultImpl.java | DeviceProxyDAODefaultImpl.read_attribute_asynch | public void read_attribute_asynch(final DeviceProxy deviceProxy, final String[] attnames,
final CallBack cb) throws DevFailed {
final int id = read_attribute_asynch(deviceProxy, attnames);
ApiUtil.set_async_reply_model(id, CALLBACK);
ApiUtil.set_async_reply_cb(id, cb);
// if... | java | public void read_attribute_asynch(final DeviceProxy deviceProxy, final String[] attnames,
final CallBack cb) throws DevFailed {
final int id = read_attribute_asynch(deviceProxy, attnames);
ApiUtil.set_async_reply_model(id, CALLBACK);
ApiUtil.set_async_reply_cb(id, cb);
// if... | [
"public",
"void",
"read_attribute_asynch",
"(",
"final",
"DeviceProxy",
"deviceProxy",
",",
"final",
"String",
"[",
"]",
"attnames",
",",
"final",
"CallBack",
"cb",
")",
"throws",
"DevFailed",
"{",
"final",
"int",
"id",
"=",
"read_attribute_asynch",
"(",
"device... | ========================================================================== | [
"=========================================================================="
] | 1ccc9dcb83e6de2359a9f1906d170571cacf1345 | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoApi/DeviceProxyDAODefaultImpl.java#L2653-L2664 | train | Read an attribute in an asynchronous mode | Create a Java method that does the following: "Read an attribute in an asynchronous mode". | Of course, here is the Java code you requested:
```java
public void read_attribute_asynch(final DeviceProxy deviceProxy, final String[] attnames,
final CallBack cb) throws DevFailed {
final int id = read_attribute_asynch(deviceProxy, attnames);
ApiUtil.set_async_reply_model(id, CALLBACK);
... | |
joniles/mpxj | src/main/java/net/sf/mpxj/sdef/SDEFWriter.java | SDEFWriter.write | @Override public void write(ProjectFile projectFile, OutputStream out) throws IOException
{
m_projectFile = projectFile;
m_eventManager = projectFile.getEventManager();
m_writer = new PrintStream(out); // the print stream class is the easiest way to create a text file
m_buffer = new StringBu... | java | @Override public void write(ProjectFile projectFile, OutputStream out) throws IOException
{
m_projectFile = projectFile;
m_eventManager = projectFile.getEventManager();
m_writer = new PrintStream(out); // the print stream class is the easiest way to create a text file
m_buffer = new StringBu... | [
"@",
"Override",
"public",
"void",
"write",
"(",
"ProjectFile",
"projectFile",
",",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"m_projectFile",
"=",
"projectFile",
";",
"m_eventManager",
"=",
"projectFile",
".",
"getEventManager",
"(",
")",
";",
"... | Write a project file in SDEF format to an output stream.
@param projectFile ProjectFile instance
@param out output stream | [
"Write",
"a",
"project",
"file",
"in",
"SDEF",
"format",
"to",
"an",
"output",
"stream",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/sdef/SDEFWriter.java#L80-L105 | train | This method writes the SDEF file to an output stream. | Create a Java method that does the following: "This method writes the SDEF file to an output stream.". | Of course, here is the Java code you requested:
```java
@Override public void write(ProjectFile projectFile, OutputStream out) throws IOException
{
m_projectFile = projectFile;
m_eventManager = projectFile.getEventManager();
m_writer = new PrintStream(out); // the print stream class is the easies... | |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/layout/GridLayoutExample.java | GridLayoutExample.addBoxes | private static void addBoxes(final WPanel panel, final int amount) {
for (int i = 1; i <= amount; i++) {
panel.add(new BoxComponent(String.valueOf(i)));
}
} | java | private static void addBoxes(final WPanel panel, final int amount) {
for (int i = 1; i <= amount; i++) {
panel.add(new BoxComponent(String.valueOf(i)));
}
} | [
"private",
"static",
"void",
"addBoxes",
"(",
"final",
"WPanel",
"panel",
",",
"final",
"int",
"amount",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<=",
"amount",
";",
"i",
"++",
")",
"{",
"panel",
".",
"add",
"(",
"new",
"BoxComponent"... | Adds a set of boxes to the given panel.
@param panel the panel to add the boxes to.
@param amount the number of boxes to add. | [
"Adds",
"a",
"set",
"of",
"boxes",
"to",
"the",
"given",
"panel",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/layout/GridLayoutExample.java#L133-L137 | train | Add the boxes to the given panel. | Create a Java method that does the following: "Add the boxes to the given panel.". | Of course, here is the Java code you requested:
```java
private static void addBoxes(final WPanel panel, final int amount) {
for (int i = 1; i <= amount; i++) {
panel.add(new BoxComponent(String.valueOf(i)));
}
}
```
Hope this helps! | |
aws/aws-sdk-java | aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/DescribeVolumesModificationsRequest.java | DescribeVolumesModificationsRequest.withVolumeIds | public DescribeVolumesModificationsRequest withVolumeIds(String... volumeIds) {
if (this.volumeIds == null) {
setVolumeIds(new com.amazonaws.internal.SdkInternalList<String>(volumeIds.length));
}
for (String ele : volumeIds) {
this.volumeIds.add(ele);
}
re... | java | public DescribeVolumesModificationsRequest withVolumeIds(String... volumeIds) {
if (this.volumeIds == null) {
setVolumeIds(new com.amazonaws.internal.SdkInternalList<String>(volumeIds.length));
}
for (String ele : volumeIds) {
this.volumeIds.add(ele);
}
re... | [
"public",
"DescribeVolumesModificationsRequest",
"withVolumeIds",
"(",
"String",
"...",
"volumeIds",
")",
"{",
"if",
"(",
"this",
".",
"volumeIds",
"==",
"null",
")",
"{",
"setVolumeIds",
"(",
"new",
"com",
".",
"amazonaws",
".",
"internal",
".",
"SdkInternalLis... | <p>
The IDs of the volumes for which in-progress modifications will be described.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setVolumeIds(java.util.Collection)} or {@link #withVolumeIds(java.util.Collection)} if you want to
override the existing values.
</p>
@param ... | [
"<p",
">",
"The",
"IDs",
"of",
"the",
"volumes",
"for",
"which",
"in",
"-",
"progress",
"modifications",
"will",
"be",
"described",
".",
"<",
"/",
"p",
">",
"<p",
">",
"<b",
">",
"NOTE",
":",
"<",
"/",
"b",
">",
"This",
"method",
"appends",
"the",
... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/DescribeVolumesModificationsRequest.java#L103-L111 | train | Gets the value of the volumeIds property. | Create a Java method that does the following: "Gets the value of the volumeIds property.". | Of course, here is the Java code you requested:
```java
public DescribeVolumesModificationsRequest withVolumeIds(String... volumeIds) {
if (this.volumeIds == null) {
setVolumeIds(new com.amazonaws.internal.SdkInternalList<String>(volumeIds.length));
}
for (String ele : volumeIds) {
... | |
amzn/ion-java | src/com/amazon/ion/impl/IonWriterUser.java | IonWriterUser.close_local_symbol_table_copy | private void close_local_symbol_table_copy() throws IOException
{
assert(symbol_table_being_collected());
// convert the struct we just wrote with the TreeWriter to a
// local symbol table
LocalSymbolTableAsStruct.Factory lstFactory =
(LocalSymbolTableAsStruct.Factory)((... | java | private void close_local_symbol_table_copy() throws IOException
{
assert(symbol_table_being_collected());
// convert the struct we just wrote with the TreeWriter to a
// local symbol table
LocalSymbolTableAsStruct.Factory lstFactory =
(LocalSymbolTableAsStruct.Factory)((... | [
"private",
"void",
"close_local_symbol_table_copy",
"(",
")",
"throws",
"IOException",
"{",
"assert",
"(",
"symbol_table_being_collected",
"(",
")",
")",
";",
"// convert the struct we just wrote with the TreeWriter to a",
"// local symbol table",
"LocalSymbolTableAsStruct",
".",... | Closes the diverted writer since the local symbol table
is complete (i.e. the struct is closed, on {@link #stepOut()}). | [
"Closes",
"the",
"diverted",
"writer",
"since",
"the",
"local",
"symbol",
"table",
"is",
"complete",
"(",
"i",
".",
"e",
".",
"the",
"struct",
"is",
"closed",
"on",
"{"
] | 4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270 | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonWriterUser.java#L262-L277 | train | Close the local symbol table copy. | Create a Java method that does the following: "Close the local symbol table copy.". | Of course, here is the Java code you requested:
```java
private void close_local_symbol_table_copy() throws IOException
{
assert(symbol_table_being_collected());
// convert the struct we just wrote with the TreeWriter to a
// local symbol table
LocalSymbolTableAsStruct.Factory lstF... | |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/Pair.java | Pair.save | public void save(DataOutputStream out) {
try {
out.writeUTF(first.toString());
out.writeUTF(second.toString());
} catch (Exception e) {
e.printStackTrace();
}
} | java | public void save(DataOutputStream out) {
try {
out.writeUTF(first.toString());
out.writeUTF(second.toString());
} catch (Exception e) {
e.printStackTrace();
}
} | [
"public",
"void",
"save",
"(",
"DataOutputStream",
"out",
")",
"{",
"try",
"{",
"out",
".",
"writeUTF",
"(",
"first",
".",
"toString",
"(",
")",
")",
";",
"out",
".",
"writeUTF",
"(",
"second",
".",
"toString",
"(",
")",
")",
";",
"}",
"catch",
"("... | Write a string representation of a Pair to a DataStream.
The <code>toString()</code> method is called on each of the pair
of objects and a <code>String</code> representation is written.
This might not allow one to recover the pair of objects unless they
are of type <code>String</code>. | [
"Write",
"a",
"string",
"representation",
"of",
"a",
"Pair",
"to",
"a",
"DataStream",
".",
"The",
"<code",
">",
"toString",
"()",
"<",
"/",
"code",
">",
"method",
"is",
"called",
"on",
"each",
"of",
"the",
"pair",
"of",
"objects",
"and",
"a",
"<code",
... | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/Pair.java#L128-L135 | train | Saves the tuple to a file. | Create a Java method that does the following: "Saves the tuple to a file.". | Of course, here is the Java code you requested:
```java
public void save(DataOutputStream out) {
try {
out.writeUTF(first.toString());
out.writeUTF(second.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
```
Hope this helps! | |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspTagDisplay.java | CmsJspTagDisplay.displayAction | public static void displayAction(
CmsContainerElementBean element,
I_CmsFormatterBean formatter,
boolean editable,
boolean canCreate,
boolean canDelete,
String creationSiteMap,
String postCreateHandler,
PageContext context,
ServletRequest request,
... | java | public static void displayAction(
CmsContainerElementBean element,
I_CmsFormatterBean formatter,
boolean editable,
boolean canCreate,
boolean canDelete,
String creationSiteMap,
String postCreateHandler,
PageContext context,
ServletRequest request,
... | [
"public",
"static",
"void",
"displayAction",
"(",
"CmsContainerElementBean",
"element",
",",
"I_CmsFormatterBean",
"formatter",
",",
"boolean",
"editable",
",",
"boolean",
"canCreate",
",",
"boolean",
"canDelete",
",",
"String",
"creationSiteMap",
",",
"String",
"post... | Includes the formatter rendering the given element.<p>
@param element the element
@param formatter the formatter configuration bean
@param editable if editable
@param canCreate if new resources may be created
@param canDelete if the resource may be deleted
@param creationSiteMap the create location sub site
@param pos... | [
"Includes",
"the",
"formatter",
"rendering",
"the",
"given",
"element",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagDisplay.java#L138-L209 | train | Display the action for a single element. | Create a Java method that does the following: "Display the action for a single element.". | Of course, here is the Java code you requested:
```java
public static void displayAction(
CmsContainerElementBean element,
I_CmsFormatterBean formatter,
boolean editable,
boolean canCreate,
boolean canDelete,
String creationSiteMap,
String postCreateHandler,
... | |
maestrano/maestrano-java | src/main/java/com/maestrano/sso/Session.java | Session.performRemoteCheck | boolean performRemoteCheck(MnoHttpClient httpClient) {
// Prepare request
String url = sso.getSessionCheckUrl(this.uid, this.sessionToken);
String respStr;
try {
respStr = httpClient.get(url);
} catch (AuthenticationException e1) {
// TODO log error
e1.printStackTrace();
return false;
} catch (A... | java | boolean performRemoteCheck(MnoHttpClient httpClient) {
// Prepare request
String url = sso.getSessionCheckUrl(this.uid, this.sessionToken);
String respStr;
try {
respStr = httpClient.get(url);
} catch (AuthenticationException e1) {
// TODO log error
e1.printStackTrace();
return false;
} catch (A... | [
"boolean",
"performRemoteCheck",
"(",
"MnoHttpClient",
"httpClient",
")",
"{",
"// Prepare request",
"String",
"url",
"=",
"sso",
".",
"getSessionCheckUrl",
"(",
"this",
".",
"uid",
",",
"this",
".",
"sessionToken",
")",
";",
"String",
"respStr",
";",
"try",
"... | Check whether the remote maestrano session is still valid
package private for testing | [
"Check",
"whether",
"the",
"remote",
"maestrano",
"session",
"is",
"still",
"valid"
] | e71c6d3172d7645529d678d1cb3ea9e0a59de314 | https://github.com/maestrano/maestrano-java/blob/e71c6d3172d7645529d678d1cb3ea9e0a59de314/src/main/java/com/maestrano/sso/Session.java#L170-L203 | train | Perform a session check on the server. | Create a Java method that does the following: "Perform a session check on the server.". | Of course, here is the Java code you requested:
```java
boolean performRemoteCheck(MnoHttpClient httpClient) {
// Prepare request
String url = sso.getSessionCheckUrl(this.uid, this.sessionToken);
String respStr;
try {
respStr = httpClient.get(url);
} catch (AuthenticationException e1) {
// TODO log err... | |
webfirmframework/wff | wffweb/src/main/java/com/webfirmframework/wffweb/css/Outline.java | Outline.isValid | public static boolean isValid(final String cssValue) {
// TODO modify to make a strict validation
if (cssValue == null || StringUtil.isBlank(cssValue)) {
return false;
}
final List<String> cssValueParts = CssValueUtil.split(cssValue);
OutlineColor outlineColor = nul... | java | public static boolean isValid(final String cssValue) {
// TODO modify to make a strict validation
if (cssValue == null || StringUtil.isBlank(cssValue)) {
return false;
}
final List<String> cssValueParts = CssValueUtil.split(cssValue);
OutlineColor outlineColor = nul... | [
"public",
"static",
"boolean",
"isValid",
"(",
"final",
"String",
"cssValue",
")",
"{",
"// TODO modify to make a strict validation",
"if",
"(",
"cssValue",
"==",
"null",
"||",
"StringUtil",
".",
"isBlank",
"(",
"cssValue",
")",
")",
"{",
"return",
"false",
";",... | checks the given css value is valid for this class. It does't do a strict
validation.
@param cssValue
@return
@since 1.0.0
@author WFF | [
"checks",
"the",
"given",
"css",
"value",
"is",
"valid",
"for",
"this",
"class",
".",
"It",
"does",
"t",
"do",
"a",
"strict",
"validation",
"."
] | e59def3a20d44f91e112b113448d951d7514af2e | https://github.com/webfirmframework/wff/blob/e59def3a20d44f91e112b113448d951d7514af2e/wffweb/src/main/java/com/webfirmframework/wffweb/css/Outline.java#L275-L307 | valid | Checks if the given CSS value is a valid CSP image. | Create a Java method that does the following: "Checks if the given CSS value is a valid CSP image.". | Of course, here is the Java code you requested:
```java
public static boolean isValid(final String cssValue) {
// TODO modify to make a strict validation
if (cssValue == null || StringUtil.isBlank(cssValue)) {
return false;
}
final List<String> cssValueParts = CssValueUtil.... | |
weld/core | environments/se/core/src/main/java/org/jboss/weld/environment/se/Weld.java | Weld.setBeanDiscoveryMode | public Weld setBeanDiscoveryMode(BeanDiscoveryMode mode) {
// NONE makes no sense as an option
if (mode.equals(BeanDiscoveryMode.NONE)) {
throw WeldSELogger.LOG.beanArchiveWithModeNone(containerId);
}
beanDiscoveryMode = mode;
return this;
} | java | public Weld setBeanDiscoveryMode(BeanDiscoveryMode mode) {
// NONE makes no sense as an option
if (mode.equals(BeanDiscoveryMode.NONE)) {
throw WeldSELogger.LOG.beanArchiveWithModeNone(containerId);
}
beanDiscoveryMode = mode;
return this;
} | [
"public",
"Weld",
"setBeanDiscoveryMode",
"(",
"BeanDiscoveryMode",
"mode",
")",
"{",
"// NONE makes no sense as an option",
"if",
"(",
"mode",
".",
"equals",
"(",
"BeanDiscoveryMode",
".",
"NONE",
")",
")",
"{",
"throw",
"WeldSELogger",
".",
"LOG",
".",
"beanArch... | Sets the bean discovery mode for synthetic bean archive. Default mode is ALL.
@param mode bean discovery mode in a form of an enum from {@link org.jboss.weld.bootstrap.spi.BeanDiscoveryMode}. Accepted values are ALL, ANNOTATED
@return self
@throws IllegalArgumentException if BeanDiscoveryMode.NONE is passed as an arg... | [
"Sets",
"the",
"bean",
"discovery",
"mode",
"for",
"synthetic",
"bean",
"archive",
".",
"Default",
"mode",
"is",
"ALL",
".",
"@param",
"mode",
"bean",
"discovery",
"mode",
"in",
"a",
"form",
"of",
"an",
"enum",
"from",
"{",
"@link",
"org",
".",
"jboss",
... | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/environments/se/core/src/main/java/org/jboss/weld/environment/se/Weld.java#L686-L693 | train | Sets the bean discovery mode. | Create a Java method that does the following: "Sets the bean discovery mode.". | Of course, here is the Java code you requested:
```java
public Weld setBeanDiscoveryMode(BeanDiscoveryMode mode) {
// NONE makes no sense as an option
if (mode.equals(BeanDiscoveryMode.NONE)) {
throw WeldSELogger.LOG.beanArchiveWithModeNone(containerId);
}
beanDiscoveryMode ... | |
krummas/DrizzleJDBC | src/main/java/org/drizzle/jdbc/DrizzlePreparedStatement.java | DrizzlePreparedStatement.executeUpdate | public int executeUpdate() throws SQLException {
startTimer();
try {
setQueryResult(getProtocol().executeQuery(dQuery));
dQuery.clearParameters();
} catch (QueryException e) {
throw SQLExceptionMapper.get(e);
} finally {
stopTimer();
... | java | public int executeUpdate() throws SQLException {
startTimer();
try {
setQueryResult(getProtocol().executeQuery(dQuery));
dQuery.clearParameters();
} catch (QueryException e) {
throw SQLExceptionMapper.get(e);
} finally {
stopTimer();
... | [
"public",
"int",
"executeUpdate",
"(",
")",
"throws",
"SQLException",
"{",
"startTimer",
"(",
")",
";",
"try",
"{",
"setQueryResult",
"(",
"getProtocol",
"(",
")",
".",
"executeQuery",
"(",
"dQuery",
")",
")",
";",
"dQuery",
".",
"clearParameters",
"(",
")... | Executes the SQL statement in this <code>PreparedStatement</code> object, which must be an SQL Data Manipulation
Language (DML) statement, such as <code>INSERT</code>, <code>UPDATE</code> or <code>DELETE</code>; or an SQL
statement that returns nothing, such as a DDL statement.
@return either (1) the row count for SQL... | [
"Executes",
"the",
"SQL",
"statement",
"in",
"this",
"<code",
">",
"PreparedStatement<",
"/",
"code",
">",
"object",
"which",
"must",
"be",
"an",
"SQL",
"Data",
"Manipulation",
"Language",
"(",
"DML",
")",
"statement",
"such",
"as",
"<code",
">",
"INSERT<",
... | 716f31fd71f3cc289edf69844d8117deb86d98d6 | https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzlePreparedStatement.java#L122-L136 | train | Execute the SQL query. | Create a Java method that does the following: "Execute the SQL query.". | Of course, here is the Java code you requested:
```java
public int executeUpdate() throws SQLException {
startTimer();
try {
setQueryResult(getProtocol().executeQuery(dQuery));
dQuery.clearParameters();
} catch (QueryException e) {
throw SQLExceptionMapper.ge... | |
wildfly/wildfly | mod_cluster/undertow/src/main/java/org/wildfly/mod_cluster/undertow/metric/RunningRequestsHttpHandler.java | RunningRequestsHttpHandler.handleRequest | @Override
public void handleRequest(HttpServerExchange exchange) throws Exception {
runningCount.increment();
exchange.addExchangeCompleteListener(new ExchangeCompletionListener() {
@Override
public void exchangeEvent(HttpServerExchange exchange, NextListener nextListener) {... | java | @Override
public void handleRequest(HttpServerExchange exchange) throws Exception {
runningCount.increment();
exchange.addExchangeCompleteListener(new ExchangeCompletionListener() {
@Override
public void exchangeEvent(HttpServerExchange exchange, NextListener nextListener) {... | [
"@",
"Override",
"public",
"void",
"handleRequest",
"(",
"HttpServerExchange",
"exchange",
")",
"throws",
"Exception",
"{",
"runningCount",
".",
"increment",
"(",
")",
";",
"exchange",
".",
"addExchangeCompleteListener",
"(",
"new",
"ExchangeCompletionListener",
"(",
... | Increments the counter and registers a listener to decrement the counter upon exchange complete event. | [
"Increments",
"the",
"counter",
"and",
"registers",
"a",
"listener",
"to",
"decrement",
"the",
"counter",
"upon",
"exchange",
"complete",
"event",
"."
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/mod_cluster/undertow/src/main/java/org/wildfly/mod_cluster/undertow/metric/RunningRequestsHttpHandler.java#L51-L66 | test | Override handleRequest to add a listener to the exchange. | Create a Java method that does the following: "Override handleRequest to add a listener to the exchange.". | Of course, here is the Java code you requested:
```java
@Override
public void handleRequest(HttpServerExchange exchange) throws Exception {
runningCount.increment();
exchange.addExchangeCompleteListener(new ExchangeCompletionListener() {
@Override
public void exchangeEvent(... | |
google/flogger | api/src/main/java/com/google/common/flogger/LogSite.java | LogSite.injectedLogSite | @Deprecated
public static LogSite injectedLogSite(
String internalClassName,
String methodName,
int encodedLineNumber,
@Nullable String sourceFileName) {
return new InjectedLogSite(internalClassName, methodName, encodedLineNumber, sourceFileName);
} | java | @Deprecated
public static LogSite injectedLogSite(
String internalClassName,
String methodName,
int encodedLineNumber,
@Nullable String sourceFileName) {
return new InjectedLogSite(internalClassName, methodName, encodedLineNumber, sourceFileName);
} | [
"@",
"Deprecated",
"public",
"static",
"LogSite",
"injectedLogSite",
"(",
"String",
"internalClassName",
",",
"String",
"methodName",
",",
"int",
"encodedLineNumber",
",",
"@",
"Nullable",
"String",
"sourceFileName",
")",
"{",
"return",
"new",
"InjectedLogSite",
"("... | Creates a log site injected from constants held a class' constant pool.
<p>
Used for compile-time log site injection, and by the agent.
@param internalClassName Slash separated class name obtained from the class constant pool.
@param methodName Method name obtained from the class constant pool.
@param encodedLineNumbe... | [
"Creates",
"a",
"log",
"site",
"injected",
"from",
"constants",
"held",
"a",
"class",
"constant",
"pool",
".",
"<p",
">",
"Used",
"for",
"compile",
"-",
"time",
"log",
"site",
"injection",
"and",
"by",
"the",
"agent",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/LogSite.java#L142-L149 | train | Create an injected log site. | Create a Java method that does the following: "Create an injected log site.". | Of course, here is the Java code you requested:
```java
@Deprecated
public static LogSite injectedLogSite(
String internalClassName,
String methodName,
int encodedLineNumber,
@Nullable String sourceFileName) {
return new InjectedLogSite(internalClassName, methodName, encodedLineNumber, so... | |
thorinii/lct | src/main/java/me/lachlanap/lct/data/ConstantFieldFactory.java | ConstantFieldFactory.createConstantField | public ConstantField createConstantField(Class<?> container, String field, Constant annot)
throws ConstantException {
Class<?> type;
try {
type = container.getField(field).getType();
} catch (NoSuchFieldException e) {
throw new ConstantException("Cannot find ... | java | public ConstantField createConstantField(Class<?> container, String field, Constant annot)
throws ConstantException {
Class<?> type;
try {
type = container.getField(field).getType();
} catch (NoSuchFieldException e) {
throw new ConstantException("Cannot find ... | [
"public",
"ConstantField",
"createConstantField",
"(",
"Class",
"<",
"?",
">",
"container",
",",
"String",
"field",
",",
"Constant",
"annot",
")",
"throws",
"ConstantException",
"{",
"Class",
"<",
"?",
">",
"type",
";",
"try",
"{",
"type",
"=",
"container",
... | Tries to create a ConstantField from a raw field. Cycles through all the providers
until one is found that can satisfy.
<p/>
@param container the class enclosing the field
@param field the name of the field
@param annot the Constant annotation to extract constraints from
@return the constructed ConstantField
@throws Co... | [
"Tries",
"to",
"create",
"a",
"ConstantField",
"from",
"a",
"raw",
"field",
".",
"Cycles",
"through",
"all",
"the",
"providers",
"until",
"one",
"is",
"found",
"that",
"can",
"satisfy",
".",
"<p",
"/",
">"
] | 83d9dd94aac1efec4815b5658faa395a081592dc | https://github.com/thorinii/lct/blob/83d9dd94aac1efec4815b5658faa395a081592dc/src/main/java/me/lachlanap/lct/data/ConstantFieldFactory.java#L42-L60 | train | Create a ConstantField object from a class. | Create a Java method that does the following: "Create a ConstantField object from a class.". | Of course, here is the Java code you requested:
```java
public ConstantField createConstantField(Class<?> container, String field, Constant annot)
throws ConstantException {
Class<?> type;
try {
type = container.getField(field).getType();
} catch (NoSuchFieldException e... | |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/runtime/JCuda.java | JCuda.cudaMallocArray | public static int cudaMallocArray(cudaArray array, cudaChannelFormatDesc desc, long width, long height, int flags)
{
return checkResult(cudaMallocArrayNative(array, desc, width, height, flags));
} | java | public static int cudaMallocArray(cudaArray array, cudaChannelFormatDesc desc, long width, long height, int flags)
{
return checkResult(cudaMallocArrayNative(array, desc, width, height, flags));
} | [
"public",
"static",
"int",
"cudaMallocArray",
"(",
"cudaArray",
"array",
",",
"cudaChannelFormatDesc",
"desc",
",",
"long",
"width",
",",
"long",
"height",
",",
"int",
"flags",
")",
"{",
"return",
"checkResult",
"(",
"cudaMallocArrayNative",
"(",
"array",
",",
... | Allocate an array on the device.
<pre>
cudaError_t cudaMallocArray (
cudaArray_t* array,
const cudaChannelFormatDesc* desc,
size_t width,
size_t height = 0,
unsigned int flags = 0 )
</pre>
<div>
<p>Allocate an array on the device.
Allocates a CUDA array according to the cudaChannelFormatDesc structure
<tt>desc</tt> a... | [
"Allocate",
"an",
"array",
"on",
"the",
"device",
"."
] | 468528b5b9b37dfceb6ed83fcfd889e9b359f984 | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/runtime/JCuda.java#L4363-L4366 | train | Allocates a cudaArray of bytes using CUDA. | Create a Java method that does the following: "Allocates a cudaArray of bytes using CUDA.". | Of course, here is the Java code you requested:
```java
public static int cudaMallocArray(cudaArray array, cudaChannelFormatDesc desc, long width, long height, int flags)
{
return checkResult(cudaMallocArrayNative(array, desc, width, height, flags));
}
```
Hope this helps! | |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketConnectionController.java | SocketConnectionController.getToken | private String getToken() {
SessionData session = dataMgr.getSessionDAO().session();
if (session != null && session.getExpiresOn() > System.currentTimeMillis()) {
return session.getAccessToken();
}
return null;
} | java | private String getToken() {
SessionData session = dataMgr.getSessionDAO().session();
if (session != null && session.getExpiresOn() > System.currentTimeMillis()) {
return session.getAccessToken();
}
return null;
} | [
"private",
"String",
"getToken",
"(",
")",
"{",
"SessionData",
"session",
"=",
"dataMgr",
".",
"getSessionDAO",
"(",
")",
".",
"session",
"(",
")",
";",
"if",
"(",
"session",
"!=",
"null",
"&&",
"session",
".",
"getExpiresOn",
"(",
")",
">",
"System",
... | Gets Comapi access token.
@return Comapi access token. | [
"Gets",
"Comapi",
"access",
"token",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketConnectionController.java#L130-L138 | train | Gets the token from the session. | Create a Java method that does the following: "Gets the token from the session.". | Of course, here is the Java code you requested:
```java
private String getToken() {
SessionData session = dataMgr.getSessionDAO().session();
if (session != null && session.getExpiresOn() > System.currentTimeMillis()) {
return session.getAccessToken();
}
return null;
}
... | |
VoltDB/voltdb | src/frontend/org/voltdb/ClientInterface.java | ClientInterface.initializeSnapshotDaemon | public void initializeSnapshotDaemon(HostMessenger messenger, GlobalServiceElector gse) {
m_snapshotDaemon.init(this, messenger, new Runnable() {
@Override
public void run() {
bindAdapter(m_snapshotDaemonAdapter, null);
}
},
gse);
} | java | public void initializeSnapshotDaemon(HostMessenger messenger, GlobalServiceElector gse) {
m_snapshotDaemon.init(this, messenger, new Runnable() {
@Override
public void run() {
bindAdapter(m_snapshotDaemonAdapter, null);
}
},
gse);
} | [
"public",
"void",
"initializeSnapshotDaemon",
"(",
"HostMessenger",
"messenger",
",",
"GlobalServiceElector",
"gse",
")",
"{",
"m_snapshotDaemon",
".",
"init",
"(",
"this",
",",
"messenger",
",",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void... | Initializes the snapshot daemon so that it's ready to take snapshots | [
"Initializes",
"the",
"snapshot",
"daemon",
"so",
"that",
"it",
"s",
"ready",
"to",
"take",
"snapshots"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ClientInterface.java#L1386-L1394 | train | Initialize the snapshot daemon. | Create a Java method that does the following: "Initialize the snapshot daemon.". | Of course, here is the Java code you requested:
```java
public void initializeSnapshotDaemon(HostMessenger messenger, GlobalServiceElector gse) {
m_snapshotDaemon.init(this, messenger, new Runnable() {
@Override
public void run() {
bindAdapter(m_snapshotDaemonAdapter, nu... | |
micronaut-projects/micronaut-core | function/src/main/java/io/micronaut/function/executor/StreamFunctionExecutor.java | StreamFunctionExecutor.execute | protected void execute(InputStream input, OutputStream output, C context) throws IOException {
final ApplicationContext applicationContext = buildApplicationContext(context);
if (context == null) {
context = (C) applicationContext;
}
final Environment env = startEnvironment(... | java | protected void execute(InputStream input, OutputStream output, C context) throws IOException {
final ApplicationContext applicationContext = buildApplicationContext(context);
if (context == null) {
context = (C) applicationContext;
}
final Environment env = startEnvironment(... | [
"protected",
"void",
"execute",
"(",
"InputStream",
"input",
",",
"OutputStream",
"output",
",",
"C",
"context",
")",
"throws",
"IOException",
"{",
"final",
"ApplicationContext",
"applicationContext",
"=",
"buildApplicationContext",
"(",
"context",
")",
";",
"if",
... | Execute the function with given context object.
@param input The {@link InputStream}
@param output THe {@link OutputStream}
@param context The context object
@throws IOException If an error occurs | [
"Execute",
"the",
"function",
"with",
"given",
"context",
"object",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/function/src/main/java/io/micronaut/function/executor/StreamFunctionExecutor.java#L75-L139 | train | Execute the application context. | Create a Java method that does the following: "Execute the application context.". | Of course, here is the Java code you requested:
```java
protected void execute(InputStream input, OutputStream output, C context) throws IOException {
final ApplicationContext applicationContext = buildApplicationContext(context);
if (context == null) {
context = (C) applicationContext;
... | |
arnohaase/a-foundation | a-foundation-benchmark/src/main/java/com/ajjpj/afoundation/concurrent/jdk/j9new/ForkJoinPool.java | ForkJoinPool.tryExternalUnpush | final boolean tryExternalUnpush(ForkJoinTask<?> task) {
WorkQueue[] ws; WorkQueue w; ForkJoinTask<?>[] a; int m, s;
int r = ThreadLocalRandomHelper.getProbe();
if ((ws = workQueues) != null && (m = ws.length - 1) >= 0 &&
(w = ws[m & r & SQMASK]) != null &&
(a = w.array) !... | java | final boolean tryExternalUnpush(ForkJoinTask<?> task) {
WorkQueue[] ws; WorkQueue w; ForkJoinTask<?>[] a; int m, s;
int r = ThreadLocalRandomHelper.getProbe();
if ((ws = workQueues) != null && (m = ws.length - 1) >= 0 &&
(w = ws[m & r & SQMASK]) != null &&
(a = w.array) !... | [
"final",
"boolean",
"tryExternalUnpush",
"(",
"ForkJoinTask",
"<",
"?",
">",
"task",
")",
"{",
"WorkQueue",
"[",
"]",
"ws",
";",
"WorkQueue",
"w",
";",
"ForkJoinTask",
"<",
"?",
">",
"[",
"]",
"a",
";",
"int",
"m",
",",
"s",
";",
"int",
"r",
"=",
... | Performs tryUnpush for an external submitter: Finds queue,
locks if apparently non-empty, validates upon locking, and
adjusts top. Each check can fail but rarely does. | [
"Performs",
"tryUnpush",
"for",
"an",
"external",
"submitter",
":",
"Finds",
"queue",
"locks",
"if",
"apparently",
"non",
"-",
"empty",
"validates",
"upon",
"locking",
"and",
"adjusts",
"top",
".",
"Each",
"check",
"can",
"fail",
"but",
"rarely",
"does",
"."... | f3eef2ca89d67775f202a4c28140230a6229291e | https://github.com/arnohaase/a-foundation/blob/f3eef2ca89d67775f202a4c28140230a6229291e/a-foundation-benchmark/src/main/java/com/ajjpj/afoundation/concurrent/jdk/j9new/ForkJoinPool.java#L2441-L2460 | test | Try to unpush a fork join task from the external queue. | Create a Java method that does the following: "Try to unpush a fork join task from the external queue.". | Of course, here is the Java code you requested:
```java
final boolean tryExternalUnpush(ForkJoinTask<?> task) {
WorkQueue[] ws; WorkQueue w; ForkJoinTask<?>[] a; int m, s;
int r = ThreadLocalRandomHelper.getProbe();
if ((ws = workQueues) != null && (m = ws.length - 1) >= 0 &&
(w = w... | |
primefaces-extensions/core | src/main/java/org/primefaces/extensions/component/sheet/Sheet.java | Sheet.getRowHeaderValueAsString | protected String getRowHeaderValueAsString(final FacesContext context) {
final ValueExpression veRowHeader = getRowHeaderValueExpression();
final Object value = veRowHeader.getValue(context.getELContext());
if (value == null) {
return Constants.EMPTY_STRING;
}
else {
... | java | protected String getRowHeaderValueAsString(final FacesContext context) {
final ValueExpression veRowHeader = getRowHeaderValueExpression();
final Object value = veRowHeader.getValue(context.getELContext());
if (value == null) {
return Constants.EMPTY_STRING;
}
else {
... | [
"protected",
"String",
"getRowHeaderValueAsString",
"(",
"final",
"FacesContext",
"context",
")",
"{",
"final",
"ValueExpression",
"veRowHeader",
"=",
"getRowHeaderValueExpression",
"(",
")",
";",
"final",
"Object",
"value",
"=",
"veRowHeader",
".",
"getValue",
"(",
... | Gets the row header text value as a string for use in javascript
@param context
@return | [
"Gets",
"the",
"row",
"header",
"text",
"value",
"as",
"a",
"string",
"for",
"use",
"in",
"javascript"
] | afdbca591f60f47898e3517e1e939bc2f63d5355 | https://github.com/primefaces-extensions/core/blob/afdbca591f60f47898e3517e1e939bc2f63d5355/src/main/java/org/primefaces/extensions/component/sheet/Sheet.java#L393-L402 | train | Gets the row header value as string. | Create a Java method that does the following: "Gets the row header value as string.". | Of course, here is the Java code you requested:
```java
protected String getRowHeaderValueAsString(final FacesContext context) {
final ValueExpression veRowHeader = getRowHeaderValueExpression();
final Object value = veRowHeader.getValue(context.getELContext());
if (value == null) {
... | |
stratosphere/stratosphere | stratosphere-core/src/main/java/eu/stratosphere/configuration/Configuration.java | Configuration.getInteger | public int getInteger(String key, int defaultValue) {
String val = getStringInternal(key);
if (val == null) {
return defaultValue;
} else {
return Integer.parseInt(val);
}
} | java | public int getInteger(String key, int defaultValue) {
String val = getStringInternal(key);
if (val == null) {
return defaultValue;
} else {
return Integer.parseInt(val);
}
} | [
"public",
"int",
"getInteger",
"(",
"String",
"key",
",",
"int",
"defaultValue",
")",
"{",
"String",
"val",
"=",
"getStringInternal",
"(",
"key",
")",
";",
"if",
"(",
"val",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}",
"else",
"{",
"retu... | Returns the value associated with the given key as an integer.
@param key
the key pointing to the associated value
@param defaultValue
the default value which is returned in case there is no value associated with the given key
@return the (default) value associated with the given key | [
"Returns",
"the",
"value",
"associated",
"with",
"the",
"given",
"key",
"as",
"an",
"integer",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/configuration/Configuration.java#L182-L189 | train | Gets the integer value for the given key. | Create a Java method that does the following: "Gets the integer value for the given key.". | Of course, here is the Java code you requested:
```java
public int getInteger(String key, int defaultValue) {
String val = getStringInternal(key);
if (val == null) {
return defaultValue;
} else {
return Integer.parseInt(val);
}
}
```
Hope this helps! | |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/itemstreams/SIMPItemStream.java | SIMPItemStream.getPersistentData | public final List<DataSlice> getPersistentData()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getPersistentData");
ByteArrayOutputStream bos = new ByteArrayOutputStream();
try
{
ObjectOutputStream oos = new ObjectOutputStream(bos);
// First o... | java | public final List<DataSlice> getPersistentData()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getPersistentData");
ByteArrayOutputStream bos = new ByteArrayOutputStream();
try
{
ObjectOutputStream oos = new ObjectOutputStream(bos);
// First o... | [
"public",
"final",
"List",
"<",
"DataSlice",
">",
"getPersistentData",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getPersiste... | Feature SIB0112b.mp.1 | [
"Feature",
"SIB0112b",
".",
"mp",
".",
"1"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/itemstreams/SIMPItemStream.java#L245-L288 | train | Get the persistent data of this object. | Create a Java method that does the following: "Get the persistent data of this object.". | Of course, here is the Java code you requested:
```java
public final List<DataSlice> getPersistentData()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getPersistentData");
ByteArrayOutputStream bos = new ByteArrayOutputStream();
try
{
ObjectOutputSt... | |
finmath/finmath-lib | src/main/java/net/finmath/montecarlo/interestrate/models/LIBORMarketModelWithTenorRefinement.java | LIBORMarketModelWithTenorRefinement.getNumeraire | @Override
public RandomVariable getNumeraire(double time) throws CalculationException {
int timeIndex = liborPeriodDiscretizations[0].getTimeIndex(time);
TimeDiscretization liborPeriodDiscretization = liborPeriodDiscretizations[0];
if(timeIndex < 0) {
// Interpolation of Numeraire: log linear interpolation.
... | java | @Override
public RandomVariable getNumeraire(double time) throws CalculationException {
int timeIndex = liborPeriodDiscretizations[0].getTimeIndex(time);
TimeDiscretization liborPeriodDiscretization = liborPeriodDiscretizations[0];
if(timeIndex < 0) {
// Interpolation of Numeraire: log linear interpolation.
... | [
"@",
"Override",
"public",
"RandomVariable",
"getNumeraire",
"(",
"double",
"time",
")",
"throws",
"CalculationException",
"{",
"int",
"timeIndex",
"=",
"liborPeriodDiscretizations",
"[",
"0",
"]",
".",
"getTimeIndex",
"(",
"time",
")",
";",
"TimeDiscretization",
... | Return the numeraire at a given time.
The numeraire is provided for interpolated points. If requested on points which are not
part of the tenor discretization, the numeraire uses a linear interpolation of the reciprocal
value. See ISBN 0470047224 for details.
@param time Time time <i>t</i> for which the numeraire sho... | [
"Return",
"the",
"numeraire",
"at",
"a",
"given",
"time",
"."
] | a3c067d52dd33feb97d851df6cab130e4116759f | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/montecarlo/interestrate/models/LIBORMarketModelWithTenorRefinement.java#L186-L261 | train | This method returns the numeraire of the random variable at a given time. | Create a Java method that does the following: "This method returns the numeraire of the random variable at a given time.". | Of course, here is the Java code you requested:
```java
@Override
public RandomVariable getNumeraire(double time) throws CalculationException {
int timeIndex = liborPeriodDiscretizations[0].getTimeIndex(time);
TimeDiscretization liborPeriodDiscretization = liborPeriodDiscretizations[0];
if(timeIndex < 0) {
/... | |
yan74/afplib | org.afplib/src/main/java/org/afplib/afplib/impl/AfplibPackageImpl.java | AfplibPackageImpl.getMediaFidelity | public EClass getMediaFidelity() {
if (mediaFidelityEClass == null) {
mediaFidelityEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(506);
}
return mediaFidelityEClass;
} | java | public EClass getMediaFidelity() {
if (mediaFidelityEClass == null) {
mediaFidelityEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(506);
}
return mediaFidelityEClass;
} | [
"public",
"EClass",
"getMediaFidelity",
"(",
")",
"{",
"if",
"(",
"mediaFidelityEClass",
"==",
"null",
")",
"{",
"mediaFidelityEClass",
"=",
"(",
"EClass",
")",
"EPackage",
".",
"Registry",
".",
"INSTANCE",
".",
"getEPackage",
"(",
"AfplibPackage",
".",
"eNS_U... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f | https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/AfplibPackageImpl.java#L14989-L14994 | train | Get the media Fidelity. | Create a Java method that does the following: "Get the media Fidelity.". | Of course, here is the Java code you requested:
```java
public EClass getMediaFidelity() {
if (mediaFidelityEClass == null) {
mediaFidelityEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(506);
}
return mediaFidelityEClass;
}
```
Hope this helps! | |
akarnokd/akarnokd-xml | src/main/java/hu/akarnokd/xml/XNElement.java | XNElement.set | public void set(String name, String namespace, Object value) {
if (value != null) {
if (value instanceof Date) {
attributes.put(new XAttributeName(name, namespace, null), formatDateTime((Date)value));
} else {
attributes.put(new XAttributeName(name, namesp... | java | public void set(String name, String namespace, Object value) {
if (value != null) {
if (value instanceof Date) {
attributes.put(new XAttributeName(name, namespace, null), formatDateTime((Date)value));
} else {
attributes.put(new XAttributeName(name, namesp... | [
"public",
"void",
"set",
"(",
"String",
"name",
",",
"String",
"namespace",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"if",
"(",
"value",
"instanceof",
"Date",
")",
"{",
"attributes",
".",
"put",
"(",
"new",
"XAttr... | Set an attribute value identified by a local name and namespace.
@param name the attribute name
@param namespace the attribute namespace
@param value the value, if null, the attribute will be removed | [
"Set",
"an",
"attribute",
"value",
"identified",
"by",
"a",
"local",
"name",
"and",
"namespace",
"."
] | 57466a5a9cb455a13d7121557c165287b31ee870 | https://github.com/akarnokd/akarnokd-xml/blob/57466a5a9cb455a13d7121557c165287b31ee870/src/main/java/hu/akarnokd/xml/XNElement.java#L1151-L1161 | train | Set the value of an attribute. | Create a Java method that does the following: "Set the value of an attribute.". | Of course, here is the Java code you requested:
```java
public void set(String name, String namespace, Object value) {
if (value != null) {
if (value instanceof Date) {
attributes.put(new XAttributeName(name, namespace, null), formatDateTime((Date)value));
} else {
... | |
aws/aws-sdk-java | aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/transform/S3MachineLearningModelResourceDataMarshaller.java | S3MachineLearningModelResourceDataMarshaller.marshall | public void marshall(S3MachineLearningModelResourceData s3MachineLearningModelResourceData, ProtocolMarshaller protocolMarshaller) {
if (s3MachineLearningModelResourceData == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
proto... | java | public void marshall(S3MachineLearningModelResourceData s3MachineLearningModelResourceData, ProtocolMarshaller protocolMarshaller) {
if (s3MachineLearningModelResourceData == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
proto... | [
"public",
"void",
"marshall",
"(",
"S3MachineLearningModelResourceData",
"s3MachineLearningModelResourceData",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"s3MachineLearningModelResourceData",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientExcepti... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/transform/S3MachineLearningModelResourceDataMarshaller.java#L44-L56 | train | marshalls the given S3MachineLearningModelResourceData to the given protocolMarshaller. | Create a Java method that does the following: "marshalls the given S3MachineLearningModelResourceData to the given protocolMarshaller.". | Of course, here is the Java code you requested:
```java
public void marshall(S3MachineLearningModelResourceData s3MachineLearningModelResourceData, ProtocolMarshaller protocolMarshaller) {
if (s3MachineLearningModelResourceData == null) {
throw new SdkClientException("Invalid argument passed to ma... | |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/factory/feature/detect/interest/FactoryInterestPointAlgs.java | FactoryInterestPointAlgs.fastHessian | public static <II extends ImageGray<II>>
FastHessianFeatureDetector<II> fastHessian( @Nullable ConfigFastHessian config ) {
if( config == null )
config = new ConfigFastHessian();
config.checkValidity();
// ignore border is overwritten by Fast Hessian at detection time
NonMaxSuppression extractor = Factory... | java | public static <II extends ImageGray<II>>
FastHessianFeatureDetector<II> fastHessian( @Nullable ConfigFastHessian config ) {
if( config == null )
config = new ConfigFastHessian();
config.checkValidity();
// ignore border is overwritten by Fast Hessian at detection time
NonMaxSuppression extractor = Factory... | [
"public",
"static",
"<",
"II",
"extends",
"ImageGray",
"<",
"II",
">",
">",
"FastHessianFeatureDetector",
"<",
"II",
">",
"fastHessian",
"(",
"@",
"Nullable",
"ConfigFastHessian",
"config",
")",
"{",
"if",
"(",
"config",
"==",
"null",
")",
"config",
"=",
"... | Creates a Fast Hessian blob detector used by SURF.
@param config Configuration for detector. Pass in null for default options.
@param <II> Integral Image
@return The feature detector | [
"Creates",
"a",
"Fast",
"Hessian",
"blob",
"detector",
"used",
"by",
"SURF",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/feature/detect/interest/FactoryInterestPointAlgs.java#L170-L183 | train | Creates a Fast Hessian feature detector | Create a Java method that does the following: "Creates a Fast Hessian feature detector". | Of course, here is the Java code you requested:
```java
public static <II extends ImageGray<II>>
FastHessianFeatureDetector<II> fastHessian( @Nullable ConfigFastHessian config ) {
if( config == null )
config = new ConfigFastHessian();
config.checkValidity();
// ignore border is overwritten by Fast Hessian ... | |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/ant/DBUtility.java | DBUtility.exists | public void exists(String tableName, String columnName, String jdbcType, boolean ignoreCase) throws SQLException
{
if (tableName == null) throw new SQLException("TableName was null. You must specify a valid table name.");
if (columnName == null) throw new SQLException("Column name was null. You must specify a... | java | public void exists(String tableName, String columnName, String jdbcType, boolean ignoreCase) throws SQLException
{
if (tableName == null) throw new SQLException("TableName was null. You must specify a valid table name.");
if (columnName == null) throw new SQLException("Column name was null. You must specify a... | [
"public",
"void",
"exists",
"(",
"String",
"tableName",
",",
"String",
"columnName",
",",
"String",
"jdbcType",
",",
"boolean",
"ignoreCase",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"tableName",
"==",
"null",
")",
"throw",
"new",
"SQLException",
"(",
... | Checks the database for the existence of this table.column of the specified
jdbc type. Returns true if it exists, false if it doesn't exist, and throws
a SQLException if the connection is not established. NOTE: If a schema is
required for your database, then it should have been provided in the
connection url.
@param... | [
"Checks",
"the",
"database",
"for",
"the",
"existence",
"of",
"this",
"table",
".",
"column",
"of",
"the",
"specified",
"jdbc",
"type",
".",
"Returns",
"true",
"if",
"it",
"exists",
"false",
"if",
"it",
"doesn",
"t",
"exist",
"and",
"throws",
"a",
"SQLEx... | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/ant/DBUtility.java#L159-L238 | train | This method is used to check if a table with the specified name and column name exists in the database. | Create a Java method that does the following: "This method is used to check if a table with the specified name and column name exists in the database.". | Of course, here is the Java code you requested:
```java
public void exists(String tableName, String columnName, String jdbcType, boolean ignoreCase) throws SQLException
{
if (tableName == null) throw new SQLException("TableName was null. You must specify a valid table name.");
if (columnName == null) throw ne... | |
zandero/settings | src/main/java/com/zandero/settings/Settings.java | Settings.getInt | public int getInt(String name) {
Object value = super.get(name);
if (value instanceof Integer) {
return (Integer) value;
}
if (value == null) {
throw new IllegalArgumentException("Setting: '" + name + "', not found!");
}
try {
return Integer.parseInt(value.toString());
}
catch (NumberFormat... | java | public int getInt(String name) {
Object value = super.get(name);
if (value instanceof Integer) {
return (Integer) value;
}
if (value == null) {
throw new IllegalArgumentException("Setting: '" + name + "', not found!");
}
try {
return Integer.parseInt(value.toString());
}
catch (NumberFormat... | [
"public",
"int",
"getInt",
"(",
"String",
"name",
")",
"{",
"Object",
"value",
"=",
"super",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"value",
"instanceof",
"Integer",
")",
"{",
"return",
"(",
"Integer",
")",
"value",
";",
"}",
"if",
"(",
"val... | Get setting as integer
@param name setting key
@return setting value as integer
@throws IllegalArgumentException is setting is not present or can not be converted to an integer | [
"Get",
"setting",
"as",
"integer"
] | 802b44f41bc75e7eb2761028db8c73b7e59620c7 | https://github.com/zandero/settings/blob/802b44f41bc75e7eb2761028db8c73b7e59620c7/src/main/java/com/zandero/settings/Settings.java#L68-L86 | train | Gets the value of the specified setting as an integer. | Create a Java method that does the following: "Gets the value of the specified setting as an integer.". | Of course, here is the Java code you requested:
```java
public int getInt(String name) {
Object value = super.get(name);
if (value instanceof Integer) {
return (Integer) value;
}
if (value == null) {
throw new IllegalArgumentException("Setting: '" + name + "', not found!");
}
try {
return Inte... | |
RestComm/sip-servlets | containers/sip-servlets-as7/src/main/java/org/mobicents/servlet/sip/startup/SipStandardContextValve.java | SipStandardContextValve.event | public final void event(Request request, Response response, HttpEvent event)
throws IOException, ServletException {
// Select the Wrapper to be used for this Request
Wrapper wrapper = request.getWrapper();
// Normal request processing
// FIXME: This could be an addition to the ... | java | public final void event(Request request, Response response, HttpEvent event)
throws IOException, ServletException {
// Select the Wrapper to be used for this Request
Wrapper wrapper = request.getWrapper();
// Normal request processing
// FIXME: This could be an addition to the ... | [
"public",
"final",
"void",
"event",
"(",
"Request",
"request",
",",
"Response",
"response",
",",
"HttpEvent",
"event",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"// Select the Wrapper to be used for this Request",
"Wrapper",
"wrapper",
"=",
"request",
... | Select the appropriate child Wrapper to process this request,
based on the specified request URI. If no matching Wrapper can
be found, return an appropriate HTTP error.
@param request Request to be processed
@param response Response to be produced
@param valveContext Valve context used to forward to the next Valve
@... | [
"Select",
"the",
"appropriate",
"child",
"Wrapper",
"to",
"process",
"this",
"request",
"based",
"on",
"the",
"specified",
"request",
"URI",
".",
"If",
"no",
"matching",
"Wrapper",
"can",
"be",
"found",
"return",
"an",
"appropriate",
"HTTP",
"error",
"."
] | fd7011d2803ab1d205b140768a760c8c69e0c997 | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/containers/sip-servlets-as7/src/main/java/org/mobicents/servlet/sip/startup/SipStandardContextValve.java#L305-L369 | train | This method is called by the servlet to process the request and response. | Create a Java method that does the following: "This method is called by the servlet to process the request and response.". | Of course, here is the Java code you requested:
```java
public final void event(Request request, Response response, HttpEvent event)
throws IOException, ServletException {
// Select the Wrapper to be used for this Request
Wrapper wrapper = request.getWrapper();
// Normal request proce... | |
pushtorefresh/storio | storio-common/src/main/java/com/pushtorefresh/storio3/internal/InternalQueries.java | InternalQueries.nonNullSet | @SuppressWarnings("unchecked")
@NonNull
public static Set<String> nonNullSet(@Nullable Collection<String> collection) {
return collection == null || collection.isEmpty()
? Collections.<String>emptySet()
: new HashSet<String>(collection);
} | java | @SuppressWarnings("unchecked")
@NonNull
public static Set<String> nonNullSet(@Nullable Collection<String> collection) {
return collection == null || collection.isEmpty()
? Collections.<String>emptySet()
: new HashSet<String>(collection);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"NonNull",
"public",
"static",
"Set",
"<",
"String",
">",
"nonNullSet",
"(",
"@",
"Nullable",
"Collection",
"<",
"String",
">",
"collection",
")",
"{",
"return",
"collection",
"==",
"null",
"||",
"coll... | Converts collection of something to non-null set.
@param collection source collection to convert, can be {@code null}.
@return non-null, set of something. | [
"Converts",
"collection",
"of",
"something",
"to",
"non",
"-",
"null",
"set",
"."
] | 58f53d81bcc7b069c8bb271c46a90e37775abe8d | https://github.com/pushtorefresh/storio/blob/58f53d81bcc7b069c8bb271c46a90e37775abe8d/storio-common/src/main/java/com/pushtorefresh/storio3/internal/InternalQueries.java#L192-L198 | train | Returns a non - null non - empty set. | Create a Java method that does the following: "Returns a non - null non - empty set.". | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
@NonNull
public static Set<String> nonNullSet(@Nullable Collection<String> collection) {
return collection == null || collection.isEmpty()
? Collections.<String>emptySet()
: new HashSe... | |
apache/spark | sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java | EmbeddedCLIServiceClient.getInfo | @Override
public GetInfoValue getInfo(SessionHandle sessionHandle, GetInfoType getInfoType)
throws HiveSQLException {
return cliService.getInfo(sessionHandle, getInfoType);
} | java | @Override
public GetInfoValue getInfo(SessionHandle sessionHandle, GetInfoType getInfoType)
throws HiveSQLException {
return cliService.getInfo(sessionHandle, getInfoType);
} | [
"@",
"Override",
"public",
"GetInfoValue",
"getInfo",
"(",
"SessionHandle",
"sessionHandle",
",",
"GetInfoType",
"getInfoType",
")",
"throws",
"HiveSQLException",
"{",
"return",
"cliService",
".",
"getInfo",
"(",
"sessionHandle",
",",
"getInfoType",
")",
";",
"}"
] | /* (non-Javadoc)
@see org.apache.hive.service.cli.CLIServiceClient#getInfo(org.apache.hive.service.cli.SessionHandle, java.util.List) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java#L64-L68 | train | Get the value of the
. | Create a Java method that does the following: "Get the value of the
.". | Of course, here is the Java code you requested:
```java
@Override
public GetInfoValue getInfo(SessionHandle sessionHandle, GetInfoType getInfoType)
throws HiveSQLException {
return cliService.getInfo(sessionHandle, getInfoType);
}
```
Hope this helps! | |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.wrapDriverInProfilingProxy | private Object wrapDriverInProfilingProxy(Object newDriverInstance) {
Class<?> cls = getDriverInterfaceForProxy(newDriverInstance);
if (cls == null) {
return newDriverInstance;
}
return Proxy.newProxyInstance(
Thread.currentThread().getContextClassLoader(),
... | java | private Object wrapDriverInProfilingProxy(Object newDriverInstance) {
Class<?> cls = getDriverInterfaceForProxy(newDriverInstance);
if (cls == null) {
return newDriverInstance;
}
return Proxy.newProxyInstance(
Thread.currentThread().getContextClassLoader(),
... | [
"private",
"Object",
"wrapDriverInProfilingProxy",
"(",
"Object",
"newDriverInstance",
")",
"{",
"Class",
"<",
"?",
">",
"cls",
"=",
"getDriverInterfaceForProxy",
"(",
"newDriverInstance",
")",
";",
"if",
"(",
"cls",
"==",
"null",
")",
"{",
"return",
"newDriverI... | Wraps a driver object with a dynamic proxy that counts method calls and their durations.<p>
@param newDriverInstance the driver instance to wrap
@return the proxy | [
"Wraps",
"a",
"driver",
"object",
"with",
"a",
"dynamic",
"proxy",
"that",
"counts",
"method",
"calls",
"and",
"their",
"durations",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L11984-L11994 | train | Wrap the newDriverInstance in a ProfilingProxy. | Create a Java method that does the following: "Wrap the newDriverInstance in a ProfilingProxy.". | Of course, here is the Java code you requested:
```java
private Object wrapDriverInProfilingProxy(Object newDriverInstance) {
Class<?> cls = getDriverInterfaceForProxy(newDriverInstance);
if (cls == null) {
return newDriverInstance;
}
return Proxy.newProxyInstance(
... | |
SonarSource/sonarqube | server/sonar-db-dao/src/main/java/org/sonar/db/permission/GroupPermissionDao.java | GroupPermissionDao.selectByGroupIds | public List<GroupPermissionDto> selectByGroupIds(DbSession dbSession, String organizationUuid, List<Integer> groupIds, @Nullable Long projectId) {
return executeLargeInputs(groupIds, groups -> mapper(dbSession).selectByGroupIds(organizationUuid, groups, projectId));
} | java | public List<GroupPermissionDto> selectByGroupIds(DbSession dbSession, String organizationUuid, List<Integer> groupIds, @Nullable Long projectId) {
return executeLargeInputs(groupIds, groups -> mapper(dbSession).selectByGroupIds(organizationUuid, groups, projectId));
} | [
"public",
"List",
"<",
"GroupPermissionDto",
">",
"selectByGroupIds",
"(",
"DbSession",
"dbSession",
",",
"String",
"organizationUuid",
",",
"List",
"<",
"Integer",
">",
"groupIds",
",",
"@",
"Nullable",
"Long",
"projectId",
")",
"{",
"return",
"executeLargeInputs... | Select global or project permission of given groups and organization. Anyone virtual group is supported
through the value "zero" (0L) in {@code groupIds}. | [
"Select",
"global",
"or",
"project",
"permission",
"of",
"given",
"groups",
"and",
"organization",
".",
"Anyone",
"virtual",
"group",
"is",
"supported",
"through",
"the",
"value",
"zero",
"(",
"0L",
")",
"in",
"{"
] | 2fffa4c2f79ae3714844d7742796e82822b6a98a | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-db-dao/src/main/java/org/sonar/db/permission/GroupPermissionDao.java#L64-L66 | train | Returns a list of group permissions for the given organization and group ids. | Create a Java method that does the following: "Returns a list of group permissions for the given organization and group ids.". | Of course, here is the Java code you requested:
```java
public List<GroupPermissionDto> selectByGroupIds(DbSession dbSession, String organizationUuid, List<Integer> groupIds, @Nullable Long projectId) {
return executeLargeInputs(groupIds, groups -> mapper(dbSession).selectByGroupIds(organizationUuid, groups, proje... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.