code stringlengths 146 69.7k | prompt stringlengths 55 1.5k |
|---|---|
Of course, here is the Java code you requested:
```java
@PluginFactory
public static SpectatorAppender createAppender(
@PluginAttribute("name") String name,
@PluginAttribute("ignoreExceptions") boolean ignoreExceptions,
@PluginElement("Layout") Layout<? extends Serializable> layout,
@PluginEl... | Create a Java method that does the following: "Create a new SpectatorAppender.". |
Of course, here is the Java code you requested:
```java
@PostConstruct
public void loadTagDefinitions()
{
Map<Addon, List<URL>> addonToResourcesMap = scanner.scanForAddonMap(new FileExtensionFilter("tags.xml"));
for (Map.Entry<Addon, List<URL>> entry : addonToResourcesMap.entrySet())
{
... | Create a Java method that does the following: "Load the tag definitions from the tags. xml file.". |
Of course, here is the Java code you requested:
```java
@Override
public List<String> getRunningMasters() {
final ZooKeeperClient client = provider.get("getRunningMasters");
try {
final List<String> masters = client.getChildren(Paths.statusMaster());
final ImmutableList.Builder<String> upMasters ... | Create a Java method that does the following: "Get the list of running masters.". |
Of course, here is the Java code you requested:
```java
protected Response get() {
RequestBuilder getRequest = RequestBuilder.get().setUri(url);
return executeHttpRequest(getRequest);
}
```
Hope this helps! | Create a Java method that does the following: "Get a response from a URL.". |
Of course, here is the Java code you requested:
```java
public void doLog(String clientID, String name, long time, Level level,
Object message, Throwable t) {
if (logOpen && formatter != null) {
sendMessage(syslogMessage.createMessageData(formatter.format(clientID, name, time, level, message, t)));
}
}
```
... | Create a Java method that does the following: "Log a message to the syslog.". |
Of course, here is the Java code you requested:
```java
public Edge getIncomingEdgeWithType(BasicBlock basicBlock, @Type int edgeType) {
return getEdgeWithType(incomingEdgeIterator(basicBlock), edgeType);
}
```
Hope this helps! | Create a Java method that does the following: "Get the incoming edge with the given type.". |
Of course, here is the Java code you requested:
```java
@Override
public ModifyInstancePlacementResult modifyInstancePlacement(ModifyInstancePlacementRequest request) {
request = beforeClientExecution(request);
return executeModifyInstancePlacement(request);
}
```
Hope this helps! | Create a Java method that does the following: "Modify an instance s region.". |
Of course, here is the Java code you requested:
```java
public void suspendFaxJob(FaxJob faxJob)
{
//validate fax job ID
this.invokeFaxJobIDValidation(faxJob);
//invoke action
this.suspendFaxJobImpl(faxJob);
//fire event
this.fireFaxEvent(FaxClientA... | Create a Java method that does the following: "Suspend the fax job.". |
Of course, here is the Java code you requested:
```java
public List<String> getAutoScalingMembers(String autoScalingGroupName) {
Preconditions.checkArgument(autoScalingGroupName != null && !autoScalingGroupName.isEmpty());
AutoScalingGroup autoScalingGroup = this.getAutoScalingGroup(autoScalingGroupNam... | Create a Java method that does the following: "Gets the list of all instances in the specified AutoScalingGroup.". |
Of course, here is the Java code you requested:
```java
protected CollectionMatch getCollectionMatch(List<WebResourceCollection> webResourceCollections, String resourceName, String method) {
CollectionMatch bestMatch = getInitialCollectionMatch();
for (WebResourceCollection webResourceCollection : webR... | Create a Java method that does the following: "Get the best match for a list of web resource collections.". |
Of course, here is the Java code you requested:
```java
public SendMOHFilesResponse sendMOHFiles(File musicFile) throws ApiException {
ApiResponse<SendMOHFilesResponse> resp = sendMOHFilesWithHttpInfo(musicFile);
return resp.getData();
}
```
Hope this helps! | Create a Java method that does the following: "Send MOH files Send MOH files". |
Of course, here is the Java code you requested:
```java
private static Bitmap.CompressFormat getOutputFormat(@Nullable final ImageFormat format) {
if (format == null) {
return Bitmap.CompressFormat.JPEG;
}
if (format == DefaultImageFormats.JPEG) {
return Bitmap.CompressFormat.JPEG;
} else ... | Create a Java method that does the following: "Get the output format.". |
Of course, here is the Java code you requested:
```java
public Project.Calendars.Calendar.WorkWeeks.WorkWeek.WeekDays createProjectCalendarsCalendarWorkWeeksWorkWeekWeekDays()
{
return new Project.Calendars.Calendar.WorkWeeks.WorkWeek.WeekDays();
}
```
Hope this helps! | Create a Java method that does the following: "Create a Project. Calendars. Calendar. WorkWeeks. WorkWeek. WeekDays object.". |
Of course, here is the Java code you requested:
```java
public IntervalCollection<T> withComplement(ChronoInterval<T> timeWindow) {
if (timeWindow.isEmpty()) {
List<ChronoInterval<T>> zero = Collections.emptyList();
return this.create(zero);
}
ChronoInterval<T> window ... | Create a Java method that does the following: "This method is used to create a new IntervalCollection with the complement of this one.". |
Of course, here is the Java code you requested:
```java
public static boolean tryToOptimizeSelector(Selector selector) {
OptimizedSelectedKeysSet selectedKeys = new OptimizedSelectedKeysSet();
try {
SELECTED_KEYS_FIELD.set(selector, selectedKeys);
PUBLIC_SELECTED_KEYS_FIELD.set(selector, selectedKeys);
re... | Create a Java method that does the following: "Try to optimize the selector.". |
Of course, here is the Java code you requested:
```java
public void setImage(BufferedImage im) {
icon.setImage(im);
if (image == null) {
this.image = im;
// this.setSize(image.getWidth(), image.getHeight());
int panelX = image.getWidth();
int panelY = image.getHeight();
panel.setSize(panelX,... | Create a Java method that does the following: "Sets the image of the image that is used to display the image.". |
Of course, here is the Java code you requested:
```java
private byte encodeTargetDiscriminator() {
byte result = 0;
if (Positions.isReadable(targetPosition)) {
result |= 1;
}
if (Positions.isWritable(targetPosition)) {
result |= 2;
}
return result... | Create a Java method that does the following: "Encode the target discriminator.". |
Of course, here is the Java code you requested:
```java
private void addCommandPolling(final CommandImpl command) throws DevFailed {
if (MANAGER == null) {
startCache();
}
removeCommandPolling(command);
final CommandCache cache = new CommandCache(MANAGER, command, deviceName... | Create a Java method that does the following: "Add a command polling". |
Of course, here is the Java code you requested:
```java
public List<GeoPackageMetadata> getAll() {
List<GeoPackageMetadata> allMetadata = new ArrayList<GeoPackageMetadata>();
Cursor cursor = db.query(
GeoPackageMetadata.TABLE_NAME,
GeoPackageMetadata.COLUMNS, null, null... | Create a Java method that does the following: "Get all the GeoPackage metadata". |
Of course, here is the Java code you requested:
```java
public static AsyncInputStream toAsyncInputStream(final ByteBuffer srcByteBuffer) {
notNull("srcByteBuffer", srcByteBuffer);
return new AsyncInputStream() {
@Override
public void read(final ByteBuffer dstByteBuffer, final S... | Create a Java method that does the following: "Creates an AsyncInputStream from a ByteBuffer.". |
Of course, here is the Java code you requested:
```java
public final hqlParser.equalityExpression_return equalityExpression() throws RecognitionException {
hqlParser.equalityExpression_return retval = new hqlParser.equalityExpression_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token isx=n... | Create a Java method that does the following: "Capture the results of equalityExpression on a rule". |
Of course, here is the Java code you requested:
```java
public List<URI> getCouchbaseBucketURIs() {
if(!isCouchbaseBucketConfig())
throw new IllegalStateException("This is not a couchbase bucket configuration.");
final List<URI> result = new ArrayList<URI>(_address2Ids.size());
fina... | Create a Java method that does the following: "Gets the couchbase bucket URIs.". |
Of course, here is the Java code you requested:
```java
@Override
public int indexOf(Object elem) {
if (elem == null) return -1;
if (elem instanceof Number) return indexOf(((Number)elem).intValue());
return -1;
}
```
Hope this helps! | Create a Java method that does the following: "Returns the index of the specified element in this list.". |
Of course, here is the Java code you requested:
```java
public List getFailureReason() {
List fr = (List)jmo.getField(TrmFirstContactAccess.BODY_CLIENTATTACHREPLY_FAILUREREASON);
if (fr != null) {
return new ArrayList(fr);
} else {
return null;
}
}
```
Hope this helps! | Create a Java method that does the following: "Gets the getFailureReason field.". |
Of course, here is the Java code you requested:
```java
@Override
public void handleOperation(Exchange exchange, KnowledgeOperation operation) throws HandlerException {
// Long sessionIdentifier = null;
Message inputMessage = exchange.getMessage();
ExchangePattern exchangePattern = exchange... | Create a Java method that does the following: "Handle the KnowledgeOperation.". |
Of course, here is the Java code you requested:
```java
public void toXml(File xmlFile, boolean prettyPrint) throws TransformerException, IOException {
if (this.isTextWrittenAsCDATA()) {
XmlUtils.replaceTextWithCData(this.getDocument());
}
prepareDocumentBeforeWritingToXml(this.getD... | Create a Java method that does the following: "Write the XML document to the given file.". |
Of course, here is the Java code you requested:
```java
public SampleFormat[] getSupportedSampleFormats() {
IntPointer sampleFormatsPointer = avCodec.sample_fmts();
if (getType() != MediaType.AUDIO || sampleFormatsPointer == null)
return null;
List<SampleFormat> sampleFormats = new ArrayList<SampleFormat>()... | Create a Java method that does the following: "Returns an array of supported sample formats for this media type.". |
Of course, here is the Java code you requested:
```java
@Override
public TransportResult doDelete(URI uri) {
HttpDelete request = new HttpDelete(uri);
request.setHeader(apiAuthHeaderKey, getApitraryApi().getApiKey());
request.setHeader("Content-Type", contentType);
request.setHeader("Accept", contentType);
... | Create a Java method that does the following: "Override this method to perform a DELETE request.". |
Of course, here is the Java code you requested:
```java
public T attr(String name, String value) throws IOException {
if (value != null) {
writer.write(' ');
writer.write(name);
writer.write("=\"");
writer.write(value);
writer.write('\"');
}
return (T) this;
}
```
Hope this helps! | Create a Java method that does the following: "Write an attribute of the entity.". |
Of course, here is the Java code you requested:
```java
@BetaApi
public final BackendServiceGroupHealth getHealthRegionBackendService(
String backendService, ResourceGroupReference resourceGroupReferenceResource) {
GetHealthRegionBackendServiceHttpRequest request =
GetHealthRegionBackendServiceHtt... | Create a Java method that does the following: "Get the BackendServiceGroupHealth for the BackendService resource.". |
Of course, here is the Java code you requested:
```java
private static List<Match> findMatches(GrayF32 image, GrayF32 template, GrayF32 mask,
int expectedMatches) {
// create template matcher.
TemplateMatching<GrayF32> matcher =
FactoryTemplateMatching.createMatcher(TemplateScoreType.SUM_DIFF_SQ, ... | Create a Java method that does the following: "Find matches in the image using the best template". |
Of course, here is the Java code you requested:
```java
public static synchronized UnsupportedDurationField getInstance(DurationFieldType type) {
UnsupportedDurationField field;
if (cCache == null) {
cCache = new HashMap<DurationFieldType, UnsupportedDurationField>(7);
field = n... | Create a Java method that does the following: "Gets the UnsupportedDurationField instance.". |
Of course, here is the Java code you requested:
```java
public static <K, V> V getIfAbsentDefault(Map<K, V> map, K key, V defaultValue)
{
V result = map.get(key);
if (MapIterate.isAbsent(result, map, key))
{
result = defaultValue;
}
return result;
}
```
Hope... | Create a Java method that does the following: "Gets the value of the entry in the map or returns the default value if the entry is absent.". |
Of course, here is the Java code you requested:
```java
@Override
public GetActiveNamesResult getActiveNames(GetActiveNamesRequest request) {
request = beforeClientExecution(request);
return executeGetActiveNames(request);
}
```
Hope this helps! | Create a Java method that does the following: "Returns the names of the active SECS.". |
Of course, here is the Java code you requested:
```java
public String getNewToken() throws FoxHttpException, MalformedURLException {
FoxHttpRequest request = this.generateRequestForGrantType(this.getOAuth2Store().getGrantType());
this.getOAuth2RequestExecutor().executeOAuth2Request(request, this);
... | Create a Java method that does the following: "Get a new token for the current user.". |
Of course, here is the Java code you requested:
```java
protected void runWildCardCmd(AlluxioURI wildCardPath, CommandLine cl) throws IOException {
List<AlluxioURI> paths = FileSystemShellUtils.getAlluxioURIs(mFileSystem, wildCardPath);
if (paths.size() == 0) { // A unified sanity check on the paths
thro... | Create a Java method that does the following: "Run a single wild card command.". |
Of course, here is the Java code you requested:
```java
private void fifoWeightAdjust(Pool pool) {
List<JobInProgress> jobs = new ArrayList<JobInProgress>();
jobs.addAll(pool.getJobs());
Collections.sort(jobs, fifoComparator);
double factor = 1.0;
for (JobInProgress job : jobs) {
JobInfo info... | Create a Java method that does the following: "Adjust the weight of the jobs in the pool to the weight of the fifo jobs.". |
Of course, here is the Java code you requested:
```java
public boolean setData(String path, String value, boolean createNodes)
throws ZooKeeperException {
return _write(path, value != null ? value.getBytes(UTF8) : null, createNodes);
}
```
Hope this helps! | Create a Java method that does the following: "Write a data node to the node.". |
Of course, here is the Java code you requested:
```java
@Override
void animateValue(float fraction) {
super.animateValue(fraction);
int numValues = mValues.length;
for (int i = 0; i < numValues; ++i) {
mValues[i].setAnimatedValue(mTarget);
}
}
```
Hope this helps! | Create a Java method that does the following: "Override this method to animate the value of the calendar.". |
Of course, here is the Java code you requested:
```java
@Override
public void resetLearningImpl()
{
this.nbhdSize = this.neighbourhoodSizeOption.getValue();
//this.k = this.kOption.getValue(); //NOT IMPLEMENTED//
//this.m = this.mOption.getValue(); //NOT IMPLEMENTED//
this.tau = this.thresholdOption.getVa... | Create a Java method that does the following: "Reset the learning.". |
Of course, here is the Java code you requested:
```java
public synchronized void emptyObjectStore() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "emptyObjectStore");
for (int i = 0; i < objectTable.length; i++) {
objectTable[i] = null... | Create a Java method that does the following: "This method is called by the application to clear out the object store.". |
Of course, here is the Java code you requested:
```java
public static BufferedImage generate(String content, QrConfig config) {
return generate(content, BarcodeFormat.QR_CODE, config);
}
```
Hope this helps! | Create a Java method that does the following: "Generates a PNG image from a String of content.". |
Of course, here is the Java code you requested:
```java
public UploadResult upload(final String accountId, final String vaultName,
final String archiveDescription, final File file,
ProgressListener progressListener) throws AmazonServiceException,
AmazonClientException {
if (... | Create a Java method that does the following: "Uploads a file to Amazon S3 in the specified vault.". |
Of course, here is the Java code you requested:
```java
public void doRecovery(){
try {
boolean toRestart = Boolean.getBoolean("cloudslang.worker.restart.on.recovery");
//If we are configured to restart on recovery - do shutdown
if(toRestart){
logger.warn("Wo... | Create a Java method that does the following: "This method is called by the worker recovery thread.". |
Of course, here is the Java code you requested:
```java
public OmdbBuilder setTypeSeries() {
if (!ResultType.isDefault(ResultType.SERIES)) {
params.add(Param.RESULT, ResultType.SERIES);
}
return this;
}
```
Hope this helps! | Create a Java method that does the following: "Sets the type series.". |
Of course, here is the Java code you requested:
```java
public java.util.List<String> getVpnConnectionIds() {
if (vpnConnectionIds == null) {
vpnConnectionIds = new com.amazonaws.internal.SdkInternalList<String>();
}
return vpnConnectionIds;
}
```
Hope this helps! | Create a Java method that does the following: "Gets the value of the vpnConnectionIds property.". |
Of course, here is the Java code you requested:
```java
@Override
public String get(String path) throws IOException {
HttpGet getMethod = new HttpGet(UrlUtils.toJsonApiUri(uri, context, path));
HttpResponse response = client.execute(getMethod, localContext);
jenkinsVersion = ResponseUtils.g... | Create a Java method that does the following: "Gets a single resource from the NCSA.". |
Of course, here is the Java code you requested:
```java
@AnyThread
protected void safeEndSession ()
{
if (!_omgr.isRunning()) {
log.info("Dropping end session request as we're shutting down " + this + ".");
} else {
_omgr.postRunnable(new Runnable() {
pub... | Create a Java method that does the following: "End the session.". |
Of course, here is the Java code you requested:
```java
public static int getStoreReg(DismantleBytecode dbc, int seen) {
if ((seen == Const.ASTORE) || (seen == Const.ISTORE) || (seen == Const.LSTORE) || (seen == Const.FSTORE) || (seen == Const.DSTORE)) {
return dbc.getRegisterOperand();
}
... | Create a Java method that does the following: "returns the register number of the store". |
Of course, here is the Java code you requested:
```java
public void perform(TaskRequest req, TaskResponse res) {
final String poolAttributeName = (String) this.attributeNamePhrase.evaluate(req, res);
final boolean useExisting = Boolean.valueOf((String) this.useExistingPhrase.evaluate(req, res));
... | Create a Java method that does the following: "Perform the task.". |
Of course, here is the Java code you requested:
```java
@Override protected void init() {
super.init();
assert 0 <= ntrees && ntrees < 1000000; // Sanity check
// Not enough rows to run
if (source.numRows() - response.naCnt() <=0)
throw new IllegalArgumentException("Dataset contains too many NAs... | Create a Java method that does the following: "Initialize the CRS". |
Of course, here is the Java code you requested:
```java
public void marshall(IpFilter ipFilter, ProtocolMarshaller protocolMarshaller) {
if (ipFilter == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshal... | Create a Java method that does the following: "marshalls the given IPFilter to the given protocolMarshaller.". |
Of course, here is the Java code you requested:
```java
static void checkMergePolicy(SplitBrainMergeTypeProvider mergeTypeProvider,
SplitBrainMergePolicyProvider mergePolicyProvider, String mergePolicyClassName) {
SplitBrainMergePolicy mergePolicy = getMergePolicyInstance(merge... | Create a Java method that does the following: "Check if the merge policy is valid.". |
Of course, here is the Java code you requested:
```java
public static <I extends ImageGray<I>, D extends ImageGray<D>>
DetectLineSegmentsGridRansac<I,D> lineRansac(int regionSize ,
double thresholdEdge ,
double thresholdAngle ,
boolean connectLines,
Class<I> imageTy... | Create a Java method that does the following: "Creates a grid detector which detects lines inside the image using a grid detector.". |
Of course, here is the Java code you requested:
```java
private ChannelHandler channelInitFix(final ChannelHandler handler)
{
ChannelHandler fixedHandler=new ShareableChannelInboundHandler() {
@Override
public void channelRegistered(ChannelHandlerContext ctx) throws Exception {
Channel ch=ctx.channel();
... | Create a Java method that does the following: "channelInitFix is a helper method to fix the channel registration of a channel handler.". |
Of course, here is the Java code you requested:
```java
public int process() {
// Calculate the result of the left operation if any
if (leftOperation != null) {
leftOperand = leftOperation.process();
}
// Calculate the result of the right operation if any
if (rightOperation != null) {
rightOperand = r... | Create a Java method that does the following: "Process the operation.". |
Of course, here is the Java code you requested:
```java
void rotate(Collection<AtomPair> pairs) {
// bond has already been tried in this phase so
// don't need to test again
Set<IBond> tried = new HashSet<>();
Pair:
for (AtomPair pair : pairs) {
for (IBond bond : p... | Create a Java method that does the following: "Rotate the list of AtomPairs.". |
Of course, here is the Java code you requested:
```java
public static FilterAdapter buildAdapter() {
FilterAdapter adapter = new FilterAdapter();
adapter.addFilterAdapter(
ColumnPrefixFilter.class, new ColumnPrefixFilterAdapter());
adapter.addFilterAdapter(
ColumnRangeFilter.class, new Colu... | Create a Java method that does the following: "Build the FilterAdapter.". |
Of course, here is the Java code you requested:
```java
@Override
public void processMessage(WebSocketMessage webSocketData) throws FrameworkException {
setDoTransactionNotifications(true);
final String mode = webSocketData.getNodeDataStringValue("mode"); // default: list start | pause |... | Create a Java method that does the following: "Process a single message from the server.". |
Of course, here is the Java code you requested:
```java
@Nullable
public IPasswordHashCreator getPasswordHashCreatorOfAlgorithm (@Nullable final String sAlgorithmName)
{
return m_aRWLock.readLocked ( () -> m_aPasswordHashCreators.get (sAlgorithmName));
}
```
Hope this helps! | Create a Java method that does the following: "Get the password hash creator of the passed algorithm name.". |
Of course, here is the Java code you requested:
```java
@Nullable
public <T, K extends T> Class<K> getScopedAlias(Class scope, Class<T> abstractClass) {
//noinspection unchecked
return aliases.getScope(scope).get(abstractClass);
}
```
Hope this helps! | Create a Java method that does the following: "Get the scoped alias for the given abstract class.". |
Of course, here is the Java code you requested:
```java
public InputStream responseAsInputStream() throws IOException {
if (connection == null) {
throw new IOException("Attempted to read response from server before calling execute" +
"()");
}
InputStream is = con... | Create a Java method that does the following: "Returns the response as an input stream.". |
Of course, here is the Java code you requested:
```java
public Table rightOuter(Table table2, String col2Name) {
return rightOuter(table2, false, col2Name);
}
```
Hope this helps! | Create a Java method that does the following: "Get the table right outer of this table and the column2 name.". |
Of course, here is the Java code you requested:
```java
@Trivial
protected void setSslSupport(ServiceReference<ChannelFactoryProvider> ref) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.entry(this, tc, "setSslSupport", new Object[] { ref.getProperty("type"), ref });
... | Create a Java method that does the following: "Set the ssl support for this channel factory provider.". |
Of course, here is the Java code you requested:
```java
private void buttonZoomOutXActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonZoomOutXActionPerformed
graphCanvas.scaleXResolution(true);
graphCanvas.updateCanvas(true);
}
```
Hope this helps! | Create a Java method that does the following: "The button zoom out XActionPerformed method.". |
Of course, here is the Java code you requested:
```java
public static UnicodeSet getExemplarSet(ULocale locale, int options) {
return LocaleData.getInstance(locale).getExemplarSet(options, ES_STANDARD);
}
```
Hope this helps! | Create a Java method that does the following: "Get the exemplar set for the given locale.". |
Of course, here is the Java code you requested:
```java
public void marshall(ServiceStatistics serviceStatistics, ProtocolMarshaller protocolMarshaller) {
if (serviceStatistics == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
... | Create a Java method that does the following: "marshalls the given ServiceStatistics to the given protocolMarshaller.". |
Of course, here is the Java code you requested:
```java
public static BufferedImage toBufferedImage(Image image, String imageType) {
BufferedImage bufferedImage;
if (false == imageType.equalsIgnoreCase(IMAGE_TYPE_PNG)) {
// 当目标为非PNG类图片时,源图片统一转换为RGB格式
if (image instanceof BufferedImage) {
bufferedIma... | Create a Java method that does the following: "Returns a buffered image of the specified type.". |
Of course, here is the Java code you requested:
```java
public void copyPush(Obj source, Obj target) {
Iterator<Entry<String,Object>> itr = source.iterator();
while (itr.hasNext()) {
Entry<String,Object> e = itr.next();
putPush(target, e.getKey(), e.getValue());
}
}
```
Hope this helps! | Create a Java method that does the following: "Copy the source object to the target object.". |
Of course, here is the Java code you requested:
```java
public EtcdKeyPutRequest refresh(String key, Integer ttl) {
return new EtcdKeyPutRequest(client, key, retryHandler).refresh(ttl);
}
```
Hope this helps! | Create a Java method that does the following: "Refreshes a key in etcd.". |
Of course, here is the Java code you requested:
```java
@Override
public void completing(DelegateExecution execution, DelegateExecution subProcessInstance) throws Exception {
if (activityBehaviorInstance == null) {
activityBehaviorInstance = getActivityBehaviorInstance();
}
if (activityBehaviorIns... | Create a Java method that does the following: "Override the completing method.". |
Of course, here is the Java code you requested:
```java
@Override
protected void clearCache() {
if (lastX != null) lastX[0] = Double.NaN;
if (lastXBatch != null) lastXBatch[0] = Double.NaN;
if (lastVBatch != null) lastVBatch[0] = Double.NaN;
}
```
Hope this helps! | Create a Java method that does the following: "Clear the cache of the NAs.". |
Of course, here is the Java code you requested:
```java
protected static Map<Address,Collection<Address>> determineMergeCoords(Map<Address,View> views) {
Map<Address,Collection<Address>> retval=new HashMap<>();
for(View view: views.values()) {
Address coord=view.getCreator();
... | Create a Java method that does the following: "Determine the merge coordinations for the views". |
Of course, here is the Java code you requested:
```java
public void setAttribute(String name, String value)
{
Params.notNullOrEmpty(name, "Attribute name");
Params.notEmpty(value, "Attribute value");
if(value != null) {
attributes.put(name, value);
}
else {
attributes.remove(n... | Create a Java method that does the following: "Sets the value of an Attribute.". |
Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "", name = "maxWindSpeed", scope = LocationType.class)
public JAXBElement<Windspeed> createLocationTypeMaxWindSpeed(Windspeed value) {
return new JAXBElement<Windspeed>(_LocationTypeMaxWindSpeed_QNAME, Windspeed.class, Loca... | Create a Java method that does the following: "Create an instance of a Windspeed value.". |
Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Completable doOnTerminate(final Action onTerminate) {
return doOnLifecycle(Functions.emptyConsumer(), Functions.emptyConsumer(),
Functions.EMPTY_ACTION, onTerm... | Create a Java method that does the following: "Performs a onTerminate operation on the service.". |
Of course, here is the Java code you requested:
```java
public void addTangoQualityChangeListener(ITangoQualityChangeListener listener, String attrName, String[] filters, boolean stateless)
throws DevFailed {
TangoQualityChange tangoQualityChange;
String key = deviceName+"/"+attrName;
... | Create a Java method that does the following: "Add a TangoQualityChangeListener to the TangoQualityChange object.". |
Of course, here is the Java code you requested:
```java
public void setMetricRegistry(Object metricRegistry)
{
if (metricRegistry != null && safeIsAssignableFrom(metricRegistry, "com.codahale.metrics.MetricRegistry")) {
setMetricsTrackerFactory(new CodahaleMetricsTrackerFactory((MetricRegistry) metri... | Create a Java method that does the following: "setMetricRegistry This method sets the metric registry.". |
Of course, here is the Java code you requested:
```java
@Override
public CreateGeoMatchSetResult createGeoMatchSet(CreateGeoMatchSetRequest request) {
request = beforeClientExecution(request);
return executeCreateGeoMatchSet(request);
}
```
Hope this helps! | Create a Java method that does the following: "Creates a GeoMatchSet.". |
Of course, here is the Java code you requested:
```java
@Override
public void onTimeout()
{
try {
//request().sendError(WebRequest.INTERNAL_SERVER_ERROR);
if (true) throw new UnsupportedOperationException();
} catch (Exception e) {
log.log(Level.FINEST, e.toString(), e);
}
cl... | Create a Java method that does the following: "Called by the server after a timeout.". |
Of course, here is the Java code you requested:
```java
public static List<MemoryMonitor> getMemoryStats(){
ArrayList<MemoryMonitor> memoryPoolInformation = new ArrayList<>();
MemoryUsage heapMem = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
memoryPoolInformation.add(new MemoryMon... | Create a Java method that does the following: "Gets the memory stats.". |
Of course, here is the Java code you requested:
```java
public byte[] sendUnbind(OutputStream os, int sequenceNumber)
throws IOException {
synchronized (os) {
return pduSender.sendUnbind(os, sequenceNumber);
}
}
```
Hope this helps! | Create a Java method that does the following: "Unbind the sequence number.". |
Of course, here is the Java code you requested:
```java
public Map<String, String> querycontractBuild() {
Map<String, String> map = new HashMap<String, String>();
map.put("appid", getAppId());
map.put("mch_id", getMchId());
if (StrKit.notBlank(getPlanId())) {
map.put("plan_id", getPlanId());
map.put("c... | Create a Java method that does the following: "Query the payment contract map". |
Of course, here is the Java code you requested:
```java
@Override
public GetServiceLastAccessedDetailsWithEntitiesResult getServiceLastAccessedDetailsWithEntities(GetServiceLastAccessedDetailsWithEntitiesRequest request) {
request = beforeClientExecution(request);
return executeGetServiceLastAccess... | Create a Java method that does the following: "Retrieves the last accessed details of entities that are associated with a service.". |
Of course, here is the Java code you requested:
```java
static public ArrayDouble.D2 makeEdges(ArrayDouble.D2 midpoints) {
int[] shape = midpoints.getShape();
int ny = shape[0];
int nx = shape[1];
ArrayDouble.D2 edge = new ArrayDouble.D2(ny + 1, nx + 1);
for (int y = 0; y < ny - 1; y++) {
... | Create a Java method that does the following: "Make the edges of the midpoints array.". |
Of course, here is the Java code you requested:
```java
public void setInHeader(boolean inHeader) {
super.setInHeader(inHeader);
for(int i = 0; i < this.chunks.size(); i++) {
((RtfBasicElement) this.chunks.get(i)).setInHeader(inHeader);
}
}
```
Hope this helps! | Create a Java method that does the following: "Sets the inHeader attribute of the BaseRtfFile.". |
Of course, here is the Java code you requested:
```java
public URIBuilder setPath(final String path) {
this.path = path;
this.encodedSchemeSpecificPart = null;
this.encodedPath = null;
return this;
}
```
Hope this helps! | Create a Java method that does the following: "Sets the path.". |
Of course, here is the Java code you requested:
```java
@Override
public CPOptionCategory findByUuid_C_First(String uuid, long companyId,
OrderByComparator<CPOptionCategory> orderByComparator)
throws NoSuchCPOptionCategoryException {
CPOptionCategory cpOptionCategory = fetchByUuid_C_First(uuid,
companyId, o... | Create a Java method that does the following: "Returns the cp option category with the matching uuid and company.". |
Of course, here is the Java code you requested:
```java
private void writeObject(ObjectOutputStream outStream) throws IOException {
if (classLoaderToPropagate == SYSTEM_CLASS_LOADER)
classLoaderIdentifier = "";
else if (classLoaderToPropagate != null) {
classLoaderIdentifier = c... | Create a Java method that does the following: "Write the object to the specified output stream.". |
Of course, here is the Java code you requested:
```java
public void setVariables(final Map<String,Object> variables) {
if (variables == null) {
return;
}
this.variables.putAll(variables);
}
```
Hope this helps! | Create a Java method that does the following: "Sets the variables.". |
Of course, here is the Java code you requested:
```java
static String unescape(final String text) {
if (text == null) {
return null;
}
// Unescape will always cover the full HTML5 spectrum.
final HtmlEscapeSymbols symbols = HtmlEscapeSymbols.HTML5_SYMBOLS;
StringBu... | Create a Java method that does the following: "Unescape the text.". |
Of course, here is the Java code you requested:
```java
public Date getTimeAfter(Date afterTime) {
// Computation is based on Gregorian year only.
Calendar cl = new java.util.GregorianCalendar(getTimeZone());
// move ahead one second, since we're computing the time *after* the
// giv... | Create a Java method that does the following: "Gets the time after the specified time.". |
Of course, here is the Java code you requested:
```java
public void decode(AsnInputStream ais) throws ParseException {
try {
tag = ais.getTag();
primitive = ais.isTagPrimitive();
tagClass = ais.getTagClass();
data = ais.readSequence();
this.encodingLe... | Create a Java method that does the following: "Decode the parameter from an ASN. 1 Asn stream.". |
Of course, here is the Java code you requested:
```java
private RegistryEntry getRegistryEntryForChildFirstConfig(final RegistryEntry parentEntry, String childNodeName) {
if (parentEntry == null)
return null;
//This will work in the unlikely event that childNodeName is actually the xml elem... | Create a Java method that does the following: "Get the RegistryEntry for the first child config.". |
Of course, here is the Java code you requested:
```java
public Object opt(String key) {
return key == null ? null : this.map.get(key);
}
```
Hope this helps! | Create a Java method that does the following: "Get the value associated with the key.". |
Of course, here is the Java code you requested:
```java
public void handleNavigation(FacesContext context,
String fromAction,
String outcome,
String toFlowDocumentId) {
this.handleNavigation(context, fromAction, outcome);
}
```
Hope this helps! | Create a Java method that does the following: "This method is called by the NavigationHandler to handle the navigation of a page.". |
Of course, here is the Java code you requested:
```java
static int gcd(int a, int b) {
while (a != b) {
if (a > b) {
int na = a % b;
if (na == 0) return b;
a = na;
} else {
int nb = b % a;
if (nb == 0) return a;
b = nb;
}
}
return a;
}
```
Hope this helps! | Create a Java method that does the following: "Compute the greatest common divisor of two integers.". |
Of course, here is the Java code you requested:
```java
public Assignments cluster(Matrix matrix,
int maxClusters,
boolean useKMeans) {
// Cluster the matrix recursively.
LimitedResult[] results = limitedCluster(
scaleMatri... | Create a Java method that does the following: "Cluster the matrix recursively.". |
Of course, here is the Java code you requested:
```java
@Nullable
protected GoogleCloudStorageItemInfo getInitialMetadata() throws IOException {
if (!readOptions.getFastFailOnNotFound()) {
return null;
}
StorageObject object;
try {
object =
ResilientOperation.retry(
... | Create a Java method that does the following: "Get the initial metadata.". |
Of course, here is the Java code you requested:
```java
public static int convertToInt(final Set<PosixFilePermission> aPermSet) {
int result = 0;
if (aPermSet.contains(PosixFilePermission.OWNER_READ)) {
result = result | 0400;
}
if (aPermSet.contains(PosixFilePermission.OW... | Create a Java method that does the following: "Convert a Set of Permissions to an int.". |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.