code
stringlengths
146
48.7k
prompt
stringlengths
55
1.51k
Of course, here is the Java code you requested: ```java public static TypeQualifierAnnotation getEffectiveTypeQualifierAnnotation(AnnotatedObject o, TypeQualifierValue<?> typeQualifierValue) { if (o instanceof XMethod) { XMethod m = (XMethod) o; if (m.getName().startsWith("a...
Create a Java method that does the following: "Get the effective TypeQualifierAnnotation for a given type qualifier value.".
Of course, here is the Java code you requested: ```java public static String render(Object o) { if (o == null) { return String.valueOf(o); } Class<?> objectClass = o.getClass(); if (unrenderableClasses.containsKey(objectClass) == false) { try { i...
Create a Java method that does the following: "Render an object to a String.".
Of course, here is the Java code you requested: ```java public Date getServerDate() throws IOException { HttpInputStream in = get("/describe", false, false); String dateString = null; try { Header header = in.getResponseHeader("Date"); if (header == null) { ...
Create a Java method that does the following: "Get the server date from the describe request.".
Of course, here is the Java code you requested: ```java private static Group[] rChainAfp(FatCatParameters params, AFPChain afpChain, Atom[] ca1, Atom[] ca2) throws StructureException{ params.setMaxTra(0); afpChain.setMaxTra(0); return chainAfp(params,afpChain,ca1,ca2); } ``` Hope this helps!
Create a Java method that does the following: "Afp - > rChainAfp".
Of course, here is the Java code you requested: ```java public ResourceMinimalImpl<T> setResource(T resource) { return new ResourceMinimalImpl<>(resourceID, provider, resource, consumer); } ``` Hope this helps!
Create a Java method that does the following: "Sets the resource.".
Of course, here is the Java code you requested: ```java public void clearModified() { for (String field : mStatus.keySet()) { switch (getStatus(field)) { case DELETED: mStatus.remove(field); break; case MODIFIED: ...
Create a Java method that does the following: "Clear modified status.".
Of course, here is the Java code you requested: ```java public static String convertCharsFromXml(String input) { StringBuffer result = new StringBuffer(); for(int i=0; i<input.length();) { if(input.charAt(i)=='&') { if(input.substring(i, i+3).equals("&lt;")) { result.append('<'); i += 4; } els...
Create a Java method that does the following: "Converts the chars in XML to XML.".
Of course, here is the Java code you requested: ```java protected NamedParameterJdbcTemplate namedParameterJdbcTemplate(Connection conn) { DataSource ds = new SingleConnectionDataSource(conn, true); return new NamedParameterJdbcTemplate(ds); } ``` Hope this helps!
Create a Java method that does the following: "Create a named parameter jdbc template.".
Of course, here is the Java code you requested: ```java protected List<Link> getFirstPhysicalPath(List<Link> currentPath, Switch sw, Node dst) { // Iterate through the current switch's links for (Link l : net.getConnectedLinks(sw)) { // Wrong link if (currentPath.contains(l)) {...
Create a Java method that does the following: "Get the first physical path of a switch.".
Of course, here is the Java code you requested: ```java protected void stop() { this.authenticating = false; // clear batcher batcher.clear(); // set non-continuous setLifecycle(Replication.Lifecycle.ONESHOT); // cancel if middle of retry cancelRetryFuture(); ...
Create a Java method that does the following: "Stop the server.".
Of course, here is the Java code you requested: ```java public RegionPageSectionBuilder region(final PageSectionContent.Region region) { switch (region) { case LEFT: // Use left region this.curRegionBox = this.leftRegionBox; break; case CENTER: // Use center region this.curRegionBox = this.centerRegionB...
Create a Java method that does the following: "Sets the region of the page section.".
Of course, here is the Java code you requested: ```java public <E extends Exception> boolean allMatch(Try.DoublePredicate<E> filter) throws E { return allMatch(0, size(), filter); } ``` Hope this helps!
Create a Java method that does the following: "Returns true if all elements of this list match the given predicate.".
Of course, here is the Java code you requested: ```java private BTag createDay(AccountReport12 report) { BTag tag = new BTag(); tag.start = new Saldo(); tag.end = new Saldo(); tag.starttype = 'F'; tag.endtype = 'F'; //////////////////////////////////////////////////////...
Create a Java method that does the following: "Creates BTag objects for a day.".
Of course, here is the Java code you requested: ```java @Override public long addClientAndConnect(String host, int port) throws TTransportException, IOException { long clientId = getNewClientId(); LOG.info("Adding client with id=" + clientId + " host=" + host + " port=" + port + " and connectin...
Create a Java method that does the following: "Add a client and connect to the server.".
Of course, here is the Java code you requested: ```java public String format(Thread thread, String formatString) { final StringBuilder builder = new StringBuilder(formatString.length() * 5); final ThreadGroup group = thread.getThreadGroup(); final Matcher matcher = searchPattern.matcher(formatString)...
Create a Java method that does the following: "Format a thread with the specified string.".
Of course, here is the Java code you requested: ```java @Override public final Method retrieveSetterForField(final Class<?> pClazz, final String pFieldName) throws Exception { String setterName = "set" + pFieldName.substring(0, 1).toUpperCase() + pFieldName.substring(1); return retrieveMethod(pClaz...
Create a Java method that does the following: "Retrieve the setter method for a field.".
Of course, here is the Java code you requested: ```java public Matrix4d perspective(double fovy, double aspect, double zNear, double zFar, Matrix4d dest) { return perspective(fovy, aspect, zNear, zFar, false, dest); } ``` Hope this helps!
Create a Java method that does the following: "Perspective projection matrix for a CRA image.".
Of course, here is the Java code you requested: ```java @Override public boolean schemaExists() { PreparedStatement ps = null; try { ps = getPreparedStatement(SIMPLE_SELECT_SQL); ps.executeQuery(); return true; } catch (SQLException e) { retur...
Create a Java method that does the following: "Returns true if the database exists.".
Of course, here is the Java code you requested: ```java void memberEnter(List<? extends JCTree> trees, Env<AttrContext> env) { for (List<? extends JCTree> l = trees; l.nonEmpty(); l = l.tail) memberEnter(l.head, env); } ``` Hope this helps!
Create a Java method that does the following: "Enter a list of trees.".
Of course, here is the Java code you requested: ```java public Configuration addConfiguration(final KNXNetworkLink link) { final ConfigImpl c = new ConfigImpl(link); configs.add(c); return c; } ``` Hope this helps!
Create a Java method that does the following: "Adds a configuration to the configuration list.".
Of course, here is the Java code you requested: ```java public AbcNode getChild(String label) { if (label == null || label.equals("")) return null; String[] generation = label.split("/"); String child = generation[0]; String grandchild = ""; if (generation.length > 1) { for (int i = 1; i < generation.l...
Create a Java method that does the following: "Get the child with the given label.".
Of course, here is the Java code you requested: ```java public SXTag addNode(String tagName) throws IOException { prepareToAddChildNode(); SXTag node = new SXTag(tagName, writer, 0, tabString); lastChildNode = node; return node; } ``` Hope this helps!
Create a Java method that does the following: "Add a new node to the tree.".
Of course, here is the Java code you requested: ```java public static String serialize(Object obj) throws SerializationException { try { if (obj != null) { return mapper.writeValueAsString(obj); } else { return null; } } catch (Exception e) { logger.error("SerializationException {}", e.getMessa...
Create a Java method that does the following: "Serialize an object to a String.".
Of course, here is the Java code you requested: ```java public static sslpolicy get(nitro_service service, String name) throws Exception{ sslpolicy obj = new sslpolicy(); obj.set_name(name); sslpolicy response = (sslpolicy) obj.get_resource(service); return response; } ``` Hope this helps!
Create a Java method that does the following: "Use this API to fetch sslpolicy resource of given name.".
Of course, here is the Java code you requested: ```java public String findFieldName(String name, AcroFields af) { HashMap items = af.getFields(); if (items.containsKey(name)) return name; if (acroFieldsSom == null) { if (items.isEmpty() && xfaPresent) acroFieldsSo...
Create a Java method that does the following: "findFieldName This method is used to find a field name from the fields of the class.".
Of course, here is the Java code you requested: ```java @VisibleForTesting protected static Dimension getMaxLabelSize(final ScaleBarRenderSettings settings) { float maxLabelHeight = 0.0f; float maxLabelWidth = 0.0f; for (final Label label: settings.getLabels()) { maxLabelHeight ...
Create a Java method that does the following: "Gets the maximum size of the labels.".
Of course, here is the Java code you requested: ```java @Override public final void transitionsPlanned(long beforeVersion, long desiredVersion, boolean isSnapshotPlan, List<HollowConsumer.Blob.BlobType> transitionSequence) { updatePlanDetails.beforeVersion = beforeVersion; updatePlanDetails.desired...
Create a Java method that does the following: "Called by the HollowConsumer. Builder to update the overall refresh type.".
Of course, here is the Java code you requested: ```java public static boolean isConnected(Context context) { NetworkInfo info = Managers.connectivity(context).getActiveNetworkInfo(); return info != null && info.isConnected(); } ``` Hope this helps!
Create a Java method that does the following: "Check if the context is connected to a network.".
Of course, here is the Java code you requested: ```java @Override public void setSchemes(Map<String, List<String>> schemes) { clear(); putAll(schemes); } ``` Hope this helps!
Create a Java method that does the following: "Sets the schemes for this class.".
Of course, here is the Java code you requested: ```java private void mergeReleasedEntries(Segment segment, Segment compactSegment) { for (long i = segment.firstIndex(); i <= segment.lastIndex(); i++) { if (!segment.isLive(i)) { compactSegment.release(i); } } } ``` Hope this helps!
Create a Java method that does the following: "Merge released entries from a segment into a compact segment.".
Of course, here is the Java code you requested: ```java public final void ruleTerminalRule() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalXtext.g:1108:2: ( ( ( rule__TerminalRule__Group__0 ) ) ) // InternalXtext.g:1109:2: ( ( rule_...
Create a Java method that does the following: "Called to process a RuleTerminalRule".
Of course, here is the Java code you requested: ```java private static void setLegacy(String moduleName, String legacyParamName) { String oldValue = g_legacyToModuleMap.put(legacyParamName, moduleName); if (oldValue != null) { logger.warn("Legacy parameter name used twice: {}", legacyPar...
Create a Java method that does the following: "Sets the legacy parameter name for the given module name.".
Of course, here is the Java code you requested: ```java public void startForegroundIconRotateAnimation(final double fromAngle, final double toAngle, final int cycleCount, final double duration, final Interpolator interpolator, final boolean autoReverse) { stopForegroundIconRotateAnimation(); foreground...
Create a Java method that does the following: "Start a rotate animation on the foreground icon.".
Of course, here is the Java code you requested: ```java private String getSourceSetNameFromFile(File file) { Path absolutePath = Paths.get(file.getAbsolutePath()); Path basePath = Paths.get(task.getProject().file("src").getAbsolutePath()); return basePath.relativize(absolutePath).toString().split(Matcher....
Create a Java method that does the following: "Get source set name from file.".
Of course, here is the Java code you requested: ```java public SyncGroupInner update(String resourceGroupName, String serverName, String databaseName, String syncGroupName, SyncGroupInner parameters) { return updateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters)...
Create a Java method that does the following: "Updates a sync group.".
Of course, here is the Java code you requested: ```java protected void stopLayerTranslation() { if (mLayerTypeHardware) { mLayerTypeHardware = false; mContentContainer.setLayerType(View.LAYER_TYPE_NONE, null); mMenuContainer.setLayerType(View.LAYER_TYPE_NONE, null); ...
Create a Java method that does the following: "Stop layer translation.".
Of course, here is the Java code you requested: ```java public static <T,E> Collection<T> collectMany(Iterable<E> self, Collection<T> collector, @ClosureParams(FirstParam.FirstGenericType.class) Closure<Collection<? extends T>> projection) { for (E next : self) { collector.addAll(projection.call(ne...
Create a Java method that does the following: "Collects all elements from Iterable into Collection.".
Of course, here is the Java code you requested: ```java @Override public void nextNull() { int p = peeked; if (p == PEEKED_NONE) { p = doPeek(); } if (p == PEEKED_NULL) { peeked = PEEKED_NONE; } else { throw new IllegalStateException("Expected null but was " + peek() ...
Create a Java method that does the following: "This method is called to move to the next null.".
Of course, here is the Java code you requested: ```java private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException { // Note: This must be changed if any additional fields are defined Object a = s.readFields().get("array", null); if (a == nul...
Create a Java method that does the following: "Read the object from an input stream.".
Of course, here is the Java code you requested: ```java @Override protected void subAppend(E event) { // The roll-over check must precede actual writing. This is the // only correct behavior for time driven triggers. // We need to synchronize on triggeringPolicy so that only one rollover // occurs a...
Create a Java method that does the following: "Override append method to check if the event is a time driven event.".
Of course, here is the Java code you requested: ```java public E remove(int index) { RangeCheck(index); modCount++; E oldValue = (E) data[index]; int numMoved = size - index - 1; if (numMoved > 0) System.arraycopy(data, index + 1, data, index, numMoved); data[--size] = null; /...
Create a Java method that does the following: "Removes the element at the specified index.".
Of course, here is the Java code you requested: ```java public static Object[] toArray(final Object obj) { // if the object is an array, the cast and return it. if (obj instanceof Object[]) { return (Object[])obj; } // if the object is an array of primitives then wrap the array ...
Create a Java method that does the following: "Convert an object to an array of primitives.".
Of course, here is the Java code you requested: ```java void deleteColumn(int column) { if ((column >= columns) || (column < 0)) { throw new IndexOutOfBoundsException("getCell at illegal index : " + column); } columns--; boolean newReserved[] = new boolean[columns]; ...
Create a Java method that does the following: "Delete a column from the table.".
Of course, here is the Java code you requested: ```java @Override public CommerceAvailabilityEstimate findByUuid_Last(String uuid, OrderByComparator<CommerceAvailabilityEstimate> orderByComparator) throws NoSuchAvailabilityEstimateException { CommerceAvailabilityEstimate commerceAvailabilityEstimate = fetchByUu...
Create a Java method that does the following: "Returns the commerce availability estimate with the matching UUID and sorts the ordered set of commerce availability estimates.".
Of course, here is the Java code you requested: ```java public ICriterion<ReferenceClientParam> hasChainedProperty(String theResourceType, ICriterion<?> theCriterion) { return new ReferenceChainCriterion(getParamName(), theResourceType, theCriterion); } ``` Hope this helps!
Create a Java method that does the following: "Returns a predicate that accepts the reference of the given resource type which is chained to this reference.".
Of course, here is the Java code you requested: ```java public static List<String> getStrListValue(Map<String, Object> yamlObject, String key, boolean allowsEmpty) throws YamlConvertException { Object obj = getObjectValue(yamlObject, key, allowsEmpty); @SuppressWarnings("unchecked") ...
Create a Java method that does the following: "Get the string list value from a map.".
Of course, here is the Java code you requested: ```java @Override protected void initInputSource(WstxInputSource newInput, boolean isExt, String entityId) throws XMLStreamException { if (mFlattenWriter != null) { // Anything to flush from previous buffer contents? mFlatt...
Create a Java method that does the following: "Override method to initialize the XML input source.".
Of course, here is the Java code you requested: ```java @Override public Configuration getDriverConfiguration(final URI jobFolder, final String clientRemoteId, final String jobId, ...
Create a Java method that does the following: "Get Driver Configuration.".
Of course, here is the Java code you requested: ```java private GroupElement find_i(final String n, final boolean fwd) { if (name_equals(n)) { return this; } GroupElement e = null; Iterator it = elements.iterator(); while (it.hasNext()) { e = (GroupElement) it.next(); if (e.name_equals(n)) { retu...
Create a Java method that does the following: "Find a group element by name.".
Of course, here is the Java code you requested: ```java public void put(final E e, final long timeStamp) throws InterruptedException { final ReentrantLock lock = this.lock; lock.lockInterruptibly(); try { // mask is a.length - 1 while(timeStamp - this.timeStamp > mask) newSpaceAvailable.await(); final i...
Create a Java method that does the following: "Inserts the specified element into the queue.".
Of course, here is the Java code you requested: ```java @Handler(channels = NetworkChannel.class) public void onPurge(Purge event, IOSubchannel netChannel) { LinkedIOSubchannel.downstreamChannel(this, netChannel, WebAppMsgChannel.class).ifPresent(appChannel -> { appChannel.handl...
Create a Java method that does the following: "Handle a purge event.".
Of course, here is the Java code you requested: ```java public static TimeZone resolveTimeZone(Object timeZone) { if (timeZone instanceof String) { return TimeZone.getTimeZone((String) timeZone); } else if (timeZone instanceof TimeZone) { return (TimeZone) timeZone; ...
Create a Java method that does the following: "Resolves a TimeZone object.".
Of course, here is the Java code you requested: ```java private void addManifestEntry() throws IOException { ZipEntry entry = new ZipEntry(JarFile.MANIFEST_NAME); filesArchive.putNextEntry(entry); try { manifest.write(this); } finally { filesArchive.closeEntry(); manifest = null; } } ``` ...
Create a Java method that does the following: "Adds the manifest file to the archive.".
Of course, here is the Java code you requested: ```java public static String getSQLStatementRuleDefinitionFileName(final String rootDir, final DatabaseType databaseType) { return Joiner.on('/').join(rootDir, databaseType.name().toLowerCase(), SQL_STATEMENT_RULE_DEFINITION_FILE_NAME); } ``` Hope this helps...
Create a Java method that does the following: "Gets the SQL statement rule definition file name.".
Of course, here is the Java code you requested: ```java protected int computeAdornmentFlags(Object obj) { // try // { if (obj instanceof IVdmElement) { IVdmElement element = (IVdmElement) obj; int type = element.getElementType(); switch (type) { case IVdmElement.VDM_MODEL: case IVdmEle...
Create a Java method that does the following: "Compute the adornment flags for the given object.".
Of course, here is the Java code you requested: ```java public void eventProcessingSuccessful(ActivityHandle ah, FireableEventType arg1, Object arg2, Address ad, ReceivableService arg4, int arg5) { } ``` Hope this helps!
Create a Java method that does the following: "Called by the ActivityHandle when an event processing has been successful.".
Of course, here is the Java code you requested: ```java @Override public ListAccountSettingsResult listAccountSettings(ListAccountSettingsRequest request) { request = beforeClientExecution(request); return executeListAccountSettings(request); } ``` Hope this helps!
Create a Java method that does the following: "Retrieves a list of the settings for an account.".
Of course, here is the Java code you requested: ```java public static String commonPrefix(CharSequence a, CharSequence b) { checkNotNull(a); checkNotNull(b); int maxPrefixLength = Math.min(a.length(), b.length()); int p = 0; while (p < maxPrefixLength && a.charAt(p) == b.charAt(p)) { p++; ...
Create a Java method that does the following: "Returns the common prefix of two CharSequences.".
Of course, here is the Java code you requested: ```java @SuppressLint("NewApi") public static void allowCoreThreadTimeout(ThreadPoolExecutor executor, boolean value) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) { executor.allowCoreThreadTimeOut(value); } } ``` Hope this helps!
Create a Java method that does the following: "Allow core thread timeout.".
Of course, here is the Java code you requested: ```java public void put(final String aBucket, final String aKey, final AsyncFile aFile, final Handler<HttpClientResponse> aHandler) { final S3ClientRequest request = createPutRequest(aBucket, aKey, aHandler); final Buffer buffer = Buffer.buffe...
Create a Java method that does the following: "Performs an HTTP PUT operation on the S3 bucket with the specified key and file.".
Of course, here is the Java code you requested: ```java public ProxyDataSourceBuilder logSlowQueryByJUL(long thresholdTime, TimeUnit timeUnit) { return logSlowQueryByJUL(thresholdTime, timeUnit, null, null); } ``` Hope this helps!
Create a Java method that does the following: "Log a slow query by JUL.".
Of course, here is the Java code you requested: ```java public static MozuUrl deleteOptionUrl(String attributeFQN, Integer productTypeId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/attributedefinition/producttypes/{productTypeId}/Options/{attributeFQN}"); formatter.formatUrl("attr...
Create a Java method that does the following: "Get Resource Url for DeleteOption".
Of course, here is the Java code you requested: ```java public static String format(LogRecord logRecord) { final Cursor cursor = logRecord.getCursor(); return String.format(ASCIIDOCTOR_FULL_LOG_FORMAT, logRecord.getSeverity(), cursor.getFile(), cursor.getLineNumber(), logRecord.getMessage()); } ```...
Create a Java method that does the following: "Format a LogRecord to be used in an ASCII log file.".
Of course, here is the Java code you requested: ```java public void delete(String name) throws IOException { if (name.equalsIgnoreCase(DIGITAL_SIGNATURE)) { set(0,false); } else if (name.equalsIgnoreCase(NON_REPUDIATION)) { set(1,false); } else if (name.equalsIgnoreCase(...
Create a Java method that does the following: "Delete the attribute with the specified name.".
Of course, here is the Java code you requested: ```java public boolean containsKey(Object propertyName) { if (propertyName instanceof CharSequence) propertyName = propertyName.toString(); Assert.isInstanceOf(String.class, propertyName, "This map implementation only supports String based keys!"); ...
Create a Java method that does the following: "Checks if the specified property name is present in the map.".
Of course, here is the Java code you requested: ```java public void addFile( String loaderPath, URL file ) { List list = (List) filesMap.get(loaderPath); if (list == null) { list = new ArrayList(); filesMap.put( loaderPath, li...
Create a Java method that does the following: "Add a single file to the list of files.".
Of course, here is the Java code you requested: ```java public ParallelTaskBuilder setTargetHostsFromLineByLineText( String sourcePath, HostsSourceType sourceType) throws TargetHostsLoadException { this.targetHosts = targetHostBuilder.setTargetHostsFromLineByLineText(sourcePath, ...
Create a Java method that does the following: "setTargetHostsFromLineByLineText This method is used to set the targetHosts from line by line text.".
Of course, here is the Java code you requested: ```java protected Class<?> resolveClass(ObjectStreamClass v) throws IOException, ClassNotFoundException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); String className = v.getName(); try { // JDK 6, by ...
Create a Java method that does the following: "Resolves a class from the given ObjectStreamClass.".
Of course, here is the Java code you requested: ```java private static float bytesToFloat(byte b0, byte b1) { int mantissa = unsignedToSigned(unsignedByteToInt(b0) + ((unsignedByteToInt(b1) & 0x0F) << 8), 12); int exponent = unsignedToSigned(unsignedByteToInt(b1) >> 4, 4); retur...
Create a Java method that does the following: "Convert a byte array to a float.".
Of course, here is the Java code you requested: ```java public void mlsd(String path, DataSink sink) throws ServerException, ClientException, IOException { Command cmd = (path == null) ? new Command("MLSD") : new Command("MLSD", path); performTransfer(cmd, sink); } ...
Create a Java method that does the following: "Transfer a MLSD file to a DataSink.".
Of course, here is the Java code you requested: ```java public static ci[] get_filtered(nitro_service service, String filter) throws Exception{ ci obj = new ci(); options option = new options(); option.set_filter(filter); ci[] response = (ci[]) obj.getfiltered(service, option); return response; } ``` Hope ...
Create a Java method that does the following: "Use this API to fetch filtered set of ci resources. set the filter parameter values in filter parameter value.".
Of course, here is the Java code you requested: ```java @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case SimpleAntlrPackage.OPTION_VALUE__KEY: return getKey(); case SimpleAntlrPackage.OPTION_VALUE__VALUE: return getValue(...
Create a Java method that does the following: "Override eGet to return the value of a CID .".
Of course, here is the Java code you requested: ```java public void setupProxy() throws InvalidProxyException { // are we running through a proxy if (Property.isProxySet()) { // set the proxy information Proxy proxy = new Proxy(); proxy.setHttpProxy(Property.getProxy...
Create a Java method that does the following: "Sets up the proxy information".
Of course, here is the Java code you requested: ```java protected Method getExceptionHandlerMethod( FlowControllerHandlerContext context, String methodName, Throwable ex, Object formBean ) { FlowController flowController = context.getFlowController(); ...
Create a Java method that does the following: "Gets the exception handler method.".
Of course, here is the Java code you requested: ```java public <T extends Widget & Checkable> List<T> getCheckedWidgets() { List<T> checked = new ArrayList<>(); for (Widget c : getChildren()) { if (c instanceof Checkable && ((Checkable) c).isChecked()) { checked.add((T) c);...
Create a Java method that does the following: "Gets the list of Checkable widgets that are checked.".
Of course, here is the Java code you requested: ```java @Override public ConfigBuilder withSources(ConfigSource... sources) { synchronized (this) { for (ConfigSource source : sources) { addSource(source); } } return this; } ``` Hope this helps!
Create a Java method that does the following: "Add multiple sources to the configuration.".
Of course, here is the Java code you requested: ```java public static String getLastXpathElement(String path) { int pos = path.lastIndexOf('/'); if (pos >= 0) { path = path.substring(pos + 1); } return CmsXmlUtils.removeXpathIndex(path); } ``` Hope this helps!
Create a Java method that does the following: "Get the last XPATH element of a path.".
Of course, here is the Java code you requested: ```java public int setReplacement(byte[] str, int p, int len, byte[] encname) { byte[] encname2 = encodingToInsertOutput(); final byte[] str2; final int p2 = 0; final int len2; if (encname2.length == 0 || caseInsensitiveEq...
Create a Java method that does the following: "Sets the replacement string and length.".
Of course, here is the Java code you requested: ```java private static void writeMetricsProperties(final XmlSerializer xmlw, final MetricsProperties metrics, final String metricsName) throws IllegalArgumentException, IllegalStateException, IOException { Utility.assertNotNull("metrics.Configuration"...
Create a Java method that does the following: "Write the metrics properties.".
Of course, here is the Java code you requested: ```java public int bin( double col_data ) { if(Double.isNaN(col_data)) return _nbin; // NA bucket if (Double.isInfinite(col_data)) // Put infinity to most left/right bin if (col_data<0) return 0; else return _nbin-1; assert _min <= col_data && col...
Create a Java method that does the following: "Bin the data in the table.".
Of course, here is the Java code you requested: ```java @Nullable private static <T> T resolveAttribute(String attributeName, Class<T> type) { String getter = readProperty(attributeName); if (getter == null) { return null; } int idx = getter.indexOf('#'); if (idx <= 0 || idx == getter.lengt...
Create a Java method that does the following: "Resolves an attribute.".
Of course, here is the Java code you requested: ```java private Environment switchEnvironment(Environment env) { Environment prev = currentEnvironment; currentEnvironment = env; return prev; } ``` Hope this helps!
Create a Java method that does the following: "Switch the environment.".
Of course, here is the Java code you requested: ```java public void registerWorkspace(final WorkspaceEntry wsConfig) throws RepositoryException, RepositoryConfigurationException { // Need privileges to manage repository. SecurityManager security = System.getSecurityManager(); if (security !=...
Create a Java method that does the following: "Register workspace.".
Of course, here is the Java code you requested: ```java private static int getType(int ch) { if (UCharacterUtility.isNonCharacter(ch)) { // not a character we return a invalid category count return NON_CHARACTER_; } int result = UCharacter.getType(ch); if (re...
Create a Java method that does the following: "getType returns the type of the given character".
Of course, here is the Java code you requested: ```java private static Map<String, String> parseAttributes(String attrString) throws ParseException { AttributeString str = new AttributeString(attrString); Map<String, String> attributes = Maps.newLinkedHashMapWithExpectedSize(4); //Preserve order... ...
Create a Java method that does the following: "Parse the attribute string.".
Of course, here is the Java code you requested: ```java private synchronized void loadLookup() { if (lookup != null) return; Object[][] contents = getContents(); HashMap<String,Object> temp = new HashMap<>(contents.length); for (int i = 0; i < contents.length; ++i) { ...
Create a Java method that does the following: "Load the lookup.".
Of course, here is the Java code you requested: ```java public void buildClassConstantSummary(XMLNode node, Content summariesTree) { ClassDoc[] classes = currentPackage.name().length() > 0 ? currentPackage.allClasses() : configuration.classDocCatalog.allClasses( DocletCo...
Create a Java method that does the following: "Build the class constant summary.".
Of course, here is the Java code you requested: ```java public boolean skipString(String s) throws IOException { // load more characters, if needed if (fCurrentEntity.position == fCurrentEntity.count) { load(0, true); } // skip string final int length = s.length(); for (int i = 0; i < length; i++) { ...
Create a Java method that does the following: "Skips a string.".
Of course, here is the Java code you requested: ```java public List<MicrodataItem> getItems(String type) { List<WebElement> elements = driver.findElements(byItemType(newUrl(type))); return Lists.transform(elements, new Function<WebElement, MicrodataItem>() { public MicrodataItem apply(WebElement element) ...
Create a Java method that does the following: "Gets all microdata items of a given type.".
Of course, here is the Java code you requested: ```java public static List<String> getColumnLabels(ResultSet resultSet) { return Lists.transform( Lists.newArrayList(resultSet.getColumnTypes()), new Function<ColumnType, String>() { public String apply(ColumnType input) { return input.getLabelN...
Create a Java method that does the following: "Get the column labels from a resultSet".
Of course, here is the Java code you requested: ```java private static String getIconInnerHTML( CmsResourceUtil resUtil, Resource iconResource, CmsResourceState state, boolean showLocks, boolean showDetailIcon) { String content; if (iconResource instanceof FontI...
Create a Java method that does the following: "Returns the icon inner HTML.".
Of course, here is the Java code you requested: ```java public void cancelAll(final Object tag) { if (tag == null) { throw new IllegalArgumentException("Cannot cancelAll with a null tag"); } cancelAll(new RequestFilter() { @Override public boolean apply(Reque...
Create a Java method that does the following: "Cancel all requests with the specified tag.".
Of course, here is the Java code you requested: ```java private void importSingleFile(String file, String toplevelCorpusName, long corpusRef) { BinaryImportHelper preStat = new BinaryImportHelper(file, getRealDataDir(), toplevelCorpusName, corpusRef, mimeTypeMapping); getJdbcTemplate().execu...
Create a Java method that does the following: "Import a single file into the database.".
Of course, here is the Java code you requested: ```java public static void writeClassMethod(final File srcDir, final Class<?> cls) { writeClassMethod(srcDir, cls, false, false, false, null, null, Objects.class); } ``` Hope this helps!
Create a Java method that does the following: "Write class method.".
Of course, here is the Java code you requested: ```java private void copy(@IntRange(from = 0) int start, @IntRange(from = 0) int end) { MentionsEditable text = getMentionsText(); SpannableStringBuilder copiedText = (SpannableStringBuilder) text.subSequence(start, end); MentionSpan[] spans = tex...
Create a Java method that does the following: "Copy a range of MentionsEditable to the clipboard.".
Of course, here is the Java code you requested: ```java public int getTransactionCount() { if (isFiltered()) { int ltransactionCount = transactionCount; if (ltransactionCount < 0) { ltransactionCount = 0; for (int i = filteredBlock.getFilteredTransactio...
Create a Java method that does the following: "Gets the number of transactions in this block.".
Of course, here is the Java code you requested: ```java @Nullable public static BigDecimal parseCurrencyFormat (@Nullable final ECurrency eCurrency, @Nullable final String sTextValue, @Nullable final BigDecimal aDefault) ...
Create a Java method that does the following: "Parse the currency format.".
Of course, here is the Java code you requested: ```java @Override public long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection) { return commerceShippingFixedOptionPersistence.countWithDynamicQuery(dynamicQuery, projection); } ``` Hope this helps!
Create a Java method that does the following: "Executes the dynamic query on the database and returns the number of rows matching the query.".
Of course, here is the Java code you requested: ```java public long getCount(long toWhen, long period, TimeUnit unit) { return getCount(toWhen - TimeUnit.MILLISECONDS.convert(period, unit), toWhen); } ``` Hope this helps!
Create a Java method that does the following: "Gets the count of the items in the cache.".
Of course, here is the Java code you requested: ```java @Override @DefinedBy(Api.COMPILER_TREE) @SuppressWarnings("fallthrough") public Void visitAttribute(AttributeTree tree, Void ignore) { HtmlTag currTag = tagStack.peek().tag; if (currTag != null) { Name name = tree.getName(); ...
Create a Java method that does the following: "Visit an attribute.".