code
stringlengths
146
69.7k
prompt
stringlengths
55
1.5k
Of course, here is the Java code you requested: ```java public ResolvableType getComponentType() { if (this == NONE) { return NONE; } if (this.componentType != null) { return this.componentType; } if (this.type instanceof Class) { Class<?> com...
Create a Java method that does the following: "Gets the component type.".
Of course, here is the Java code you requested: ```java @Override public void stop(BundleContext context) throws Exception { if (hpelConfigService != null) { for (AbstractHPELConfigService service : hpelConfigService) { service.stop(); } hpelConfigService...
Create a Java method that does the following: "Stop all the HPELConfigService.".
Of course, here is the Java code you requested: ```java public static org.ironjacamar.core.connectionmanager.pool.Capacity create( org.ironjacamar.common.api.metadata.common.Capacity metadata, ClassLoaderPlugin classLoaderPlugin) { if (metadata == null) return DefaultCapacity.INSTAN...
Create a Java method that does the following: "Create a new capacity object from the given metadata.".
Of course, here is the Java code you requested: ```java public static void combSort11(double arrayToSort[], int linkedArray[]) { int switches, j, top, gap; double hold1; int hold2; gap = arrayToSort.length; do { gap=(int)(gap/1.3); switch(gap) { case 0: gap = 1; ...
Create a Java method that does the following: "CombSort 11.".
Of course, here is the Java code you requested: ```java @Override public void createInputHandlersForPtoP() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createInputHandlersForPtoP", this); //Create a point to point input handler _baseDes...
Create a Java method that does the following: "Create the InputHandlers for a POSIX PtoPSession.".
Of course, here is the Java code you requested: ```java public boolean add(final String member, final double score) { return doWithJedis(new JedisCallable<Boolean>() { @Override public Boolean call(Jedis jedis) { return jedis.zadd(getKey(), score, member) > 0; ...
Create a Java method that does the following: "Add a new element to the set with the specified score.".
Of course, here is the Java code you requested: ```java protected String getEncoding(HttpServletRequest request) { final String encoding = request.getCharacterEncoding(); if (encoding != null) { return encoding; } return this.defaultEncoding; } ``` Hope this helps!
Create a Java method that does the following: "Gets the encoding for the request.".
Of course, here is the Java code you requested: ```java @Nonnull public BugInstance addSourceLine(ClassContext classContext, MethodGen methodGen, String sourceFile, InstructionHandle start, InstructionHandle end) { // Make sure start and end are really in the right order. if (start.getP...
Create a Java method that does the following: "Add a SourceLine annotation for a range of a CNS AIL instruction.".
Of course, here is the Java code you requested: ```java public static List<String> getAvailableLocaleSuffixesForBundle(String messageBundlePath, ServletContext servletContext) { return getAvailableLocaleSuffixesForBundle(messageBundlePath, MSG_RESOURCE_BUNDLE_SUFFIX, servletContext); } ``` Hope this helps!
Create a Java method that does the following: "Gets the available locale suffixes for the bundle.".
Of course, here is the Java code you requested: ```java private DbDatum[] get_obj_property(Database database, String name, String type, DbDatum[] properties) throws DevFailed { if (!database.isAccess_checked()) checkAccess(database); // Format input parameters as string array //---...
Create a Java method that does the following: "Get a single object property from a list of properties.".
Of course, here is the Java code you requested: ```java public static sslcrl get(nitro_service service, String crlname) throws Exception{ sslcrl obj = new sslcrl(); obj.set_crlname(crlname); sslcrl response = (sslcrl) obj.get_resource(service); return response; } ``` Hope this helps!
Create a Java method that does the following: "Use this API to fetch sslcrl resource of given name.".
Of course, here is the Java code you requested: ```java public Reader create(InputStream is, String javaEncoding) throws UnsupportedEncodingException { if (Charset.isSupported(javaEncoding)) { Charset charset = Charset.forName(javaEncoding); return new InputStreamReader(is, charset); } ...
Create a Java method that does the following: "Create a Reader from an input stream.".
Of course, here is the Java code you requested: ```java public static void checkMessageFactory(final ExtendedLogger logger, final MessageFactory messageFactory) { final String name = logger.getName(); final MessageFactory loggerMessageFactory = logger.getMessageFactory(); if (messageFactory != ...
Create a Java method that does the following: "Check if the message factory is the same as the one supplied.".
Of course, here is the Java code you requested: ```java public DeletionInfo add(DeletionInfo newInfo) { add(newInfo.topLevel); if (ranges == null) ranges = newInfo.ranges == null ? null : newInfo.ranges.copy(); else if (newInfo.ranges != null) ranges.addAll(newInfo.ranges); return this;...
Create a Java method that does the following: "Add a deletion info object to this deletion info object.".
Of course, here is the Java code you requested: ```java public NewChunk asciiToLower(NewChunk nc) { // copy existing data nc = this.extractRows(nc, 0,_len); //update offsets and byte array for(int i= 0; i < nc._sslen; i++) { if (nc._ss[i] > 0x40 && nc._ss[i] < 0x5B) // check for capital letter ...
Create a Java method that does the following: "converts ascii to lower".
Of course, here is the Java code you requested: ```java Response createResponse(final JaxRx impl, final ResourcePath path) { final StreamingOutput out = createOutput(impl, path); // change media type, dependent on WRAP value final boolean wrap = path.getValue(QueryParameter.WR...
Create a Java method that does the following: "Creates a response object with a StreamingOutput object and a MediaType object.".
Of course, here is the Java code you requested: ```java public static <T extends Number> WindowOver<T> stddevPop(Expression<T> expr) { return new WindowOver<T>(expr.getType(), SQLOps.STDDEVPOP, expr); } ``` Hope this helps!
Create a Java method that does the following: "Create a standard deviation pop window expression.".
Of course, here is the Java code you requested: ```java public static Identity createExtendedIdentity(String extendedIdentifier, Charset c) throws MarshalException { return createExtendedIdentity(DomHelpers.toDocument(extendedIdentifier, c)); } ``` Hope this helps!
Create a Java method that does the following: "Create an extended identity from a String.".
Of course, here is the Java code you requested: ```java public Task removeDevices(List<VirtualDevice> deviceList, boolean destroyDeviceBacking) throws InvalidName, VmConfigFault, DuplicateName, TaskInProgress, FileFault, InvalidState, ConcurrentAccess, InvalidDatastore, InsufficientResourcesFault, RuntimeFault, Remote...
Create a Java method that does the following: "Remove all the devices in the list of virtual devices.".
Of course, here is the Java code you requested: ```java public Long insertForGeneratedKey(Entity record) throws SQLException { Connection conn = null; try { conn = this.getConnection(); return runner.insertForGeneratedKey(conn, record); } catch (SQLException e) { throw e; } finally { this.c...
Create a Java method that does the following: "Insert a new entity into the database.".
Of course, here is the Java code you requested: ```java @Deprecated public BoxRequestsShare.AddCollaboration getAddRequest(String folderId, BoxCollaboration.Role role, BoxCollaborator collaborator) { return getAddToFolderRequest(folderId, role, collaborator); } ``` Hope this helps!
Create a Java method that does the following: "Gets a request that adds a collaborator to a folder.".
Of course, here is the Java code you requested: ```java public static Geometry difference(Geometry geometry1, Geometry substractor, SpatialReference spatialReference) { OperatorDifference op = (OperatorDifference) factory .getOperator(Operator.Type.Difference); Geometry result = op.execute(geometry1, substr...
Create a Java method that does the following: "Difference Geometry".
Of course, here is the Java code you requested: ```java public static <T> Operator<T> createUnionCascade(Operator<T>... operators) { return createUnionCascade(null, operators); } ``` Hope this helps!
Create a Java method that does the following: "Create an Union cascading operator from the given operators.".
Of course, here is the Java code you requested: ```java static void mkdirp(ZooKeeper zookeeper, String znode) throws KeeperException, InterruptedException { boolean createPath = false; for (String path : pathParts(znode)) { if (!createPath) { Stat stat = zookeeper.exists(pat...
Create a Java method that does the following: "Create the directory for the given znode.".
Of course, here is the Java code you requested: ```java public ServiceFuture<Void> beginResetServicePrincipalProfileAsync(String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(beginResetS...
Create a Java method that does the following: "Resets the service principal profile for a managed cluster.".
Of course, here is the Java code you requested: ```java public Map<String, String> loadNucleotideStore() throws IOException, URISyntaxException { Map<String, String> nucleotides = new TreeMap<String, String>(String.CASE_INSENSITIVE_ORDER); LOG.debug("Loading nucleotide store by Webservice Loader"); ...
Create a Java method that does the following: "Load the nucleotide store by webservice loader".
Of course, here is the Java code you requested: ```java Table SYSTEM_SESSIONS() { Table t = sysTables[SYSTEM_SESSIONS]; if (t == null) { t = createBlankTable(sysTableHsqlNames[SYSTEM_SESSIONS]); addColumn(t, "SESSION_ID", CARDINAL_NUMBER); addColumn(t, "CONNECTED"...
Create a Java method that does the following: "Returns the table system_sessions.".
Of course, here is the Java code you requested: ```java public static String getBaseName(String fileName, String suffix) { String[] elts = fileName.split("/"); String lastElt = elts[elts.length - 1]; if (lastElt.endsWith(suffix)) { lastElt = lastElt.substring(0, lastElt.length() - suffix.length()...
Create a Java method that does the following: "Gets the base name of a file name with a suffix.".
Of course, here is the Java code you requested: ```java @Override public boolean removeFirstOccurrence(DelayedEntry incoming) { Data incomingKey = (Data) incoming.getKey(); Object incomingValue = incoming.getValue(); DelayedEntry current = map.get(incomingKey); if (current == null)...
Create a Java method that does the following: "Remove first occurrence of a DelayedEntry.".
Of course, here is the Java code you requested: ```java private static boolean getArgBoolean(String[] args, int position, boolean defaultValue) { if (args.length > position) { String lowerArg = args[position].toLowerCase(); if (lowerArg.equals("true") || lowerArg.equals("yes")) { ...
Create a Java method that does the following: "Get the value of a boolean argument at a given position.".
Of course, here is the Java code you requested: ```java public static <T> Stream<T> create(final Iterator<? extends T> iterator) { if (iterator.hasNext()) { return new IteratorStream<T>(iterator); } else { return new EmptyStream<T>(); } } ``` Hope this helps!
Create a Java method that does the following: "Create a stream from an iterator.".
Of course, here is the Java code you requested: ```java private void showMacroResolverDialog(CmsResource resource) { final Window window = CmsBasicDialog.prepareWindow(DialogWidth.wide); window.setCaption(CmsVaadinUtils.getMessageText(Messages.GUI_COPY_MOVE_SET_MACRO_VALUES_TITLE_0)); m_macroD...
Create a Java method that does the following: "Shows a macro resolver dialog.".
Of course, here is the Java code you requested: ```java @Service public Task getPendingTaskForWorkflow(String workflowId, String taskReferenceName) { return executionService.getPendingTaskForWorkflow(taskReferenceName, workflowId); } ``` Hope this helps!
Create a Java method that does the following: "Get the pending task for a workflow.".
Of course, here is the Java code you requested: ```java public com.google.api.ads.adwords.axis.v201809.cm.ErrorList getErrorList() { return errorList; } ``` Hope this helps!
Create a Java method that does the following: "Gets the errorList value for this CdnError.".
Of course, here is the Java code you requested: ```java public static Predicate<Class<?>> classOrAncestorAnnotatedWith(final Class<? extends Annotation> annotationClass, boolean includeMetaAnnotations) { return candidate -> candidate != null && Classes.from(candidate) .traversingSup...
Create a Java method that does the following: "Checks if a candidate class or an ancestor of an annotation is annotated with the given annotation class.".
Of course, here is the Java code you requested: ```java @BetaApi public final BackendService getRegionBackendService( ProjectRegionBackendServiceName backendService) { GetRegionBackendServiceHttpRequest request = GetRegionBackendServiceHttpRequest.newBuilder() .setBackendService(backen...
Create a Java method that does the following: "Gets the Region BackendService resource that supports the BackendService REST API.".
Of course, here is the Java code you requested: ```java @Override public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) { if ( lockMode == LockMode.PESSIMISTIC_FORCE_INCREMENT ) { return new PessimisticForceIncrementLockingStrategy( lockable, lockMode ); } else if ( lockMode == Lock...
Create a Java method that does the following: "Get the lock strategy for the given lockable and lock mode.".
Of course, here is the Java code you requested: ```java public static SDDL userCannotChangePassword(final SDDL sddl, final Boolean cannot) { final AceType type = cannot ? AceType.ACCESS_DENIED_OBJECT_ACE_TYPE : AceType.ACCESS_ALLOWED_OBJECT_ACE_TYPE; ACE self = null; ACE all = null; f...
Create a Java method that does the following: "User cannot change password.".
Of course, here is the Java code you requested: ```java public static final FileAttribute<UserPrincipal> getOwnerAsAttribute(String owner) throws IOException { if (supports("posix")) { UserPrincipalLookupService upls = FileSystems.getDefault().getUserPrincipalLookupService(); ...
Create a Java method that does the following: "Gets the owner as attribute.".
Of course, here is the Java code you requested: ```java public static double[][] orthonormalize(final double[][] m1) { final int columndimension = getColumnDimensionality(m1); final double[][] v = copy(m1); // FIXME: optimize - excess copying! for(int i = 1; i < columndimension; i++) { final dou...
Create a Java method that does the following: "Orthonormalize the matrix.".
Of course, here is the Java code you requested: ```java private void renderOption(final WMultiDropdown dropdown, final Object option, final int optionIndex, final XmlStringBuilder html, final List<?> selections, final boolean renderSelectionsOnly) { boolean selected = (selections != null && selections.contains...
Create a Java method that does the following: "Renders an option.".
Of course, here is the Java code you requested: ```java public static Collection<String> getPropertiesNames(Stanza packet) { JivePropertiesExtension jpe = (JivePropertiesExtension) packet.getExtension(JivePropertiesExtension.NAMESPACE); if (jpe == null) { return Collections.emptyList(); ...
Create a Java method that does the following: "Gets the properties names of a single class.".
Of course, here is the Java code you requested: ```java @Override public Cluster modifyClusterDbRevision(ModifyClusterDbRevisionRequest request) { request = beforeClientExecution(request); return executeModifyClusterDbRevision(request); } ``` Hope this helps!
Create a Java method that does the following: "Modify a Cluster s DB revision.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") @Override public M getData() throws NotAvailableException { try { return (M) cloneDataBuilder().build(); } catch (Exception ex) { throw new NotAvailableException("Data", new CouldNotPe...
Create a Java method that does the following: "Gets the data from the message builder.".
Of course, here is the Java code you requested: ```java public static void computePosition ( Point center, double xradius, double yradius, double angle, Point pos) { pos.x = (int)Math.round(center.x + xradius * Math.cos(angle)); pos.y = (int)Math.round(center.y + yradius * Math.sin(angle));...
Create a Java method that does the following: "Compute the position of a SECTYPE in the specified location.".
Of course, here is the Java code you requested: ```java public String getChecksum ( final String fileName, final String algorithm ) { if ( !this.digests.contains ( algorithm ) ) { return null; } final String result = this.checksums.get ( fileName + ":" + algorithm ); ...
Create a Java method that does the following: "Gets the checksum for the specified file and algorithm.".
Of course, here is the Java code you requested: ```java public void addLoop(ArrayComprehensionLoop acl) { assertNotNull(acl); loops.add(acl); acl.setParent(this); } ``` Hope this helps!
Create a Java method that does the following: "Add a new loop to this domain.".
Of course, here is the Java code you requested: ```java public BucketNotificationConfiguration addConfiguration(String name, NotificationConfiguration notificationConfiguration) { configurations.put(name, notificationConfiguration); return this; } ``` Hope this helps!
Create a Java method that does the following: "Add a configuration to the bucket.".
Of course, here is the Java code you requested: ```java public CompletableFuture<Object> headAsync(final Consumer<HttpConfig> configuration) { return CompletableFuture.supplyAsync(() -> head(configuration), getExecutor()); } ``` Hope this helps!
Create a Java method that does the following: "Asynchronously head the resource.".
Of course, here is the Java code you requested: ```java @Override public <T> T[] toArray(T[] a) { // Estimate size of array; be prepared to see more or fewer elements int size = size(); T[] r = a.length >= size ? a : (T[])java.lang.reflect.Array .newInstance(a.getClas...
Create a Java method that does the following: "Method to convert the iterator to an array.".
Of course, here is the Java code you requested: ```java @Override public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, Object[] args) { if (!f.hasTag(getClassName())) { return super.execIdCall(f, cx, scope, thisObj, args...
Create a Java method that does the following: "Override this method to override the default implementation of the method.".
Of course, here is the Java code you requested: ```java public static CheckpointStorageLocationReference encodePathAsReference(Path path) { byte[] refBytes = path.toString().getBytes(StandardCharsets.UTF_8); byte[] bytes = new byte[REFERENCE_MAGIC_NUMBER.length + refBytes.length]; System.arraycopy(REFERENCE_MAG...
Create a Java method that does the following: "Encodes a path as a reference.".
Of course, here is the Java code you requested: ```java @Override public void setValue(double value) { super.setValue(value); // Set active leds relating to the new value calcNoOfActiveLed(); if (isValueCoupled()) { setLcdValue(value); } repaint(getInne...
Create a Java method that does the following: "Sets the value of the CRAS language.".
Of course, here is the Java code you requested: ```java private void assignCurrencyPrivate(XAttributable element, String currency) { if (currency != null && currency.trim().length() > 0) { XAttributeLiteral attr = (XAttributeLiteral) ATTR_CURRENCY.clone(); attr.setValue(currency); element.getAttributes(...
Create a Java method that does the following: "Assigns the currency attribute to an element.".
Of course, here is the Java code you requested: ```java public MarkLine geoCoord(String name, String x, String y) { this.geoCoord().put(name, x, y); return this; } ``` Hope this helps!
Create a Java method that does the following: "Add a geo coordinate to the MarkLine.".
Of course, here is the Java code you requested: ```java @Override public void setDType(DataType dtype) { assert dtype == DataType.DOUBLE || dtype == DataType.FLOAT || dtype == DataType.INT : "Invalid opType passed, must be float or double"; // this.dtype = dtype; } ``` ...
Create a Java method that does the following: "Sets the data type of the record.".
Of course, here is the Java code you requested: ```java @Override public List<com.enioka.jqm.api.Deliverable> getJobDeliverables(int idJob) { try { return target.path("ji/" + idJob + "/files").request().get(new GenericType<List<Deliverable>>() { }); }...
Create a Java method that does the following: "Gets the list of deliverables for a given job.".
Of course, here is the Java code you requested: ```java @Override public final String getNamespaceURI(String prefix) { /* First the known offenders; invalid args, 2 predefined xml namespace * prefixes */ if (prefix == null) { throw new IllegalArgumentException(Erro...
Create a Java method that does the following: "Get the namespace URI for a namespace prefix.".
Of course, here is the Java code you requested: ```java private void suppressLog4jLogging() { if ( ! log4jLoggingSuppressed.getAndSet(true) ) { Logger logger = Logger.getLogger("org.apache.http"); logger.setLevel(Level.ERROR); logger.addAppender(new ConsoleAppender()); ...
Create a Java method that does the following: "Set the log4j logging flag to true.".
Of course, here is the Java code you requested: ```java public static String generateSharedAccessSignatureHashForQueue( final SharedAccessQueuePolicy policy, final String accessPolicyIdentifier, final String resourceName, final IPRange ipRange, final SharedAccessProtocols protocols, final Servi...
Create a Java method that does the following: "Generate a SHA - 1 Access Signature Hash for a queue.".
Of course, here is the Java code you requested: ```java private Object vanillaDeserializeAndFinishBuild( final JsonParser p, final DeserializationContext ctxt, final JsonToken t) throws IOException { try { return ThreadLocalBuilder.buildGeneric( ...
Create a Java method that does the following: "Vanilla deserialize and finish build.".
Of course, here is the Java code you requested: ```java public void setPadding(int leftPadding, int topPadding, int rightPadding, int bottomPadding) { mPaddingLeft = leftPadding; mPaddingRight = rightPadding; mPaddingTop = topPadding; mPaddingBottom = bottomPadding; } ``` Hope this...
Create a Java method that does the following: "Sets the padding for the generated source code.".
Of course, here is the Java code you requested: ```java public void marshall(RedshiftSettings redshiftSettings, ProtocolMarshaller protocolMarshaller) { if (redshiftSettings == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { pr...
Create a Java method that does the following: "marshalls the given RedshiftSettings to the JSON file.".
Of course, here is the Java code you requested: ```java public static ThreadFactory daemonThreadFactory(final String name, final int priority) { return new ThreadFactory() { private AtomicInteger count = new AtomicInteger(); @Override public Thread newThread(final Runnable r) { Thread thread = new Thre...
Create a Java method that does the following: "Creates a thread factory that creates a daemon thread with the specified name and priority.".
Of course, here is the Java code you requested: ```java @Deprecated @Override public JsonGenerator createJsonGenerator(OutputStream out, JsonEncoding enc) throws IOException { throw new UnsupportedOperationException("Generating HOCON is not supported yet"); } ``` Hope this helps!
Create a Java method that does the following: "This method is deprecated.".
Of course, here is the Java code you requested: ```java public static Deferred<Leaf> parseFromStorage(final TSDB tsdb, final KeyValue column, final boolean load_uids) { if (column.value() == null) { throw new IllegalArgumentException("Leaf column value was null"); } // qualifier has the TSUID...
Create a Java method that does the following: "Parse a leaf object from the storage.".
Of course, here is the Java code you requested: ```java public final boolean overlaps(@NotNull final HourRange other) { Contract.requireArgNotNull("other", other); if (this.equals(other)) { return true; } final int otherFrom = other.from.toMinutes(); final int thisFr...
Create a Java method that does the following: "Check if two hours overlap.".
Of course, here is the Java code you requested: ```java private void writeSource(final Writer writer, final String basePath, final File groupMember) throws IOException { writer.write("# Begin Source File\r\n\r\nSOURCE="); String relativePath = CUtil.getRelativePath(basePath, groupMember); // // if rela...
Create a Java method that does the following: "Write the source file.".
Of course, here is the Java code you requested: ```java @Override public void configureComponent(final Object component, final PlexusConfiguration configuration, final ExpressionEvaluator expressionEvaluator, final ClassRealm containerRealm, final ConfigurationListen...
Create a Java method that does the following: "Configure the component.".
Of course, here is the Java code you requested: ```java public Token addToTrigger(Char ch) { trigger += ch.getValue(); internTrigger = null; source += ch.getValue(); return this; } ``` Hope this helps!
Create a Java method that does the following: "Add a character to the trigger.".
Of course, here is the Java code you requested: ```java public void setCrunchbase(String crunchbase) { if(crunchbase != null) { crunchbase = crunchbase.trim(); } this.crunchbase = crunchbase; } ``` Hope this helps!
Create a Java method that does the following: "Sets the crunchbase.".
Of course, here is the Java code you requested: ```java public Input addFileField(String tag, String label) { Input i = new Input(Input.File,tag); addField(label,i); return i; } ``` Hope this helps!
Create a Java method that does the following: "Add a file field to the input set.".
Of course, here is the Java code you requested: ```java public static String importProperty(MutableExtension extension, String propertySuffix, String def) { return StringUtils.defaultString(importProperty(extension, propertySuffix), def); } ``` Hope this helps!
Create a Java method that does the following: "Import a property from a MutableExtension.".
Of course, here is the Java code you requested: ```java public LinkedList<Map.Entry<String, V>> commonPrefixSearchWithValue(String key) { char[] chars = key.toCharArray(); return commonPrefixSearchWithValue(chars, 0); } ``` Hope this helps!
Create a Java method that does the following: "Returns a list of entries that are common to all the keys in the cache.".
Of course, here is the Java code you requested: ```java public static <N, V> MutableValueGraph<N, V> inducedSubgraph( ValueGraph<N, V> graph, Iterable<? extends N> nodes) { MutableValueGraph<N, V> subgraph = ValueGraphBuilder.from(graph).build(); for (N node : nodes) { subgraph.addNode(node); }...
Create a Java method that does the following: "Induced a subgraph of the given graph by adding nodes and edges to the graph.".
Of course, here is the Java code you requested: ```java public void dump(OutputStream out) throws IOException { Properties props = new Properties(); Iterator<String> iter = _map.keySet().iterator(); while (iter.hasNext()) { String key = iter.next(); props.setProperty(ke...
Create a Java method that does the following: "Dump the configuration to the output stream.".
Of course, here is the Java code you requested: ```java public synchronized SiteNode findClosestParent(URI uri) { if (uri == null) { return null; } SiteNode lastParent = null; SiteNode parent = getRoot(); String folder = ""; try { String host =...
Create a Java method that does the following: "Returns the closest parent of the given URI.".
Of course, here is the Java code you requested: ```java public DrawerView clearItems() { for (DrawerItem item : mAdapter.getItems()) { item.detach(); } mAdapter.clear(); updateList(); return this; } ``` Hope this helps!
Create a Java method that does the following: "Clear all the items in the drawer view".
Of course, here is the Java code you requested: ```java public static final <T extends Calendar> Function<T, LocalDate> calendarToLocalDate(DateTimeZone dateTimeZone) { return new CalendarToLocalDate<T>(dateTimeZone); } ``` Hope this helps!
Create a Java method that does the following: "Creates a function that converts a Calendar object to a LocalDate object.".
Of course, here is the Java code you requested: ```java public static ITransportPlugin GetTransportPlugin(ThriftConnectionType type, Map storm_conf, Configuration login_conf) { ITransportPlugin transportPlugin = null; try { String transport_plugin_klassName = type.getTransportPlugin(storm_c...
Create a Java method that does the following: "Get TransportPlugin from storm_conf and login_conf".
Of course, here is the Java code you requested: ```java private static final ParameterizedType parameterizeWithOwner(final Type owner, final Class<?> raw, final Type... typeArguments) { Assert.requireNonNull(raw, "raw"); final Type useOwne...
Create a Java method that does the following: "Parameterize with owner.".
Of course, here is the Java code you requested: ```java public static void drawArrowOffset(Graphics g, Point from, Point to, int offsetFrom, int offsetTo, double weight){ double xk1,xk2,s,dx,dy,sinPhi,cosPhi; dx = to.x-from.x; dy = to.y-from.y; xk1=-offsetFrom/2; xk2=-offsetTo/2; s=Math.sqrt(dy*dy+dx*dx...
Create a Java method that does the following: "Draws an arrow at the specified offset.".
Of course, here is the Java code you requested: ```java @Override protected void handleTransliterate(Replaceable text, Position offsets, boolean isIncremental) { int maxLen = UCharacterName.INSTANCE.getMaxCharNameLength() + 1; // allow for temporary trailing space ...
Create a Java method that does the following: "Handle the transliterate method.".
Of course, here is the Java code you requested: ```java public static void injectInstanceImports(Instance instance, File templateFile, Writer writer) throws IOException { MustacheFactory mf = new DefaultMustacheFactory( templateFile.getParentFile()); Mustache mustache = mf.compile( templateFile.getName()); mus...
Create a Java method that does the following: "Injects the instance imports into the writer.".
Of course, here is the Java code you requested: ```java private Properties getEnvVars() { Process p = null; Properties envVars = new Properties(); try { Runtime r = Runtime.getRuntime(); String OS = System.getProperty("os.name").toLowerCase(); ...
Create a Java method that does the following: "Gets the environment variables from the process.".
Of course, here is the Java code you requested: ```java public static int findSpace(String haystack, int begin) { int space = haystack.indexOf(' ', begin); int nbsp = haystack.indexOf('\u00A0', begin); if (space == -1 && nbsp == -1) { return -1; } else if (space >= 0 && nbsp >= 0) { r...
Create a Java method that does the following: "Find the first non - empty space in the haystack starting at the given index.".
Of course, here is the Java code you requested: ```java public void marshall(DeleteJobRequest deleteJobRequest, ProtocolMarshaller protocolMarshaller) { if (deleteJobRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { pr...
Create a Java method that does the following: "marshalls the given parameter object.".
Of course, here is the Java code you requested: ```java @Beta // TODO maybe load with PELoader public MSDOSLoadModule readMSDOSLoadModule() throws IOException { MSDOSLoadModule module = new MSDOSLoadModule(msdos, file); module.read(); return module; } ``` Hope this helps!
Create a Java method that does the following: "Read the MSDOS load module.".
Of course, here is the Java code you requested: ```java @NotNull public List<Integer> getIndexes(String name) { List<Integer> indexes = parametersMapping.get(name); if (indexes == null) { throw new IllegalArgumentException("Parameter not found: " + name); } return indexe...
Create a Java method that does the following: "Gets the indexes for a single class attribute.".
Of course, here is the Java code you requested: ```java @PostConstruct public void init() { final String thumbnailPath = System.getProperty(Constants.FESS_THUMBNAIL_PATH); if (thumbnailPath != null) { baseDir = new File(thumbnailPath); } else { final String varPath =...
Create a Java method that does the following: "Initialize the image thumbnail.".
Of course, here is the Java code you requested: ```java protected String getRequestUrl(String key) throws Exception { String result = ""; try { result = this.methods.get(key)[0]; } catch (Exception ex) { throw new Exception("Unknown method key: " + key); } ...
Create a Java method that does the following: "Gets the request URL for the specified method.".
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "directedFace") public JAXBElement<DirectedFacePropertyType> createDirectedFace(DirectedFacePropertyType value) { return new JAXBElement<DirectedFacePropertyType>(_DirectedFace_QNAME, Di...
Create a Java method that does the following: "Create an instance of the DirectedFacePropertyType class.".
Of course, here is the Java code you requested: ```java private void doGenerateVarianceGammaIncrements() { if(varianceGammaIncrements != null) { return; } myGammaProcess = new GammaProcess(timeDiscretization,numberOfFactors,numberOfPaths,seed,1/nu,nu); myBrownianMotion = new BrownianMotionLazyInit...
Create a Java method that does the following: "Generate variance gamma increments.".
Of course, here is the Java code you requested: ```java @Override public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) { AnnotationAttributes attributes = config.getAttributes(); builder.addPropertyReference(BeanDefinitionName.SOLR_OPERATIONS.getBeanName(), ...
Create a Java method that does the following: "Add Solr template references to the BeanDefinitionBuilder".
Of course, here is the Java code you requested: ```java @Override public String getBeanName(Object parent, Container container) { if(FORCE_V2) { return v2BeanName; } if(beanName == null) { try { Class.forName("com.facebook.Session"); // We assume that if this class exists, we are v3+ beanNa...
Create a Java method that does the following: "Override getBeanName to return the bean name.".
Of course, here is the Java code you requested: ```java public void setSqlRunConfigurations(java.util.Collection<SqlRunConfiguration> sqlRunConfigurations) { if (sqlRunConfigurations == null) { this.sqlRunConfigurations = null; return; } this.sqlRunConfigurations = new ...
Create a Java method that does the following: "Sets the value of the sqlRunConfigurations property.".
Of course, here is the Java code you requested: ```java public ServiceFuture<PublicIPAddressInner> getVirtualMachineScaleSetPublicIPAddressAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName, ...
Create a Java method that does the following: "Get a public IP address of a virtual machine scale set. Get a public IP address of a virtual machine scale set.".
Of course, here is the Java code you requested: ```java public void deleteAllItems() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { PubSub request = createPubsubPacket(Type.set, new NodeExtension(PubSubElementType.PURGE_OWNER, getId())); pubSubManager.get...
Create a Java method that does the following: "Deletes all the items in the node.".
Of course, here is the Java code you requested: ```java public void marshall(UpdateFlowSourceRequest updateFlowSourceRequest, ProtocolMarshaller protocolMarshaller) { if (updateFlowSourceRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } ...
Create a Java method that does the following: "marshalls the given updateFlowSourceRequest to the JSON object.".
Of course, here is the Java code you requested: ```java public java.util.List<ClassicLoadBalancer> getClassicLoadBalancers() { if (classicLoadBalancers == null) { classicLoadBalancers = new com.amazonaws.internal.SdkInternalList<ClassicLoadBalancer>(); } return classicLoadBalancers;...
Create a Java method that does the following: "Gets the value of the classicLoadBalancers property.".