code stringlengths 160 48.7k | prompt stringlengths 55 1.51k |
|---|---|
Of course, here is the Java code you requested:
```java
public void assignGroup(XEvent event, String group) {
if (group != null && group.trim().length() > 0) {
XAttributeLiteral attr = (XAttributeLiteral) ATTR_GROUP.clone();
attr.setValue(group.trim());
event.getAttributes().put(KEY_GROUP, attr);
}
}
```... | Create a Java method that does the following: "Assigns the group attribute value to the given event.". |
Of course, here is the Java code you requested:
```java
<E> Observable<E> wrapObservable(@NonNull Observable<E> obs, @NonNull Logger log, final String msg) {
return obs.subscribeOn(Schedulers.io()).observeOn(Schedulers.io())
.doOnNext(r -> log(log, (ComapiResult) r, msg))
.doOnE... | Create a Java method that does the following: "Wrap an observable.". |
Of course, here is the Java code you requested:
```java
public void setR(Integer newR) {
Integer oldR = r;
r = newR;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.GSAP__R, oldR, r));
}
```
Hope this helps! | Create a Java method that does the following: "Sets the value r". |
Of course, here is the Java code you requested:
```java
public int queueSize() {
return queue.stream().map(el -> el.size).reduce(0, (l,r) -> l+r);
}
```
Hope this helps! | Create a Java method that does the following: "Returns the size of the queue.". |
Of course, here is the Java code you requested:
```java
public static org.postgis.Geometry convert(Geometry geometry) {
if (geometry instanceof Point) {
return convert((Point) geometry);
} else if (geometry instanceof LinearRing) {
return convert((LinearRing) geometry);
... | Create a Java method that does the following: "Convert a geometry to a postgis geometry.". |
Of course, here is the Java code you requested:
```java
public void init(RecordOwnerParent parent, Rec recordMain, Map<String, Object> properties)
{
m_taskParent = parent;
if (m_taskParent != null)
m_taskParent.addRecordOwner(this);
if (recordMain == null)
reco... | Create a Java method that does the following: "Initialize the CBESession.". |
Of course, here is the Java code you requested:
```java
public static Key ancestor(Key key) {
Key ancestor = key;
while (ancestor.getParent() != null) {
ancestor = ancestor.getParent();
}
return ancestor;
}
```
Hope this helps! | Create a Java method that does the following: "Get the ancestor of the given key.". |
Of course, here is the Java code you requested:
```java
public ClassBuilder<T> withMethod(Method method, Expression expression) {
methods.put(method, expression);
return this;
}
```
Hope this helps! | Create a Java method that does the following: "Adds a method to the class.". |
Of course, here is the Java code you requested:
```java
public void marshall(ListUpdatesRequest listUpdatesRequest, ProtocolMarshaller protocolMarshaller) {
if (listUpdatesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
... | Create a Java method that does the following: "marshalls the given parameter object.". |
Of course, here is the Java code you requested:
```java
public static boolean isValidUUID(String uuid) {
try {
return (null != uuid) && (null != UUID.valueOf(uuid));
} catch (NumberFormatException e) {
// return false
}
return false;
}
```
Hope this helps! | Create a Java method that does the following: "Check if a UUID is a valid UUID.". |
Of course, here is the Java code you requested:
```java
private <F> Collection<Integer> transformCoFeedback(CoFeedbackTransformation<F> coIterate) {
// For Co-Iteration we don't need to transform the input and wire the input to the
// head operator by returning the input IDs, the input is directly wired to the le... | Create a Java method that does the following: "Transform the co - feedback edges of the given Co - Iteration.". |
Of course, here is the Java code you requested:
```java
public List<TraitType.AttributeSet> getAttributeSet() {
if (attributeSet == null) {
attributeSet = new ArrayList<TraitType.AttributeSet>();
}
return this.attributeSet;
}
```
Hope this helps! | Create a Java method that does the following: "Gets the value of the attributeSet property.". |
Of course, here is the Java code you requested:
```java
public <E> EntityBatch<E> createBatch(EntityMapper<E> entityMapper,
long writeBufferSize) {
return new BaseEntityBatch<E>(this, entityMapper, pool, tableName,
writeBufferSize);
}
```
Hope this helps! | Create a Java method that does the following: "Create a new batch of entities.". |
Of course, here is the Java code you requested:
```java
@PostMapping(path = "/instances", consumes = MediaType.APPLICATION_JSON_VALUE)
public Mono<ResponseEntity<Map<String, InstanceId>>> register(@RequestBody Registration registration,
UriComponent... | Create a Java method that does the following: "Register an instance with the application.". |
Of course, here is the Java code you requested:
```java
public static void setCookie(String name, String value, int maxAge, boolean httpOnly, HttpServletRequest request, HttpServletResponse response) {
String domain = request.getServerName();
// String domain = serverName;
setCookie(name, value, maxAge, httpOnly... | Create a Java method that does the following: "Sets a cookie.". |
Of course, here is the Java code you requested:
```java
public Path createIndex() throws IOException {
Path indexPath = bamFile.getParent().resolve(bamFile.getFileName().toString() + ".bai");
return createIndex(indexPath);
}
```
Hope this helps! | Create a Java method that does the following: "Create an index file for the BAM file.". |
Of course, here is the Java code you requested:
```java
public void add(String name, MessageArg arg) {
args.add(arg);
if (map == null) {
map = new HashMap<>();
}
map.put(name, arg);
}
```
Hope this helps! | Create a Java method that does the following: "Add a message argument to the message.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public EList<IfcAddress> getAddresses() {
return (EList<IfcAddress>) eGet(Ifc2x3tc1Package.Literals.IFC_PERSON__ADDRESSES, true);
}
```
Hope this helps! | Create a Java method that does the following: "Gets the list of addresses contained in this IFCPerson.". |
Of course, here is the Java code you requested:
```java
public List<RedisClient> getAliveClients(Object key) {
List<RedisClient> aliveClients = new ArrayList<RedisClient>();
for (RedisClient redisClient : clientList) {
if (redisClient.isAlive()) {
aliveClients.add(redisClien... | Create a Java method that does the following: "Gets the alive clients.". |
Of course, here is the Java code you requested:
```java
private void flushBuffer(final ByteBuffer buffer, final DataOutput stream) throws IOException {
buffer.flip();
stream.write(buffer.array(), buffer.arrayOffset(), buffer.remaining());
buffer.clear();
}
```
Hope this helps! | Create a Java method that does the following: "Flush the buffer to the output.". |
Of course, here is the Java code you requested:
```java
public void initAfterLoad(ClusteredSipStack sipStackImpl) {
String transport = getLastResponseTopMostVia().getTransport();
Iterator<SipProviderImpl> providers = sipStackImpl.getSipProviders();
boolean providerNotFound = true;
while(providers.hasNext()) {
... | Create a Java method that does the following: "Initialize after the load of the SIPStackImpl.". |
Of course, here is the Java code you requested:
```java
protected void ensureEmptyLabel() {
if (m_emptyLabel == null) {
m_emptyLabel = new Label(CmsAliasMessages.messagesEmptyImportResult());
}
m_root.add(m_emptyLabel);
}
```
Hope this helps! | Create a Java method that does the following: "Ensure that the empty label is set.". |
Of course, here is the Java code you requested:
```java
private String getCacheManagerName(String beanName) {
if (beanName.length() > CACHE_MANAGER_SUFFIX.length()
&& StringUtils.endsWithIgnoreCase(beanName, CACHE_MANAGER_SUFFIX)) {
return beanName.substring(0,
beanName.length() - CACHE_MANAGER_SUFFIX.le... | Create a Java method that does the following: "Returns the cache manager name.". |
Of course, here is the Java code you requested:
```java
private synchronized void open() throws DatabaseException {
try {
if (!isOpen()) {
connection = connectionFactory.getConnection();
final String databaseProductName = determineDatabaseProductName(this.connection)... | Create a Java method that does the following: "Open the database.". |
Of course, here is the Java code you requested:
```java
public static void parseXmlAndSetIconicsDrawables(@NonNull Context context,
int menuId,
@NonNull Menu menu,
... | Create a Java method that does the following: "Parses the XML of a menu and sets the icons drawables of the menu.". |
Of course, here is the Java code you requested:
```java
public static double median (double[] vector) {
final double[] sorted = vector.clone();
Arrays.sort(sorted);
if (vector.length % 2 == 1) {
return sorted[vector.length / 2];
}
return (sorted[vector.length / 2 - 1... | Create a Java method that does the following: "Get the median value of a vector.". |
Of course, here is the Java code you requested:
```java
public String convertObjectClassificationStrucFlgsToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
}
```
Hope this helps! | Create a Java method that does the following: "Convert an object classification string to a string.". |
Of course, here is the Java code you requested:
```java
public static Condition exactTextCaseSensitive(final String text) {
return new Condition("exact text case sensitive") {
@Override
public boolean apply(Driver driver, WebElement element) {
return Html.text.equalsCaseSensitive(element.getTex... | Create a Java method that does the following: "Returns a condition that tests if an element s text is equal to the provided text case sensitive.". |
Of course, here is the Java code you requested:
```java
@Override
public void commit() {
List<Key> deletes = new ArrayList<Key>();
deletes.add(Translation.toEntity(lock, Keys.create(
Translation.toKind(entity.getClass()),
Entities.keyValue(entity))).getKey());
Key transactionKey = KeyFactory.stringToKe... | Create a Java method that does the following: "Commit the transaction.". |
Of course, here is the Java code you requested:
```java
protected Page newPage(final HttpServletRequest req, final HttpServletResponse resp,
final String template) {
final Page page = new Page(req, resp, getApplication().getVelocityEngine(), template);
page.add("version", jarVersion);
page.add("azkab... | Create a Java method that does the following: "Create a new page.". |
Of course, here is the Java code you requested:
```java
public boolean deactivate() throws Exception
{
if (activated)
{
if (!activeEndpoints.isEmpty())
throw new Exception("Still active endpoints");
resourceAdapter.stop();
((CloneableBootstrapContext) bc).shutdown... | Create a Java method that does the following: "Deactivate the bootstrap context". |
Of course, here is the Java code you requested:
```java
public void marshall(DescribeEntityRecognizerRequest describeEntityRecognizerRequest, ProtocolMarshaller protocolMarshaller) {
if (describeEntityRecognizerRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(..... | Create a Java method that does the following: "marshalls the given request to the JSON - compatible parameter object.". |
Of course, here is the Java code you requested:
```java
private static void checkExists(FileSystem fs, Path location) {
try {
if (!fs.exists(location)) {
throw new DatasetNotFoundException(
"Descriptor location does not exist: " + location);
}
} catch (IOException ex) {
th... | Create a Java method that does the following: "Check if the location exists in the file system.". |
Of course, here is the Java code you requested:
```java
public static Calendar ceiling(Calendar calendar, DateField dateField) {
return DateModifier.modify(calendar, dateField.getValue(), ModifyType.CEILING);
}
```
Hope this helps! | Create a Java method that does the following: "Returns a calendar that is the ceiling of the specified date field.". |
Of course, here is the Java code you requested:
```java
public Resource createCommandResourceWadl() {
final Resource resource = new Resource();
resource.setPath(getName());
final Method method = new Method();
method.setName("POST");
resource.getMethodOrResource().add(method);
definePostMethodWadl(method)... | Create a Java method that does the following: "Create a command resource wadl.". |
Of course, here is the Java code you requested:
```java
private static boolean isNumericType(Class<?> c) {
return Number.class.isAssignableFrom(c)
|| double.class == c
|| float.class == c
|| long.class == c
|| int.class == c
|| short.class == c
|| byte.class == c;
... | Create a Java method that does the following: "Checks if a class is a Number type.". |
Of course, here is the Java code you requested:
```java
public DefaultSimpleValidator<D, O> build() {
final DefaultSimpleValidator<D, O> validator = new DefaultSimpleValidator<D, O>();
for (final Trigger trigger : registeredTriggers) {
validator.addTrigger(trigger);
}
for (... | Create a Java method that does the following: "Build the DefaultSimpleValidator.". |
Of course, here is the Java code you requested:
```java
public JobScheduleExistsOptions withOcpDate(DateTime ocpDate) {
if (ocpDate == null) {
this.ocpDate = null;
} else {
this.ocpDate = new DateTimeRfc1123(ocpDate);
}
return this;
}
```
Hope this helps! | Create a Java method that does the following: "Sets the ocpDate value for the calendar.". |
Of course, here is the Java code you requested:
```java
public Assertion newAssertion(final List<Statement> authnStatement, final String issuer,
final ZonedDateTime issuedAt, final String id) {
val assertion = newSamlObject(Assertion.class);
assertion.setID(id);
... | Create a Java method that does the following: "New assertion.". |
Of course, here is the Java code you requested:
```java
public static byte[] loadDottedClassAsBytes(ClassLoader loader, String dottedclassname) {
if (GlobalConfiguration.assertsMode) {
if (dottedclassname.endsWith(".class")) {
throw new IllegalStateException(".class suffixed name should not be passed:" + dott... | Create a Java method that does the following: "Load a class from a class loader.". |
Of course, here is the Java code you requested:
```java
public Observable<Void> disableMonitoringAsync(String resourceGroupName, String clusterName) {
return disableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
... | Create a Java method that does the following: "Disables the Cluster Service monitoring.". |
Of course, here is the Java code you requested:
```java
public void authenticate(
HttpServletRequest request,
Map<String, String> principals,
Map<String, String> credentials,
IPerson person)
throws PortalSecurityException {
// Retrieve the security c... | Create a Java method that does the following: "This method performs authentication for the user.". |
Of course, here is the Java code you requested:
```java
public Object replace(CacheKey key, Object value)
{
return parentCache.replace(key, value);
}
```
Hope this helps! | Create a Java method that does the following: "replace the value of the key in this cache with the new value". |
Of course, here is the Java code you requested:
```java
private void initCss() {
I_CmsLayoutBundle.INSTANCE.galleryDialogCss().ensureInjected();
I_CmsLayoutBundle.INSTANCE.galleryResultItemCss().ensureInjected();
I_CmsLayoutBundle.INSTANCE.listTreeCss().ensureInjected();
I_CmsLayoutBun... | Create a Java method that does the following: "Initializes the CSS.". |
Of course, here is the Java code you requested:
```java
public V put (K key, V value) {
if (key == null) throw new IllegalArgumentException("key cannot be null.");
K[] keyTable = this.keyTable;
int mask = this.mask;
// Check for existing keys.
int hashCode = key.hashCode();
int index1 = hashCode & ... | Create a Java method that does the following: "Associates the specified value with the specified key in this map.". |
Of course, here is the Java code you requested:
```java
@Override
public AssociateDeviceWithRoomResult associateDeviceWithRoom(AssociateDeviceWithRoomRequest request) {
request = beforeClientExecution(request);
return executeAssociateDeviceWithRoom(request);
}
```
Hope this helps! | Create a Java method that does the following: "Associates a device with an existing room.". |
Of course, here is the Java code you requested:
```java
@Override
public long toEpochDay() {
long year = prolepticYear;
long accountingEpochDay = ((year - 1) * WEEKS_IN_YEAR + chronology.previousLeapYears(year)) * DAYS_IN_WEEK + (getDayOfYear() - 1);
return accountingEpochDay - chronology.g... | Create a Java method that does the following: "Returns the epoch day of the calendar.". |
Of course, here is the Java code you requested:
```java
public List<Task> createTask(TaskModel taskModel, Execution execution) {
List<Task> tasks = new ArrayList<Task>();
Map<String, Object> args = execution.getArgs();
if(args == null) args = new HashMap<String, Object>();
Date expireDate = DateHelper.proce... | Create a Java method that does the following: "Create a task.". |
Of course, here is the Java code you requested:
```java
@Override
public JSONObject toJsonObject() throws JSONException {
JSONObject returnVal = super.toJsonObject();
//User Query...
if(this.getUserQuery() != null)
{
returnVal.put(JSONMapping.USER_QUERY,
... | Create a Java method that does the following: "Override toJsonObject to return a JSONObject with all the information in this object.". |
Of course, here is the Java code you requested:
```java
public java.util.Optional<T> toJavaUtil() {
return java.util.Optional.ofNullable(orNull());
}
```
Hope this helps! | Create a Java method that does the following: "Returns a JavaUtil object that represents the value of the CID .". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("deprecation")
private synchronized TaskAttemptInfo getMapTaskAttemptInfo(
TaskTracker taskTracker, TaskAttemptID taskAttemptID) {
assert (taskAttemptID.isMap());
JobID jobid = (JobID) taskAttemptID.getJobID();
assert (jobid... | Create a Java method that does the following: "Get the map task attempt info.". |
Of course, here is the Java code you requested:
```java
public OptionalThing<Function<Map<String, Object>, Map<String, Object>>> getRequestParameterMapFilter() {
return requestParameterMapFilter;
}
```
Hope this helps! | Create a Java method that does the following: "Gets the request parameter map filter.". |
Of course, here is the Java code you requested:
```java
private Object parseComparatorArgument(CharSequenceScanner scanner) {
int index = scanner.getCurrentIndex();
Object comparatorArgument;
char c = scanner.forcePeek();
if ((c == '"') || (c == '\'')) {
scanner.next();
comparatorArgument ... | Create a Java method that does the following: "Parses the comparator argument.". |
Of course, here is the Java code you requested:
```java
public void initValues(
int mtLv,
String superiorModuleCode,
PrintStream out,
PrintStream err
) {
//
mtLv ++;
//
moduleCode = superiorModuleCode + "." + baseModuleCode;
//
this.out = out;
this.err = err;
//
}
```
Hope this helps! | Create a Java method that does the following: "Initialize the values of the object.". |
Of course, here is the Java code you requested:
```java
public Observable<SecretBundle> recoverDeletedSecretAsync(String vaultBaseUrl, String secretName) {
return recoverDeletedSecretWithServiceResponseAsync(vaultBaseUrl, secretName).map(new Func1<ServiceResponse<SecretBundle>, SecretBundle>() {
@O... | Create a Java method that does the following: "Recover a deleted secret. Recovery is performed on a secret that was deleted by the client.". |
Of course, here is the Java code you requested:
```java
public List<?> decode(IoBuffer data) {
log.debug("decode - state: {}", state);
if (closing || state.getState() == RTMP.STATE_DISCONNECTED) {
// Connection is being closed, don't decode any new packets
return Collections... | Create a Java method that does the following: "Decodes a single SHORT_TAG tag from the given data.". |
Of course, here is the Java code you requested:
```java
public final ControlSilence createNewControlSilence() throws MessageCreateFailedException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewControlSilence");
ControlSilence msg = null;
try {
msg = new C... | Create a Java method that does the following: "Create a new empty ControlSilence Message". |
Of course, here is the Java code you requested:
```java
@Override
public Tuple2<Cells, Cells> apply(Cells cells) {
Cells keys = cells.getIndexCells();
Cells values = cells.getValueCells();
return new Tuple2<>(keys, values);
}
```
Hope this helps! | Create a Java method that does the following: "Override this method to return a tuple of the two cells.". |
Of course, here is the Java code you requested:
```java
public Extension findExtension(String keyStr) throws RuntimeFault, RemoteException {
if (keyStr == null) {
throw new NullPointerException();
}
return getVimService().findExtension(getMOR(), keyStr);
}
```
Hope this he... | Create a Java method that does the following: "Find an extension in the system.". |
Of course, here is the Java code you requested:
```java
@Deprecated
protected static String getPattern(Locale forLocale, int choice) {
return getPattern(ULocale.forLocale(forLocale), choice);
}
```
Hope this helps! | Create a Java method that does the following: "Gets the pattern for the given locale.". |
Of course, here is the Java code you requested:
```java
public final CsvReader lazyGetCsvReader() throws Exception {
String beanName = getCsvReaderName();
CsvReader csvReader = (CsvReader) this.beansMap.get(beanName);
if (csvReader == null) {
csvReader = new CsvReader();
this.beansMap.put(beanN... | Create a Java method that does the following: "Get the CSV reader from the map.". |
Of course, here is the Java code you requested:
```java
public static boolean isNamedElement(final Node aNode) {
final boolean isElementNode = aNode != null && aNode.getNodeType() == Node.ELEMENT_NODE;
return isElementNode
&& getNamedAttribute(aNode, NAME_ATTRIBUTE) != null
... | Create a Java method that does the following: "Check if the passed node is an element node with a name attribute.". |
Of course, here is the Java code you requested:
```java
protected void changeCurrentLevel(ParserData parserData, final Level newLevel, int newIndentationLevel) {
parserData.setIndentationLevel(newIndentationLevel);
parserData.setCurrentLevel(newLevel);
}
```
Hope this helps! | Create a Java method that does the following: "Change the current level of the parser.". |
Of course, here is the Java code you requested:
```java
boolean fitRotate2D(Dimension dimension) {
if (dimension.getHeight() < height) {
return false;
}
return fitRotate2D(dimension.getWidth(), dimension.getDepth());
}
```
Hope this helps! | Create a Java method that does the following: "Fits a 2D rotation on the image.". |
Of course, here is the Java code you requested:
```java
public void init(RemoteTask server, BaseMessageQueue baseMessageQueue)
throws RemoteException
{
super.init(baseMessageQueue);
m_receiveQueue = server.createRemoteReceiveQueue(baseMessageQueue.getQueueName(), baseMessageQueue.getQueueTy... | Create a Java method that does the following: "Initializes the BaseMessageQueue object.". |
Of course, here is the Java code you requested:
```java
public static double computeTauAndDivideRow( final int blockLength ,
final DSubmatrixD1 Y ,
final int row , int colStart , final double max ) {
final int hei... | Create a Java method that does the following: "Compute the tau and divide row.". |
Of course, here is the Java code you requested:
```java
public static void toGeojsonGeometry(Geometry geom, StringBuilder sb) {
if (geom instanceof Point) {
toGeojsonPoint((Point) geom, sb);
} else if (geom instanceof LineString) {
toGeojsonLineString((LineString) geom, sb);
... | Create a Java method that does the following: "To GeoJSON Geometry.". |
Of course, here is the Java code you requested:
```java
@Override
public void setHeader(String key, String value)
{
int tail;
if (_headerSize > 0) {
tail = (_headerValues[_headerSize - 1].offset()
+ _headerValues[_headerSize - 1].length());
}
else {
tail = 0;
}
i... | Create a Java method that does the following: "Sets the value of the header.". |
Of course, here is the Java code you requested:
```java
private OsType determineOsType(String imageId) {
InspectImageResponse ir = getClient().inspectImageCmd(imageId).exec();
if ("linux".equalsIgnoreCase(ir.getOs())) {
LOG.trace("Detected LINUX operating system for image: {}", imageId);
... | Create a Java method that does the following: "Determine the operating system type of the image.". |
Of course, here is the Java code you requested:
```java
public final void mID() throws RecognitionException {
try {
int _type = ID;
int _channel = DEFAULT_TOKEN_CHANNEL;
// src/riemann/Query.g:85:5: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' |... | Create a Java method that does the following: "Starts the ID action of a CID.". |
Of course, here is the Java code you requested:
```java
public void setReservedCacheNodesOfferings(java.util.Collection<ReservedCacheNodesOffering> reservedCacheNodesOfferings) {
if (reservedCacheNodesOfferings == null) {
this.reservedCacheNodesOfferings = null;
return;
}
... | Create a Java method that does the following: "Sets the value of the reservedCacheNodesOfferings property.". |
Of course, here is the Java code you requested:
```java
public void setLcdCrystalEnabled(final boolean ENABLED) {
if (null == lcdCrystalEnabled) {
_lcdCrystalEnabled = ENABLED;
fireUpdateEvent(VISIBILITY_EVENT);
} else {
lcdCrystalEnabled.set(ENABLED);
}
... | Create a Java method that does the following: "Defines if the LCD coding is enabled.". |
Of course, here is the Java code you requested:
```java
public static <R> AsyncCallback<R> build(final AsyncCallbackOnSuccess<R> pcallbackOnSuccess,
final AsyncCallbackOnFailure pcallbackOnFailure) {
return new AsyncCallback<R>() {
@Override
public void onFailure(final Throwable pcaught) {
... | Create a Java method that does the following: "Build an AsyncCallback.". |
Of course, here is the Java code you requested:
```java
public void addCategory(String category) throws JSONException {
logger.debug("Adding category [" + category + "]");
put("category", category, this.apsDictionary, true);
}
```
Hope this helps! | Create a Java method that does the following: "Add a category to the category list.". |
Of course, here is the Java code you requested:
```java
public void parse(CharSequence in, Appendable out) throws IOException, HttpErrorPage {
ParserContextImpl ctx = new ParserContextImpl(out, httpRequest, httpResponse);
Matcher matcher = pattern.matcher(in);
int currentPosition = 0;
w... | Create a Java method that does the following: "Parse the input char sequence.". |
Of course, here is the Java code you requested:
```java
void writeSection(SQLRecoverableUnitSectionImpl target) throws InternalLogException
{
if (tc.isEntryEnabled()) Tr.entry(tc, "writeSection",new java.lang.Object[]{this,target});
// If the parent recovery log instance has experienced a serious internal e... | Create a Java method that does the following: "Write a SQL RecoverableUnitSection to the target SQLRecoverableUnitSection.". |
Of course, here is the Java code you requested:
```java
public void setFQNFormat(Integer newFQNFormat) {
Integer oldFQNFormat = fqnFormat;
fqnFormat = newFQNFormat;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.FULLY_QUALIFIED_NAME__FQN_FORMAT, oldFQNFormat, ... | Create a Java method that does the following: "Sets the FQN format of the file.". |
Of course, here is the Java code you requested:
```java
public static void requireArgValid(@NotNull final String name, @NotNull final String value) throws ConstraintViolationException {
// CHECKSTYLE:ON
if (!isValid(value)) {
throw new ConstraintViolationException(
"The... | Create a Java method that does the following: "Require that an argument is a valid hour range.". |
Of course, here is the Java code you requested:
```java
void performRun(IntegrationOperation operation) {
for (Map.Entry<String, Integration<?>> entry : integrations.entrySet()) {
String key = entry.getKey();
long startTime = System.nanoTime();
operation.run(key, entry.getValue(), projectSettings... | Create a Java method that does the following: "Run an integration operation.". |
Of course, here is the Java code you requested:
```java
public void cacheConcept(Concept concept) {
conceptCache.put(concept.id(), concept);
if (concept.isSchemaConcept()) {
SchemaConcept schemaConcept = concept.asSchemaConcept();
schemaConceptCache.put(schemaConcept.label(), sc... | Create a Java method that does the following: "Cache a Concept.". |
Of course, here is the Java code you requested:
```java
public static <E> Set<E> newSetFromMap(Map<E, Boolean> m) {
return new SetFromMap<>(m);
}
```
Hope this helps! | Create a Java method that does the following: "Create a Set from a Map.". |
Of course, here is the Java code you requested:
```java
public void end(Xid xid, int flags) throws XAException
{
if (pad)
xid = convertXid(xid);
xaResource.end(xid, flags);
}
```
Hope this helps! | Create a Java method that does the following: "End a transaction.". |
Of course, here is the Java code you requested:
```java
public EClass getIfcHeatingValueMeasure() {
if (ifcHeatingValueMeasureEClass == null) {
ifcHeatingValueMeasureEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(683);
}
return ifcHeatingVal... | Create a Java method that does the following: "Get the IfcHeatingValueMeasure class.". |
Of course, here is the Java code you requested:
```java
public ServiceFuture<Void> stopAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, accountName, ... | Create a Java method that does the following: "Stops a CDN streaming endpoint. Stop a CDN streaming endpoint.". |
Of course, here is the Java code you requested:
```java
private void bind() {
upcomingManeuverView = findViewById(R.id.maneuverView);
upcomingDistanceText = findViewById(R.id.stepDistanceText);
upcomingPrimaryText = findViewById(R.id.stepPrimaryText);
upcomingSecondaryText = findViewById(R.id.stepSecon... | Create a Java method that does the following: "bind the views". |
Of course, here is the Java code you requested:
```java
@BetaApi
public final Operation insertTargetSslProxy(
String project, TargetSslProxy targetSslProxyResource) {
InsertTargetSslProxyHttpRequest request =
InsertTargetSslProxyHttpRequest.newBuilder()
.setProject(project)
... | Create a Java method that does the following: "Creates a TargetSslProxy resource in the specified project using the JSON merge patch format.". |
Of course, here is the Java code you requested:
```java
public synchronized T applyEx() {
// Have we produced our value yet?
if (producer != null) {
// produce our value.
value = producer.apply();
// Delete the producer to 1. mark the work done and 2. free resources.... | Create a Java method that does the following: "This method is called by the application to apply the exception to the resource.". |
Of course, here is the Java code you requested:
```java
public static void setIconImage(final String resourceName, final Window window)
throws IOException
{
final InputStream isLogo = ClassExtensions.getResourceAsStream(resourceName);
final BufferedImage biLogo = ImageIO.read(isLogo);
window.setIconImage(biLo... | Create a Java method that does the following: "Sets the icon image of the specified resource.". |
Of course, here is the Java code you requested:
```java
protected synchronized void groupCloseNotification(Conversation conversation,
ProxyQueueConversationGroup group)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "gr... | Create a Java method that does the following: "Called by the proxy queue conversation when a group is closed.". |
Of course, here is the Java code you requested:
```java
public static String decToHex(int dec, int minDigits) {
String ret = Integer.toHexString(dec);
while (ret.length() < minDigits) {
ret = '0' + ret;
}
return ret;
}
```
Hope this helps! | Create a Java method that does the following: "Convert an integer to a hex string.". |
Of course, here is the Java code you requested:
```java
public KafkaClient setProducerProperties(Properties props) {
if (props == null) {
producerProperties = null;
} else {
producerProperties = new Properties();
producerProperties.putAll(props);
}
re... | Create a Java method that does the following: "Sets the producer properties.". |
Of course, here is the Java code you requested:
```java
private String quoteFormatCharacters(String literal)
{
StringBuilder sb = new StringBuilder();
int length = literal.length();
char c;
for (int loop = 0; loop < length; loop++)
{
c = literal.charAt(loop);
switch ... | Create a Java method that does the following: "Quote format characters.". |
Of course, here is the Java code you requested:
```java
public String asString() throws TransformerException {
Properties outputProperties = new Properties();
outputProperties.put(javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION, "yes");
return asString(outputProperties);
}
```
Hope thi... | Create a Java method that does the following: "Returns the XML document as a String.". |
Of course, here is the Java code you requested:
```java
@Service
public void terminateWorkflow(String workflowId, String reason) {
workflowExecutor.terminateWorkflow(workflowId, reason);
}
```
Hope this helps! | Create a Java method that does the following: "Terminate a managed workflow.". |
Of course, here is the Java code you requested:
```java
@Deprecated
public Character set(final int index, final Character ok) {
return set(index, ok.charValue());
}
```
Hope this helps! | Create a Java method that does the following: "Set a character in the array.". |
Of course, here is the Java code you requested:
```java
private Map<String, Link> mapLinks(JsonNode linksObject) {
Map<String, Link> result = new HashMap<>();
Iterator<Map.Entry<String, JsonNode>> linkItr = linksObject.fields();
while (linkItr.hasNext()) {
Map.Entry<String, JsonNode> linkNode = linkItr.next... | Create a Java method that does the following: "Maps the links object to a map of Link objects.". |
Of course, here is the Java code you requested:
```java
@Deprecated
public static Majority majorityWriteConcern(final int wtimeout, final boolean fsync, final boolean j) {
return new Majority(wtimeout, fsync, j);
}
```
Hope this helps! | Create a Java method that does the following: "Create a majority write concern.". |
Of course, here is the Java code you requested:
```java
public CmsGroup readManagerGroup(CmsDbContext dbc, CmsProject project) {
try {
return readGroup(dbc, project.getManagerGroupId());
} catch (CmsException exc) {
// the group does not exist any more - return a dummy-group
... | Create a Java method that does the following: "Reads a group from the manager group.". |
Of course, here is the Java code you requested:
```java
public static void multiplyComplex( InterleavedF32 complexA , InterleavedF32 complexB , InterleavedF32 complexC ) {
InputSanityCheck.checkSameShape(complexA, complexB,complexC);
for( int y = 0; y < complexA.height; y++ ) {
int indexA = complexA.startInd... | Create a Java method that does the following: "Multiplies two complex images.". |
Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Observable<List<T>> buffer(int count) {
return buffer(count, count);
}
```
Hope this helps! | Create a Java method that does the following: "Creates a sequence of tokens from the source.". |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.