code stringlengths 146 69.7k | prompt stringlengths 55 1.5k |
|---|---|
Of course, here is the Java code you requested:
```java
public boolean isStarving(long now) {
double starvingShare = getShare() * shareStarvingRatio;
if (getGranted() >= Math.ceil(starvingShare)) {
lastTimeAboveStarvingShare = now;
}
if (getGranted() >= Math.min(getShare(), getMinimum())) {
... | Create a Java method that does the following: "Check if the pool is starving.". |
Of course, here is the Java code you requested:
```java
public static base_responses delete(nitro_service client, nsip6 resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
nsip6 deleteresources[] = new nsip6[resources.length];
for (int i=0;i<resource... | Create a Java method that does the following: "Use this API to delete nsip6 resources.". |
Of course, here is the Java code you requested:
```java
protected void onSelectedItemsChanged() {
final Collection<ItemT> selectedItems = getSelectedItems();
if (selectedItems.isEmpty()) {
anchorLabel();
getInputWidget().setText("");
} else {
getInputWidget()... | Create a Java method that does the following: "On selected items changed display the label and text.". |
Of course, here is the Java code you requested:
```java
public void setRootNode(TreeElement rootNode)
{
_rootNode = rootNode;
if (rootNode.getName() == null) {
rootNode.setName("0");
}
}
```
Hope this helps! | Create a Java method that does the following: "Sets the root node of the xsd.". |
Of course, here is the Java code you requested:
```java
public static boolean isEmulator(){
return "google_sdk".equals(Build.PRODUCT) ||
Build.PRODUCT.contains("sdk_google_phone") ||
"sdk".equals(Build.PRODUCT) ||
"sdk_x86".equals(Build.PRODUCT) ||
... | Create a Java method that does the following: "Checks if the build is an emulator". |
Of course, here is the Java code you requested:
```java
public int determinePort() {
if (CollectionUtils.isEmpty(this.parsedAddresses)) {
return getPort();
}
Address address = this.parsedAddresses.get(0);
return address.port;
}
```
Hope this helps! | Create a Java method that does the following: "Determine the port number from the address.". |
Of course, here is the Java code you requested:
```java
@Override
public void serviceRequest(final Request request) {
key = request.getParameter(WServlet.DATA_LIST_PARAM_NAME);
if (key == null) {
super.serviceRequest(request);
}
}
```
Hope this helps! | Create a Java method that does the following: "Override serviceRequest to get the key from the request.". |
Of course, here is the Java code you requested:
```java
public String getErrorMessage(IOException e) {
// Prefer to use message from GJRE.
GoogleJsonResponseException gjre = getJsonResponseExceptionOrNull(e);
if (gjre != null && gjre.getDetails() != null) {
return gjre.getDetails().getMessage();
... | Create a Java method that does the following: "Get the error message from an IOException". |
Of course, here is the Java code you requested:
```java
static void cleanUpWorkingDir(final Logger logger,
final File userDir,
final SVNURL svnUrl,
final SVNClientManager userClientManager) throws SVNException, IOExce... | Create a Java method that does the following: "Clean up the working directory.". |
Of course, here is the Java code you requested:
```java
public static String getStandardHeaderValue(final HttpURLConnection conn, final String headerName) {
final String headerValue = conn.getRequestProperty(headerName);
// Coalesce null value
return headerValue == null ? Constants.EMPTY_STRIN... | Create a Java method that does the following: "Get the standard header value for a given header name.". |
Of course, here is the Java code you requested:
```java
protected StringBuffer translatedReplacements (String key, StringBuffer buf)
{
MessageBundle bundle = _ctx.getMessageManager().getBundle(_bundle);
if (!bundle.exists(key)) {
return buf;
}
StringTokenizer st = new St... | Create a Java method that does the following: "This method is called to translate the translated strings in the message bundle to the original strings.". |
Of course, here is the Java code you requested:
```java
public static void removeTemplate(RestClient client, String template) throws Exception {
logger.trace("removeTemplate({})", template);
client.performRequest(new Request("DELETE", "/_template/" + template));
logger.trace("/removeTemplate({})", template);
}
... | Create a Java method that does the following: "Remove a template from the server.". |
Of course, here is the Java code you requested:
```java
public static String postResponseAsString(URI uri, Header header,
HttpEntity httpEntity) {
return postResponseAsString(uri.toString(), header, httpEntity);
}
```
Hope this helps! | Create a Java method that does the following: "Post response as string.". |
Of course, here is the Java code you requested:
```java
public static <T> void loadCollection(File file, Class<T> itemClass, Collection<T> collection) throws NoSuchMethodException, InstantiationException, IllegalAccessException,
InvocationTargetException, IOException {
Constructor<T> itemConstructor = item... | Create a Java method that does the following: "Load a Collection of objects from a file.". |
Of course, here is the Java code you requested:
```java
public static MutableRoaringBitmap naive_and(@SuppressWarnings("rawtypes") Iterator bitmaps) {
if (!bitmaps.hasNext()) {
return new MutableRoaringBitmap();
}
MutableRoaringBitmap answer =
((ImmutableRoaringBitmap) bitmaps.next()).toMutab... | Create a Java method that does the following: "A naive and operation.". |
Of course, here is the Java code you requested:
```java
public Matrix3f scale(float x, float y, float z, Matrix3f dest) {
// scale matrix elements:
// m00 = x, m11 = y, m22 = z
// all others = 0
dest.m00 = m00 * x;
dest.m01 = m01 * x;
dest.m02 = m02 * x;
dest.m10... | Create a Java method that does the following: "Scales the matrix elements of this matrix by x y and z.". |
Of course, here is the Java code you requested:
```java
public Map<ResourceType, List<RepositoryResource>> queryAssets(String searchStr, AssetType type) throws InstallException {
Map<ResourceType, List<RepositoryResource>> results = new HashMap<ResourceType, List<RepositoryResource>>();
List<Repository... | Create a Java method that does the following: "Query assets from the repository.". |
Of course, here is the Java code you requested:
```java
public static TorrentMetadata create(File source, URI announce, String createdBy)
throws InterruptedException, IOException {
return create(source, null, announce, createdBy);
}
```
Hope this helps! | Create a Java method that does the following: "Create a TorrentMetadata from a file with a torrent metadata.". |
Of course, here is the Java code you requested:
```java
public static List<RedisClusterNode> sortByLatency(Iterable<RedisClusterNode> clusterNodes) {
List<RedisClusterNode> ordered = LettuceLists.newList(clusterNodes);
ordered.sort(LatencyComparator.INSTANCE);
return ordered;
}
```
Hope t... | Create a Java method that does the following: "Sort by latency.". |
Of course, here is the Java code you requested:
```java
public StyleRow getStyle(long featureId, GeometryType geometryType) {
StyleRow styleRow = featureStyleExtension.getStyle(tableName,
featureId, geometryType, false);
if (styleRow == null) {
// Table Style
... | Create a Java method that does the following: "Get the style for the featureId and geometryType". |
Of course, here is the Java code you requested:
```java
public static String prettyType(int degree, Type t) {
StringBuilder b = new StringBuilder();
for (int i = degree; i > 0; i--) {
b.append("set<");
}
b.append(t.toString().toLowerCase());
for (int i = 0; i < degre... | Create a Java method that does the following: "Pretty type.". |
Of course, here is the Java code you requested:
```java
private void internalInsert(char character, int c, int r)
{
maxColumn = (c > maxColumn) ? c : maxColumn;
maxRow = (r > maxRow) ? r : maxRow;
data.put((long) c, (long) r, character);
}
```
Hope this helps! | Create a Java method that does the following: "Internal insert method.". |
Of course, here is the Java code you requested:
```java
private URL getStaticFileFromAssetsDir(String fileName) {
URL url = null;
if (ninjaProperties.isDev()
// Testing that the file exists is important because
// on some dev environments we do not get the correct ass... | Create a Java method that does the following: "Get static file from assets dir". |
Of course, here is the Java code you requested:
```java
@Override
public <R> R transact(final ObjectifyImpl parent, final Work<R> work) {
return work.run();
}
```
Hope this helps! | Create a Java method that does the following: "Transact to a single object.". |
Of course, here is the Java code you requested:
```java
@Override
public Date getDateCellValue() {
if(getCellType() == CellType.STRING){
throw new IllegalStateException("Cell type cannot be CELL_TYPE_STRING");
}
return rawContents == null ? null : HSSFDateUtil.getJavaDate(getNumericCellValue(), use... | Create a Java method that does the following: "Get the value of the cell as a Date". |
Of course, here is the Java code you requested:
```java
static boolean isGreaterThanOrEqualToDuration(Unit unit,
long position1, long position2, int duration) {
return unit.addToPosition(position1, duration + 1) - 1 >= position2;
}
```
Hope this helps! | Create a Java method that does the following: "Checks if a sequence of tokens is greater than or equal to a given duration.". |
Of course, here is the Java code you requested:
```java
public void billingAccount_conference_serviceName_settings_PUT(String billingAccount, String serviceName, OvhConferenceProperties body) throws IOException {
String qPath = "/telephony/{billingAccount}/conference/{serviceName}/settings";
StringBuilder sb = pat... | Create a Java method that does the following: "Update the settings of a conference". |
Of course, here is the Java code you requested:
```java
protected String formatHTTPURLParameters(HTTPFaxClientSpi faxClientSpi,FaxJob faxJob)
{
//get URL parameters
String urlParametersTemplate=faxClientSpi.getHTTPURLParameters();
//format URL parameters
String urlParameter... | Create a Java method that does the following: "This function formats the HTTP URL parameters in the URL.". |
Of course, here is the Java code you requested:
```java
public static <T> Collector<T, ?, Optional<T>> mode() {
return mode0(seq -> seq.maxBy(t -> t.v2).map(t -> t.v1));
}
```
Hope this helps! | Create a Java method that does the following: "mode of the sequence". |
Of course, here is the Java code you requested:
```java
public static String regexpReplace(String str, String regex, String replacement) {
if (regex.isEmpty()) {
return str;
}
try {
// we should use StringBuffer here because Matcher only accept it
StringBuffer sb = new StringBuffer();
Matcher m = REG... | Create a Java method that does the following: "Replace the string with the given regular expression with the given replacement.". |
Of course, here is the Java code you requested:
```java
@Nullable
public synchronized List<ProducerContextCallbacks> setIsPrefetchNoCallbacks(boolean isPrefetch) {
if (isPrefetch == mIsPrefetch) {
return null;
}
mIsPrefetch = isPrefetch;
return new ArrayList<>(mCallbacks);
}
```
Hope this he... | Create a Java method that does the following: "Sets the isPrefetch flag.". |
Of course, here is the Java code you requested:
```java
public static String[] getBeanInfoSearchPath() {
String[] path = new String[searchPath.length];
System.arraycopy(searchPath, 0, path, 0, searchPath.length);
return path;
}
```
Hope this helps! | Create a Java method that does the following: "Get the search path for the bean info.". |
Of course, here is the Java code you requested:
```java
public static Object getElementFromCollection(Collection<Object> collection, int index) {
if (collection.size() < index + 1)
return null;
if (collection instanceof List)
return ((List<Object>) collection).get(index);
Iterator<Obje... | Create a Java method that does the following: "Gets the element from a collection of objects at a specific index.". |
Of course, here is the Java code you requested:
```java
public static Reader createReader(InputStream istream, EncodingInfo encInfo)
throws IllegalArgumentException, UnsupportedEncodingException {
String charset = encInfo.getEncoding();
Boolean isBigEndian = encInfo.isBigEndian();
... | Create a Java method that does the following: "Create a reader based on the specified encoding.". |
Of course, here is the Java code you requested:
```java
public double trace() {
double result = 0.0;
for (int i = 0; i < rows; i++) {
result += get(i, i);
}
return result;
}
```
Hope this helps! | Create a Java method that does the following: "Trace method.". |
Of course, here is the Java code you requested:
```java
@Override
public Object getMp(final Object key) {
final InstanceWrapper iw = instances.get(key);
return iw == null ? null : iw.instance;
}
```
Hope this helps! | Create a Java method that does the following: "Get the object associated with the key.". |
Of course, here is the Java code you requested:
```java
protected I_CmsXmlContentValue addValue(
CmsObject cms,
Element parent,
I_CmsXmlSchemaType type,
Locale locale,
int insertIndex) {
// first generate the XML element for the new value
Element element = type.... | Create a Java method that does the following: "Adds the value to the XML node.". |
Of course, here is the Java code you requested:
```java
public static boolean isSameScriptEngine(String name, String engineName, String engineLanguage) {
if (name == null) {
return false;
}
// In the configs we just use the engine name, in the UI we use the language name as well
if (name.indexOf(LANG... | Create a Java method that does the following: "Checks if the engine name is the same as the engine name in the language.". |
Of course, here is the Java code you requested:
```java
public <T extends Response> T sendrecv ( Request request, T response, Set<RequestParam> params ) throws IOException {
if ( isDisconnected() && this.state != 5 ) {
throw new TransportException("Transport is disconnected " + this.name);
... | Create a Java method that does the following: "Send a request and receive a response.". |
Of course, here is the Java code you requested:
```java
public static boolean isSystemPackage(@Nullable @CheckForNull Package aPackage) {
if (aPackage == null) {
return false;
}
return runAsSystem(
() ->
aPackage.getId().equals(PACKAGE_SYSTEM)
|| (aPackage.getRootP... | Create a Java method that does the following: "Check if a package is a system package". |
Of course, here is the Java code you requested:
```java
protected int[] mergePeriodInto(int[] values, ReadablePeriod period) {
for (int i = 0, isize = period.size(); i < isize; i++) {
DurationFieldType type = period.getFieldType(i);
int value = period.getValue(i);
checkAndUp... | Create a Java method that does the following: "Merge the period into the values array.". |
Of course, here is the Java code you requested:
```java
public void assertValid(String valueAsString) throws IllegalArgumentException {
final T value = valueConverter.convert(valueAsString);
for (Validator<T> validator : validators) {
validator.assertValid(value);
}
}
```
Hope this helps! | Create a Java method that does the following: "Assert that the given value is valid.". |
Of course, here is the Java code you requested:
```java
public static <T, U> BiPredicate<T, U> biPredicate(CheckedBiPredicate<T, U> predicate) {
return biPredicate(predicate, THROWABLE_TO_RUNTIME_EXCEPTION);
}
```
Hope this helps! | Create a Java method that does the following: "Returns a binary predicate that returns true if the given binary predicate throws an exception.". |
Of course, here is the Java code you requested:
```java
public static byte highestOneBit(final long v) {
final long h = Long.highestOneBit(v);
if (0 == v) {
return 0;
}
for (byte i = 0; i < 64; i++) {
if (h == 1l << i) {
return (byte) (i + 1);
}
}
throw new RuntimeExce... | Create a Java method that does the following: "Get the highest one bit.". |
Of course, here is the Java code you requested:
```java
public static Color[] terrain(int n, float alpha) {
int k = n / 2;
float[] H = {4 / 12f, 2 / 12f, 0 / 12f};
float[] S = {1f, 1f, 0f};
float[] V = {0.65f, 0.9f, 0.95f};
Color[] palette = new Color[n];
float h = H[0... | Create a Java method that does the following: "Get the terrain color palette.". |
Of course, here is the Java code you requested:
```java
private void bend(int[] indexes, int from, int to, IAtom pivotAtm, double r) {
double s = Math.sin(r);
double c = Math.cos(r);
Point2d pivot = pivotAtm.getPoint2d();
for (int i = from; i < to; i++) {
Point2d p = mol.get... | Create a Java method that does the following: "Bend a sequence of 2D coordinates.". |
Of course, here is the Java code you requested:
```java
@Override
public T get() throws ConcurrentException {
try {
return getFuture().get();
} catch (final ExecutionException execex) {
ConcurrentUtils.handleCause(execex);
return null; // should not be reached
... | Create a Java method that does the following: "Get the result of the task.". |
Of course, here is the Java code you requested:
```java
public void endField(String field, int index) {
delegate.endField(field, index);
fieldValueCount.pop();
previousField.push(fields.pop());
}
```
Hope this helps! | Create a Java method that does the following: "Ends a field.". |
Of course, here is the Java code you requested:
```java
public final void setConcurrentExecutor(Executor concurrentExecutor) {
if (concurrentExecutor != null) {
this.concurrentExecutor = concurrentExecutor;
if (managedExecutorServiceClass != null && managedExecutorServiceClass.isInstanc... | Create a Java method that does the following: "Set the concurrent executor.". |
Of course, here is the Java code you requested:
```java
private void setWidth(int width) {
contentParams.width = options.fullScreenPeek() ? screenWidth : width;
content.setLayoutParams(contentParams);
}
```
Hope this helps! | Create a Java method that does the following: "Set the width of the image.". |
Of course, here is the Java code you requested:
```java
public PagedList<SasDefinitionItem> getSasDefinitions(final String vaultBaseUrl, final String storageAccountName, final Integer maxresults) {
ServiceResponse<Page<SasDefinitionItem>> response = getSasDefinitionsSinglePageAsync(vaultBaseUrl, storageAccount... | Create a Java method that does the following: "Gets the list of SAS definitions for a specified storage account.". |
Of course, here is the Java code you requested:
```java
public static int truncatedCompareTo(final Calendar cal1, final Calendar cal2, final int field) {
return truncate(cal1, field).compareTo(truncate(cal2, field));
}
```
Hope this helps! | Create a Java method that does the following: "Returns the number of times the two calendars are in the specified field.". |
Of course, here is the Java code you requested:
```java
public void setDayExcluded (final Calendar day, final boolean exclude)
{
if (exclude)
{
if (isDayExcluded (day))
{
return;
}
m_aExcludeDays.add (day);
m_bDataSorted = false;
}
else
{
if (!isDayExc... | Create a Java method that does the following: "Set the day excluded from the CAD.". |
Of course, here is the Java code you requested:
```java
public void marshall(DescribeTimeBasedAutoScalingRequest describeTimeBasedAutoScalingRequest, ProtocolMarshaller protocolMarshaller) {
if (describeTimeBasedAutoScalingRequest == null) {
throw new SdkClientException("Invalid argument passed to... | Create a Java method that does the following: "marshalls the given DescribeTimeBasedAutoScalingRequest to the given protocolMarshaller.". |
Of course, here is the Java code you requested:
```java
@Nullable
public static StorageDirView selectDirWithRequestedSpace(long bytesToBeAvailable,
BlockStoreLocation location, BlockMetadataManagerView mManagerView) {
if (location.equals(BlockStoreLocation.anyTier())) {
for (StorageTierView tierView ... | Create a Java method that does the following: "Select a directory view that has the requested space.". |
Of course, here is the Java code you requested:
```java
public void implicitDefinitions(SClassDefinition d,
Environment publicClasses)
{
if (d instanceof ASystemClassDefinition)
{
af.createPDefinitionAssistant().implicitDefinitions(d, publicClasses);
// ASystemClassDefinitionAssistantTC.implicitDefinitio... | Create a Java method that does the following: "Add implicit definitions to the class.". |
Of course, here is the Java code you requested:
```java
public void SetConfiguration(final ResTable_config configuration) {
final int diff = configuration_.diff(configuration);
configuration_ = configuration;
if (isTruthy(diff)) {
RebuildFilterList();
// InvalidateCaches(static_cast<int>(diff))... | Create a Java method that does the following: "Sets the configuration of the table.". |
Of course, here is the Java code you requested:
```java
public final <T> FluentFuture<T> transform(Function<? super V, T> function, Executor executor) {
return (FluentFuture<T>) Futures.transform(this, function, executor);
}
```
Hope this helps! | Create a Java method that does the following: "Transform this future with the given function.". |
Of course, here is the Java code you requested:
```java
private static long scanAndAggregateDefault(
final PooledTopNParams params,
final int[] positions,
final BufferAggregator[] theAggregators
)
{
if (params.getCardinality() < 0) {
throw new UnsupportedOperationException("Cannot opera... | Create a Java method that does the following: "Scan and aggregate the default value of the ND". |
Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "PolygonPatch", substitutionHeadNamespace = "http://www.opengis.net/gml", substitutionHeadName = "_SurfacePatch")
public JAXBElement<PolygonPatchType> createPolygonPatch(PolygonPatchType value) ... | Create a Java method that does the following: "Create an instance of the polygon patch element.". |
Of course, here is the Java code you requested:
```java
public void setLabels(FileChooserLabels labels) {
this.labels = labels;
// Verify if the buttons for add a file or select a folder has been modified.
if(labels != null) {
LinearLayout root = this.chooser.getRootLayout();
if(labels.labelA... | Create a Java method that does the following: "Sets the labels for the file chooser.". |
Of course, here is the Java code you requested:
```java
public static <T> List<List<T>> collate(Iterable<T> self, int size, int step, boolean keepRemainder) {
List<T> selfList = asList(self);
List<List<T>> answer = new ArrayList<List<T>>();
if (size <= 0) {
answer.add(selfList);
... | Create a Java method that does the following: "collate method.". |
Of course, here is the Java code you requested:
```java
public static void atomicMoveWithFallback(Path source, Path target, Object requester) throws IOException {
try {
Files.move(source, target, StandardCopyOption.ATOMIC_MOVE);
} catch (AtomicMoveNotSupportedException ignore) {
OLogManager.instanc... | Create a Java method that does the following: "This method is a fallback to the atomic move.". |
Of course, here is the Java code you requested:
```java
public final <R> Flux<R> flatMap(Function<? super T, ? extends Publisher<? extends R>> mapper) {
return flatMap(mapper, Queues.SMALL_BUFFER_SIZE, Queues
.XS_BUFFER_SIZE);
}
```
Hope this helps! | Create a Java method that does the following: "Perform a flatMap operation on the stream.". |
Of course, here is the Java code you requested:
```java
public static void show(IResponseCallback<DateRange> callback) {
Date today = DateUtil.today();
show(today, today, callback);
}
```
Hope this helps! | Create a Java method that does the following: "Show a calendar with the current date range.". |
Of course, here is the Java code you requested:
```java
public Result<FindNearestPolyResult> findNearestPoly(float[] center, float[] halfExtents, QueryFilter filter) {
float[] nearestPt = new float[] {center[0], center[1], center[2]};
// Get nearby polygons from proximity grid.
Result<List<Lo... | Create a Java method that does the following: "Find nearest polygon in the proximity grid.". |
Of course, here is the Java code you requested:
```java
private void resetDefaults( TableView tView ) {
Object[] colNames = tView.getColNames();
Object[][] tableValues = tView.getCalcdValues();
// dumpObjs( tableValues, System.out);
JTable table = new JTable( tableValues, colNames );
... | Create a Java method that does the following: "Reset the defaults for the TableView". |
Of course, here is the Java code you requested:
```java
@Override
public <K, V, C extends Collection<V>, M extends Multimap<K, V, C>> M toMultimap(final Function<? super T, ? extends K> keyMapper,
final Function<? super T, ? extends V> valueMapper, final Supplier<? extends M> mapFactory) {
a... | Create a Java method that does the following: "Creates a new Multimap from this sequence using the specified mapping function.". |
Of course, here is the Java code you requested:
```java
public static int[] Argsort(final float[] array, final boolean ascending) {
Integer[] indexes = new Integer[array.length];
for (int i = 0; i < indexes.length; i++) {
indexes[i] = i;
}
Arrays.sort(indexes, new Comparator... | Create a Java method that does the following: "Argsort method.". |
Of course, here is the Java code you requested:
```java
@Override
public DisassociateCertificateResult disassociateCertificate(DisassociateCertificateRequest request) {
request = beforeClientExecution(request);
return executeDisassociateCertificate(request);
}
```
Hope this helps! | Create a Java method that does the following: "Disassociates a CA from an app.". |
Of course, here is the Java code you requested:
```java
public static ns_ns_runningconfig[] get_filtered(nitro_service service, String filter) throws Exception
{
ns_ns_runningconfig obj = new ns_ns_runningconfig();
options option = new options();
option.set_filter(filter);
ns_ns_runningconfig[] response ... | Create a Java method that does the following: "Use this API to fetch filtered set of ns_ns_runningconfig resources. set the filter parameter values in filter parameter.". |
Of course, here is the Java code you requested:
```java
private byte[] toByteArray(char[] chars, Charset charset) {
assert chars != null;
CharBuffer charBuffer = CharBuffer.wrap(chars);
ByteBuffer byteBuffer = charset.encode(charBuffer);
byte[] bytes = Arrays.copyOfRange(byteBuffer.arr... | Create a Java method that does the following: "Converts a char array to a byte array.". |
Of course, here is the Java code you requested:
```java
@GET
@Path("{providerId}")
public Response registerFederatedGetPath(
@PathParam("providerId") String providerId,
@QueryParam("providerUserId") String providerUserId,
@QueryParam("access_token") String access_token,
@QueryParam("secret"... | Create a Java method that does the following: "Register a CBE Token in a Federated provider.". |
Of course, here is the Java code you requested:
```java
private Collection<DependencyInfo> collectChildrenDependencies(DependencyInfo dependency, List<String> groupLines) {
logger.debug("Collect child dependencies of {}, total group-lines = {}", dependency.getGroupId(), groupLines.size());
Collection<D... | Create a Java method that does the following: "Collect the children dependencies of a dependency.". |
Of course, here is the Java code you requested:
```java
@Nullable
private static Method findStaticInitializer(JavaClass cls) {
Method[] methods = cls.getMethods();
for (Method m : methods) {
if (Values.STATIC_INITIALIZER.equals(m.getName())) {
return m;
}
... | Create a Java method that does the following: "Find static initializer method.". |
Of course, here is the Java code you requested:
```java
public static WebsocketServerTransport create(String bindAddress, int port) {
Objects.requireNonNull(bindAddress, "bindAddress must not be null");
HttpServer httpServer = HttpServer.create().host(bindAddress).port(port);
return create(httpServer);
... | Create a Java method that does the following: "Creates a new websocket server transport.". |
Of course, here is the Java code you requested:
```java
public static PropertyKey fromString(String input) {
// First try to parse it as default key
PropertyKey key = DEFAULT_KEYS_MAP.get(input);
if (key != null) {
return key;
}
// Try to match input with alias
key = DEFAULT_ALIAS_MAP.get... | Create a Java method that does the following: "Parses a String containing a key.". |
Of course, here is the Java code you requested:
```java
public Object get(String key) {
Object curEntry = primaryTable.get(key);
return curEntry;
}
```
Hope this helps! | Create a Java method that does the following: "Get the value of the key.". |
Of course, here is the Java code you requested:
```java
public static Hosts parse(String hostString, Integer explicitGlobalPort, Integer defaultPort) {
List<String> hosts = new ArrayList<>();
List<Integer> ports = new ArrayList<>();
if ( hostString == null || hostString.trim().isEmpty() ) {
return Hosts.NO_HO... | Create a Java method that does the following: "Parses a host string into a list of hosts and ports.". |
Of course, here is the Java code you requested:
```java
protected <T> Iterator<T> providers(Class<T> pCategory) {
return getRegistry(pCategory).providers();
}
```
Hope this helps! | Create a Java method that does the following: "Returns an iterator of all providers of the given category.". |
Of course, here is the Java code you requested:
```java
public static cachepolicylabel_stats[] get(nitro_service service) throws Exception{
cachepolicylabel_stats obj = new cachepolicylabel_stats();
cachepolicylabel_stats[] response = (cachepolicylabel_stats[])obj.stat_resources(service);
return response;
}
```... | Create a Java method that does the following: "Use this API to fetch the statistics of all cachepolicylabel_stats resources that are configured on netscaler.". |
Of course, here is the Java code you requested:
```java
protected void generateIndexFile() throws IOException {
String title = configuration.getText("doclet.Window_Single_Index");
HtmlTree body = getBody(true, getWindowTitle(title));
HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
... | Create a Java method that does the following: "Generate the index file.". |
Of course, here is the Java code you requested:
```java
@Override
public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response)
throws IOException {
final String requestURI = request.getRequestURI();
UserAuthentication userAuth = null;
if (requestURI.endsWith(TWITTER_... | Create a Java method that does the following: "Attempt authentication.". |
Of course, here is the Java code you requested:
```java
public static String paramsToString(String charset, String... params) {
StringBuffer sb = new StringBuffer();
try {
for (int i = 0; i < params.length - 1; i = i + 1) {
sb.append("&");
sb.append(URLEncode... | Create a Java method that does the following: "Returns a String representation of the parameters.". |
Of course, here is the Java code you requested:
```java
public boolean withRecord(final int key, final RecordWriter writer)
{
final int claimedOffset = claimRecord(key);
if (claimedOffset == DID_NOT_CLAIM_RECORD)
{
return false;
}
try
{
write... | Create a Java method that does the following: "With a record.". |
Of course, here is the Java code you requested:
```java
public static String getType (String command)
{
int cidx = StringUtil.isBlank(command) ? -1 : command.indexOf(':');
return (cidx == -1) ? "" : command.substring(0, cidx);
}
```
Hope this helps! | Create a Java method that does the following: "Gets the type of the resource.". |
Of course, here is the Java code you requested:
```java
private EditType getEditType(String typeName) {
for (EditType type : EditType.values()) {
if (type.toString().equals(typeName)) {
return type;
}
}
return null;
}
```
Hope this helps! | Create a Java method that does the following: "Get the EditType object for a given name.". |
Of course, here is the Java code you requested:
```java
protected void in(T t) throws Exception {
R r = getFunction().apply(t);
out(r);
}
```
Hope this helps! | Create a Java method that does the following: "In method.". |
Of course, here is the Java code you requested:
```java
@Override
public boolean retainAll(Collection<?> c) {
combine();
if(combined==null) combined = new HashSet<>();
return combined.retainAll(c);
}
```
Hope this helps! | Create a Java method that does the following: "Retains all elements in the collection.". |
Of course, here is the Java code you requested:
```java
public static <E> ImmutableSortedSet<E> copyOf(
Comparator<? super E> comparator, Collection<? extends E> elements) {
return copyOf(comparator, (Iterable<? extends E>) elements);
}
```
Hope this helps! | Create a Java method that does the following: "Creates an immutable sorted set from the given elements.". |
Of course, here is the Java code you requested:
```java
public static MultipleAlignment toFullAlignment(CeSymmResult symm) {
if (!symm.isRefined())
throw new IllegalArgumentException("The symmetry result "
+ "is not refined, repeats cannot be defined");
MultipleAlignment full = symm.getMultipleAlignment(... | Create a Java method that does the following: "Converts a CeSymmResult to a full MultipleAlignment.". |
Of course, here is the Java code you requested:
```java
public static String[] collect(String[] storage, int offset, String prefix, Object object, char separator, String... names) {
if (storage == null) {
storage = new String[names.length];
offset = 0;
}
Class<?> type = ... | Create a Java method that does the following: "Collect a set of strings from an object to a string array.". |
Of course, here is the Java code you requested:
```java
@Override
public void setCenter(final IGeoPoint point) {
// If no layout, delay this call
if (!mMapView.isLayoutOccurred()) {
mReplayController.setCenter(point);
return;
}
mMapView.setExpectedCenter(poin... | Create a Java method that does the following: "Set the center of the map.". |
Of course, here is the Java code you requested:
```java
public ComponentContainer stopComponents() {
try {
stopChildren();
if (pico.getLifecycleState().isStarted()) {
pico.stop();
}
pico.dispose();
} finally {
if (parent != null) {
parent.removeChild(this);
}... | Create a Java method that does the following: "Stop all components.". |
Of course, here is the Java code you requested:
```java
public int numVertices() {
if(CACHING && (cachedNumVertices != -1)) {
return cachedNumVertices;
}
int numVertices = vertices().size();
if(CACHING) {
cachedNumVertices = numVertices;
}
return numVertices;
}
```
Hope this helps! | Create a Java method that does the following: "Returns the number of vertices in this node.". |
Of course, here is the Java code you requested:
```java
public java.util.List<String> getPlatformTypes() {
if (platformTypes == null) {
platformTypes = new com.amazonaws.internal.SdkInternalList<String>();
}
return platformTypes;
}
```
Hope this helps! | Create a Java method that does the following: "Gets the value of the platformTypes property.". |
Of course, here is the Java code you requested:
```java
boolean getEntryInfo(org.robolectric.res.android.ZipFileRO.ZipEntryRO entry, Ref<Short> pMethod,
final Ref<Long> pUncompLen, Ref<Long> pCompLen, Ref<Long> pOffset,
final Ref<Long> pModWhen, Ref<Long> pCrc32)
{
final ZipEntryRO zipEntry = /*reint... | Create a Java method that does the following: "Get the entry info.". |
Of course, here is the Java code you requested:
```java
public static Raster load(Media media)
{
Check.notNull(media);
final Xml root = new Xml(media);
final RasterData dataRed = RasterData.load(root, CHANNEL_RED);
final RasterData dataGreen = RasterData.load(root, CHANNEL_GR... | Create a Java method that does the following: "Load the
data from the media.". |
Of course, here is the Java code you requested:
```java
public static FreeMarkerOperation create(Furnace furnace, String templatePath, String outputFilename,
String... varNames)
{
return new FreeMarkerOperation(furnace, templatePath, outputFilename, varNames);
}
```
Hope this helps! | Create a Java method that does the following: "Create a FreeMarkerOperation object.". |
Of course, here is the Java code you requested:
```java
@Nullable
public static IJson readFromFile (@Nonnull final File aFile,
@Nonnull final Charset aFallbackCharset,
@Nullable final IJsonParseExceptionCallback aCustomExceptionHandler)
{
... | Create a Java method that does the following: "Read a node from a file.". |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.