code
stringlengths
146
48.7k
prompt
stringlengths
55
1.51k
Of course, here is the Java code you requested: ```java public void setInstanceIdSet(java.util.Collection<String> instanceIdSet) { if (instanceIdSet == null) { this.instanceIdSet = null; return; } this.instanceIdSet = new com.amazonaws.internal.SdkInternalList<String>(i...
Create a Java method that does the following: "Sets the value instanceIdSet.".
Of course, here is the Java code you requested: ```java private void stopInternal (boolean notifypeer) throws SISessionUnavailableException, SISessionDroppedException, SIConnectionUnavailableException, SIConnectionDroppedException, ...
Create a Java method that does the following: "Stop the session.".
Of course, here is the Java code you requested: ```java public static <T> void mergeFrom(InputStream in, T message, Schema<T> schema, XMLInputFactory inFactory) throws IOException { XMLStreamReader parser = null; try { parser = inFactory.createXMLStreamReader(i...
Create a Java method that does the following: "Merges the specified XML message with the specified schema.".
Of course, here is the Java code you requested: ```java @Override void setVisibility(boolean visibility) { if (isVisible && !visibility) { // make the X cursor invisible xLib.XDefineCursor(xdisplay, xwindow, transparentCursor); MonocleWindowManager.getInstance().repaintA...
Create a Java method that does the following: "Override the visibility of the CRA.".
Of course, here is the Java code you requested: ```java public ProviderInfo setStaticAttr(String staticAttrKey, String staticAttrValue) { if (staticAttrValue == null) { staticAttrs.remove(staticAttrKey); } else { staticAttrs.put(staticAttrKey, staticAttrValue); } ...
Create a Java method that does the following: "Sets the static attribute value.".
Of course, here is the Java code you requested: ```java protected JKTableRecord createEmptyRecord() { final JKTableRecord record = new JKTableRecord(); record.addEmptyValues(this.tableColumns); record.setStatus(RecordStatus.NEW); return record; } ``` Hope this helps!
Create a Java method that does the following: "Create an empty table record.".
Of course, here is the Java code you requested: ```java public static int getRealLeft(boolean isRtl, int parentLeft, int parentWidth, int left, int width) { if (isRtl) { // 1, trim the parent's left. left -= parentLeft; // 2, calculate the RTL left. left = parent...
Create a Java method that does the following: "Gets the real left value.".
Of course, here is the Java code you requested: ```java public static Object unwrapFormBean( ActionForm form ) { if ( form == null ) return null; if ( form instanceof AnyBeanActionForm ) { return ( ( AnyBeanActionForm ) form ).getBean(); } return form; } ``...
Create a Java method that does the following: "Unwraps a action form bean.".
Of course, here is the Java code you requested: ```java public static List<CommerceWarehouseItem> findByCPI_CPIU(long CProductId, String CPInstanceUuid) { return getPersistence().findByCPI_CPIU(CProductId, CPInstanceUuid); } ``` Hope this helps!
Create a Java method that does the following: "Returns all the commerce warehouse items where CProductId = &#63 ; and CPInstanceUuid = &#63 ;.".
Of course, here is the Java code you requested: ```java public static List<Disk> getDisks(Connect connect, Document domainXml) { try { List<Disk> ret = new ArrayList<>(); XPathFactory xpf = XPathFactory.instance(); XPathExpression<Element> diskExpr = xpf.compile(XPATH_DISK, ...
Create a Java method that does the following: "Get the disks from the domain. xml.".
Of course, here is the Java code you requested: ```java public Observable<BgpPeerStatusListResultInner> beginGetBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { return beginGetBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer)....
Create a Java method that does the following: "Get the status of a BGP peer.".
Of course, here is the Java code you requested: ```java public Collection<FileAnnotation> parse(final File file, final String moduleName) throws InvocationTargetException { String oldProperty = System.getProperty(SAX_DRIVER_PROPERTY); if (oldProperty != null) { System.setProperty(SAX_DRIVER...
Create a Java method that does the following: "Parses the given file and returns a collection of duplicate code annotations.".
Of course, here is the Java code you requested: ```java public void initAllLoadedPlugins() throws PluginException { LOGGER.debug("Initializig all loaded plugins"); for (Class<? extends Plugin> pluginClass : implementations.keySet()) { Set<PluginContext> set = implementations.get(pluginClass); for (PluginCont...
Create a Java method that does the following: "Initialize all loaded plugins.".
Of course, here is the Java code you requested: ```java public List<FacesConfigFactoryType<WebFacesConfigDescriptor>> getAllFactory() { List<FacesConfigFactoryType<WebFacesConfigDescriptor>> list = new ArrayList<FacesConfigFactoryType<WebFacesConfigDescriptor>>(); List<Node> nodeList = model.get("factor...
Create a Java method that does the following: "Get all Factory".
Of course, here is the Java code you requested: ```java private void deleteTable(String datasetId, String tableId) throws IOException, InterruptedException { executeWithBackOff( client.tables().delete(projectId, datasetId, tableId), String.format( "Error when trying to delete the ...
Create a Java method that does the following: "Delete a temporary table.".
Of course, here is the Java code you requested: ```java public static IAtom[] getAtomArray(List<IAtom> list) { IAtom[] ret = new IAtom[list.size()]; for (int i = 0; i < ret.length; ++i) ret[i] = list.get(i); return ret; } ``` Hope this helps!
Create a Java method that does the following: "Get an array of atoms from a list of atoms.".
Of course, here is the Java code you requested: ```java @Override public Long getMaximumFinish() { calculator(); if (simple) { return v[3]; } else { Weight maxFinish = cn.getMaximumFinish(); return maxFinish.isInfinity() ? null : maxFinish.value(); ...
Create a Java method that does the following: "Gets the maximum finish value.".
Of course, here is the Java code you requested: ```java public ConditionalEventDefinition parseIntermediateConditionalEventDefinition(Element element, ActivityImpl conditionalActivity) { conditionalActivity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.INTERMEDIATE_EVENT_CONDITIONAL); ConditionalEven...
Create a Java method that does the following: "Parses an intermediate conditional event definition.".
Of course, here is the Java code you requested: ```java @Override public double plus(double w1, double w2) { if (!isMember(w1) || !isMember(w2)) { return Double.NEGATIVE_INFINITY; } return w1 + w2; } ``` Hope this helps!
Create a Java method that does the following: "Add two vectors.".
Of course, here is the Java code you requested: ```java public void setSuppressReload(boolean suppress, String className) { if (mSuppressReloadMap == null) { mSuppressReloadMap = new HashMap<String, Boolean>(); } mSuppressReloadMap.put(className, suppress); } ``` Hope this...
Create a Java method that does the following: "Sets whether reloading of a class should be suppressed.".
Of course, here is the Java code you requested: ```java public synchronized static Set<MeasureUnit> getAvailable() { Set<MeasureUnit> result = new HashSet<MeasureUnit>(); for (String type : new HashSet<String>(MeasureUnit.getAvailableTypes())) { for (MeasureUnit unit : MeasureUnit.getAvaila...
Create a Java method that does the following: "Get the set of available MeasureUnit objects.".
Of course, here is the Java code you requested: ```java public com.google.api.ads.admanager.axis.v201805.ArchiveStatus getArchiveStatus() { return archiveStatus; } ``` Hope this helps!
Create a Java method that does the following: "Gets the archiveStatus value for this CIDCTYPE.".
Of course, here is the Java code you requested: ```java public void setUserDateCreated(String userDateCreated) { try { m_userDateCreated = convertTimestamp(userDateCreated); } catch (Throwable e) { setThrowable(e); } } ``` Hope this helps!
Create a Java method that does the following: "Sets the userDateCreated property.".
Of course, here is the Java code you requested: ```java public OmemoMessage.Received decrypt(BareJid sender, OmemoElement omemoElement) throws SmackException.NotLoggedInException, CorruptedOmemoKeyException, NoRawSessionException, CryptoFailedException { LoggedInOmemoManager managerGuar...
Create a Java method that does the following: "Decrypt a message.".
Of course, here is the Java code you requested: ```java public DescribeDBLogFilesResult withDescribeDBLogFiles(DescribeDBLogFilesDetails... describeDBLogFiles) { if (this.describeDBLogFiles == null) { setDescribeDBLogFiles(new com.amazonaws.internal.SdkInternalList<DescribeDBLogFilesDetails>(descri...
Create a Java method that does the following: "Adds the describeDBLogFiles value for this DBLogFile.".
Of course, here is the Java code you requested: ```java public void setLayerDigests(java.util.Collection<String> layerDigests) { if (layerDigests == null) { this.layerDigests = null; return; } this.layerDigests = new java.util.ArrayList<String>(layerDigests); } ``` ...
Create a Java method that does the following: "Sets the value of the layerDigests property.".
Of course, here is the Java code you requested: ```java public PaymentMethod attach(Map<String, Object> params) throws StripeException { return attach(params, (RequestOptions) null); } ``` Hope this helps!
Create a Java method that does the following: "Attaches a PaymentMethod to a Customer.".
Of course, here is the Java code you requested: ```java public long getCount(Date fromWhen, Date toWhen, boolean fromInclusive, boolean toInclusive) { return getCount(fromWhen.getTime(), toWhen.getTime(), true, false); } ``` Hope this helps!
Create a Java method that does the following: "Gets the count of the items in the table.".
Of course, here is the Java code you requested: ```java public static Image createRectangleImage(String id, String url, double horMargin, double verMargin, double width, double height) { Image i = new Image(id); i.setHref(url); i.setStyle(new PictureStyle(1)); i.setBounds(new Bbox(horMargin, verMargin, wid...
Create a Java method that does the following: "Create a rectangle image.".
Of course, here is the Java code you requested: ```java @BetaApi public final Operation getZoneOperation(ProjectZoneOperationName operation) { GetZoneOperationHttpRequest request = GetZoneOperationHttpRequest.newBuilder() .setOperation(operation == null ? null : operation.toString()) ...
Create a Java method that does the following: "Gets the ZoneOperation for the specified resource.".
Of course, here is the Java code you requested: ```java public MetadataBuilder addExecuteBefore(Class<? extends RuleProvider> type) { if (type != null) { executeBefore.add(type); } return this; } ``` Hope this helps!
Create a Java method that does the following: "Add a rule provider to the execute before list.".
Of course, here is the Java code you requested: ```java @Override public Expression<Number> quot(Expression<? extends Number> arg0, Expression<? extends Number> arg1) { // TODO Auto-generated method stub return null; } ``` Hope this helps!
Create a Java method that does the following: "Method to construct the quot expression for a single authority segment.".
Of course, here is the Java code you requested: ```java public static int methodHash(Object runner, FrameworkMethod method) { return ((Thread.currentThread().hashCode() * 31) + runner.hashCode()) * 31 + method.hashCode(); } ``` Hope this helps!
Create a Java method that does the following: "Returns the hash code of a method.".
Of course, here is the Java code you requested: ```java public float [] [] copyValues2D () { final float v[][] = new float [m_nRows] [m_nCols]; for (int r = 0; r < m_nRows; ++r) { for (int c = 0; c < m_nCols; ++c) { v[r][c] = m_aValues[r][c]; } } return v; } ``` Hop...
Create a Java method that does the following: "Copy the values of this object to a 2D array.".
Of course, here is the Java code you requested: ```java public final int genExemptionBlob(byte[] output) throws IllegalStateException, ShortBufferException, ExemptionMechanismException { if (!initialized) { throw new IllegalStateException ("ExemptionMechanism not...
Create a Java method that does the following: "Generate an EXemptionMechanism s EXemption Blob.".
Of course, here is the Java code you requested: ```java public CmsUrlNameMappingFilter filterName(String name) { if (name == null) { throw new IllegalArgumentException(); } CmsUrlNameMappingFilter result = new CmsUrlNameMappingFilter(this); result.m_name = name; ret...
Create a Java method that does the following: "Returns a new filter with the specified name.".
Of course, here is the Java code you requested: ```java public Map<String, Object> getSpec() { return ImmutableMap.<String, Object>of( "ioConfig", getIoConfig(), "dataSchema", getDataSchema(), "tuningConfig", getTuningConfig()); } ``` Hope this helps!
Create a Java method that does the following: "Returns a map of the IDE specification.".
Of course, here is the Java code you requested: ```java private void launch( final LauncherInfo info ) throws MojoExecutionException, MojoFailureException { final String command; final int debugPort = findDebugPort(); command = String.format( "am start %s-n %s/%s", debugPort >= 0 ...
Create a Java method that does the following: "Launches the application.".
Of course, here is the Java code you requested: ```java protected void writeUTF(int code, String string) throws IOException { OutputStream os = getOutputStream(); os.write(code); int charLength = string.length(); int length = 0; for (int i = 0; i < charLength; i++...
Create a Java method that does the following: "Write UTF - 8 code and string to the output stream.".
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM) public final Observable<T> timeout(long timeout, TimeUnit timeUnit, Scheduler scheduler, ObservableSource<? extends T> other) { ObjectHelper.requireNonNull(other, "other is null"); ...
Create a Java method that does the following: "Timeout the other Observable source.".
Of course, here is the Java code you requested: ```java protected String getResourceSetUriLocation(final ResourceSet saved) { return getUmaConfigurationContext().getCasProperties() .getAuthn().getUma().getIssuer() + OAuth20Constants.BASE_OAUTH20_URL + '/' + OAuth20Constants....
Create a Java method that does the following: "Gets the resource set uri location.".
Of course, here is the Java code you requested: ```java public static void runExample( AdManagerServices adManagerServices, AdManagerSession session, String emailAddress) throws RemoteException { UserServiceInterface userService = adManagerServices.get(session, UserServiceInterface.class); // Crea...
Create a Java method that does the following: "Example of how to get a user list by email address.".
Of course, here is the Java code you requested: ```java public <T> T execute(Callable<T> statements) throws Exception { try (HibernateTransaction tx = start().withAutoRollback()) { final T ret = statements.call(); // Success, perform a TX commit tx.commit(); return ret; } } ``` Hope this helps!
Create a Java method that does the following: "Execute a Callable in a transaction.".
Of course, here is the Java code you requested: ```java public static vpntrafficpolicy_vpnglobal_binding[] get(nitro_service service, String name) throws Exception{ vpntrafficpolicy_vpnglobal_binding obj = new vpntrafficpolicy_vpnglobal_binding(); obj.set_name(name); vpntrafficpolicy_vpnglobal_binding response[]...
Create a Java method that does the following: "Use this API to fetch vpntrafficpolicy_vpnglobal_binding resources of given name.".
Of course, here is the Java code you requested: ```java @Nonnull public static LByteToCharFunction byteToCharFunctionFrom(Consumer<LByteToCharFunctionBuilder> buildingFunction) { LByteToCharFunctionBuilder builder = new LByteToCharFunctionBuilder(); buildingFunction.accept(builder); return builder.build(); } `...
Create a Java method that does the following: "Creates a byte to char function from the given consumer.".
Of course, here is the Java code you requested: ```java private double getMomentumFromConfig(Map<String, Object> layerConfig) throws InvalidKerasConfigurationException { Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf); if (!innerConfig.containsKey(LAYE...
Create a Java method that does the following: "Get BatchNormalization momentum from Keras BatchNormalization layer configuration.".
Of course, here is the Java code you requested: ```java private void createIndexes(Table t) { for (String indexName : t.getIndexHoldersByName().keySet()) { if (!indexName.startsWith("PRIMARY")) { createIndex(t, t.getIndexHolderByName(indexName)); } } } ``` H...
Create a Java method that does the following: "Create indexes for the table.".
Of course, here is the Java code you requested: ```java public SchemaRepositoryModelBuilder addSchemaReference(String schemaId) { SchemaRepositoryModel.Schemas.Reference schemaRef = new SchemaRepositoryModel.Schemas.Reference(); schemaRef.setSchema(schemaId); if (model.getSchemas() == null) { ...
Create a Java method that does the following: "Add a schema reference to the schema repository.".
Of course, here is the Java code you requested: ```java public static boolean isObjectType(Class<?> cls) { FieldType fieldType = TYPE_MAPPING.get(cls); if (fieldType != null) { return false; } return true; } ``` Hope this helps!
Create a Java method that does the following: "Returns true if the given class is an object type.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") @Override public EList<IfcComplexPropertyTemplate> getPartOfComplexTemplate() { return (EList<IfcComplexPropertyTemplate>) eGet( Ifc4Package.Literals.IFC_PROPERTY_TEMPLATE__PART_OF_COMPLEX_TEMPLATE, true); } ``` Hope ...
Create a Java method that does the following: "Gets the part of complex template.".
Of course, here is the Java code you requested: ```java public void executeActivitiesConcurrent(List<PvmActivity> activityStack, PvmActivity targetActivity, PvmTransition targetTransition, Map<String, Object> variables, Map<String, Object> localVariables, ...
Create a Java method that does the following: "Execute the activities in a concurrent manner.".
Of course, here is the Java code you requested: ```java public Assignments cluster(Matrix m, int maxClusters, Properties props) { int startSize = Integer.parseInt(props.getProperty( NUM_CLUSTERS_START, DEFAULT_NUM_CLUSTERS_START)); ...
Create a Java method that does the following: "Cluster a matrix m using the TfIdfDocStriped transform.".
Of course, here is the Java code you requested: ```java public List<CmsUser> getManageableUsers(CmsObject cms, String ouFqn, boolean includeSubOus, boolean includeWebusers) throws CmsException { List<CmsOrganizationalUnit> ous = getManageableOrgUnits(cms, ouFqn, includeSubOus, includeWebusers); Li...
Create a Java method that does the following: "Returns a list of users from the given organizational unit.".
Of course, here is the Java code you requested: ```java @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case SarlPackage.SARL_ACTION__FIRED_EVENTS: return getFiredEvents(); } return super.eGet(featureID, resolve, coreType); } ``` Hope this helps!
Create a Java method that does the following: "Replies the value of the feature.".
Of course, here is the Java code you requested: ```java public static byte[] xorAlignRight(byte[] b1, byte[] b2) { if (b1.length > b2.length) { byte[] b2_ = new byte[b1.length]; System.arraycopy(b2, 0, b2_, b1.length - b2.length, b2.length); b2 = b2_; } else if (b2.l...
Create a Java method that does the following: "XOR align right.".
Of course, here is the Java code you requested: ```java protected ConditionalEventDefinition parseConditionalEventDefinition(Element element, ActivityImpl conditionalActivity) { ConditionalEventDefinition conditionalEventDefinition = null; Element conditionExprElement = element.element(CONDITION); if (con...
Create a Java method that does the following: "Parses a conditional event definition.".
Of course, here is the Java code you requested: ```java public static Money total(CurrencyUnit currency, Iterable<Money> monies) { return Money.zero(currency).plus(monies); } ``` Hope this helps!
Create a Java method that does the following: "Returns a Money that is the total of the given monies in the given currency.".
Of course, here is the Java code you requested: ```java private static void setValue(Object target, String field, Object value) { // TODO: Should we do this for all numbers, not just '0'? if ("0".equals(field)) { if (!(target instanceof Collection)) { throw new IllegalArgum...
Create a Java method that does the following: "Sets the value of a single field in the target object.".
Of course, here is the Java code you requested: ```java public static <E> List<E> listify(ObjectMapper mapper, Object source, Class<E> targetElementType) { return (List<E>) collectify(mapper, source, List.class, targetElementType); } ``` Hope this helps!
Create a Java method that does the following: "Collect a list of objects from a source object to a target element type.".
Of course, here is the Java code you requested: ```java @Override public void setOwner(Path p, String username, String groupname ) throws IOException { if (username == null && groupname == null) { throw new IOException("username == null && groupname == null"); } if (username == null) { ...
Create a Java method that does the following: "Set the owner of a file.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") @Override public EList<Double> getOffsetDistances() { return (EList<Double>) eGet(Ifc4Package.Literals.IFC_VIRTUAL_GRID_INTERSECTION__OFFSET_DISTANCES, true); } ``` Hope this helps!
Create a Java method that does the following: "Gets the value of the OffsetDistances property.".
Of course, here is the Java code you requested: ```java public Jdbi build(Environment environment, PooledDataSourceFactory configuration, String name) { final ManagedDataSource dataSource = configuration.build(environment.metrics(), name); return build(enviro...
Create a Java method that does the following: "Build a managed data source.".
Of course, here is the Java code you requested: ```java public IMatrix add(IMatrix b) { IMatrix result = new IMatrix(rows, columns); add(b, result); return result; } ``` Hope this helps!
Create a Java method that does the following: "Add a matrix to this matrix.".
Of course, here is the Java code you requested: ```java private boolean genProxyCovariantBridgeMethod( DynamicFunctionSymbol dfs, DynamicFunctionSymbol superDfs ) { IGosuClassInternal superType = (IGosuClassInternal)superDfs.getScriptPart().getContainingType(); if( superType.isProxy() ) { IJavaType...
Create a Java method that does the following: "Gen proxy covariant bridge method.".
Of course, here is the Java code you requested: ```java public <T> T deserialize(final InputStream stream, final int bufferSize) { ByteBufferInput in = new ByteBufferInput(stream, bufferSize); Kryo kryo = borrow(); try { @SuppressWarnings("unchecked") T obj = (T) kryo.readClassAndObject(in); ...
Create a Java method that does the following: "Deserialize a single object from an input stream.".
Of course, here is the Java code you requested: ```java private CmsAcceptDeclineCancelDialog getLeaveDialog() { StringBuffer message = new StringBuffer(); message.append("<p>" + Messages.get().key(Messages.GUI_DIALOG_LEAVE_NOT_SAVED_0) + "</p>"); message.append("<p>" + Messages.get().key(Messa...
Create a Java method that does the following: "Get the leave dialog.".
Of course, here is the Java code you requested: ```java public boolean addTagPreserve(final Tag tag) { boolean result = false; String tagName = tag.getTagName(); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(tagName)) { result = m_visibleTags.add(tagName.toLowerCase()); } ...
Create a Java method that does the following: "Add a tag to the list of visible tags.".
Of course, here is the Java code you requested: ```java public static void copyFile(File from, File to) throws IOException { InputStream in = new BufferedInputStream(new FileInputStream(from)); try { OutputStream out = new BufferedOutputStream(new FileOutputStream(to)); try { ...
Create a Java method that does the following: "Copy a file from one file to another.".
Of course, here is the Java code you requested: ```java public static Front getInvertedFront(Front front) { if (front == null) { throw new NullFrontException(); } else if (front.getNumberOfPoints() == 0) { throw new EmptyFrontException(); } int numberOfDimensions = front.getPoint(0).getDim...
Create a Java method that does the following: "Get the inverted front.".
Of course, here is the Java code you requested: ```java public ByteMatchSet withByteMatchTuples(ByteMatchTuple... byteMatchTuples) { if (this.byteMatchTuples == null) { setByteMatchTuples(new java.util.ArrayList<ByteMatchTuple>(byteMatchTuples.length)); } for (ByteMatchTuple ele : b...
Create a Java method that does the following: "A list of ByteMatchTuple objects.".
Of course, here is the Java code you requested: ```java public static Object createJsonpProvider() { JsonProvider jsonProvider = AccessController.doPrivileged(new PrivilegedAction<JsonProvider>(){ @Override public JsonProvider run() { try { Bundle b = Fr...
Create a Java method that does the following: "Create a new instance of the JsonProvider class.".
Of course, here is the Java code you requested: ```java public void finish() { if (mAccountAuthenticatorResponse != null) { // send the result bundle back if set, otherwise send an error. if (mResultBundle != null) { mAccountAuthenticatorResponse.onResult(mResultBundle);...
Create a Java method that does the following: "Finishes the application.".
Of course, here is the Java code you requested: ```java public RestClientResponse execute(AsyncHttpClient.BoundRequestBuilder requestBuilder) throws RestClientException { Response response; try { ListenableFuture<Response> futureResponse = requestBuilder.execute(); response = futureResponse.get();...
Create a Java method that does the following: "Execute the given request builder and return the result.".
Of course, here is the Java code you requested: ```java @Deprecated @DeprecatedSince("3.8.0") @ReplaceWith("build().awaitReady()") public JDA buildBlocking() throws LoginException, InterruptedException { return buildBlocking(Status.CONNECTED); } ``` Hope this helps!
Create a Java method that does the following: "Build a block of code blocking.".
Of course, here is the Java code you requested: ```java @Override public void init(FilterConfig filterConfig) throws ServletException { super.init(filterConfig); int compressionMinSize = readInt(filterConfig.getInitParameter(INIT_PARAM_COMPRESSION_THRESHOLD), this.compressionThreshold); lo...
Create a Java method that does the following: "Override init method to set the appropriate parameters.".
Of course, here is the Java code you requested: ```java public File getFile() { File file = (File)this.getSource(); if(file != null) FileMonitor.waitFor(file); return file; } ``` Hope this helps!
Create a Java method that does the following: "Get the file object from the source file.".
Of course, here is the Java code you requested: ```java public UserImpl readUser(Node userNode) throws Exception { UserImpl user = new UserImpl(userNode.getName()); Date creationDate = utils.readDate(userNode, UserProperties.JOS_CREATED_DATE); Date lastLoginTime = utils.readDate(userNode, UserPro...
Create a Java method that does the following: "Read User object from the node.".
Of course, here is the Java code you requested: ```java private boolean isOsgiApp(IServletContext isc) { Object bundleCtxAttr = isc.getAttribute(BUNDLE_CONTEXT_KEY); Tr.debug(tc, "Servet context attr for key = " + BUNDLE_CONTEXT_KEY + ", = " + bundleCtxAttr); if (bundleCtxAttr != null) { ...
Create a Java method that does the following: "is the servlet context an OSGi application?".
Of course, here is the Java code you requested: ```java public T addPropertiesFile(final Path file) { if (file != null) { if (Files.notExists(file)) { throw LauncherMessages.MESSAGES.pathDoesNotExist(file); } if (!Files.isRegularFile(file)) { ...
Create a Java method that does the following: "Add a properties file to the server.".
Of course, here is the Java code you requested: ```java public ServerUpdater setVoiceChannel(User user, ServerVoiceChannel channel) { delegate.setVoiceChannel(user, channel); return this; } ``` Hope this helps!
Create a Java method that does the following: "Sets the voice channel for the specified user.".
Of course, here is the Java code you requested: ```java protected void loadCipherToBit() { boolean keySizeFromCipherMap = Boolean.valueOf(WebContainer.getWebContainerProperties().getProperty("com.ibm.ws.webcontainer.keysizefromciphermap", "true")).booleanValue(); //721610 ...
Create a Java method that does the following: "loadCipherToBit This method loads the ssl cipher suite bit sizes properties file in the ssl bitsizes. properties file.".
Of course, here is the Java code you requested: ```java private boolean isTryRecoverSucceeded(ConcurrentMap<Integer, Long> brokenSequences) { int numberOfBrokenSequences = brokenSequences.size(); InvokerWrapper invokerWrapper = context.getInvokerWrapper(); SubscriberContext subscriberContext = ...
Create a Java method that does the following: "Try to recover the sequence in the cache.".
Of course, here is the Java code you requested: ```java public final void remove(GroupAddress a, boolean fromUpdating) { if (fromUpdating) updating.remove(a); else invalidating.remove(a); } ``` Hope this helps!
Create a Java method that does the following: "Removes the given group address from the list of groups.".
Of course, here is the Java code you requested: ```java @Override public MoveAddressToVpcResult moveAddressToVpc(MoveAddressToVpcRequest request) { request = beforeClientExecution(request); return executeMoveAddressToVpc(request); } ``` Hope this helps!
Create a Java method that does the following: "Move an address from an existing vpc to an existing vpc.".
Of course, here is the Java code you requested: ```java String determineEmulatorLocation() { String location; if ( emulatorLocation != null ) { location = emulatorLocation; } else { location = "SdkTools"; } return location; ...
Create a Java method that does the following: "Determine the location of the system emulator.".
Of course, here is the Java code you requested: ```java public BooleanExpression in(T... right) { if (right.length == 1) { return eq(right[0]); } else { return Expressions.booleanOperation(Ops.IN, mixin, ConstantImpl.create(ImmutableList.copyOf(right))); } } ``` Hop...
Create a Java method that does the following: "Gets the IN expression for the class or method name.".
Of course, here is the Java code you requested: ```java public void free() { if (m_messageReceiver != null) m_messageReceiver.removeMessageFilter(this, false); // Remove from this and don't free again m_messageReceiver = null; while (this.getMessageListener(0) != null) ...
Create a Java method that does the following: "Free the content of the SECTYPE.".
Of course, here is the Java code you requested: ```java public void initialize() { super.initialize(); // // Register the ServletService classes associated with the ServletServiceProvider // ServletServiceProvider ssp = ServletServiceProvider.getProvider(); addServi...
Create a Java method that does the following: "Initialize the CDI container.".
Of course, here is the Java code you requested: ```java @Override public EClass getIfcGeographicElementType() { if (ifcGeographicElementTypeEClass == null) { ifcGeographicElementTypeEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(301); } return ...
Create a Java method that does the following: "Get the IfcGeographicElementTypeEClass attribute of the interface.".
Of course, here is the Java code you requested: ```java public void addPlayerInitCommand(String teamName, boolean isGoalie) { StringBuilder buf = new StringBuilder(); buf.append("(init "); buf.append(teamName); buf.append(" (version "); if (isGoalie) { buf.append(ser...
Create a Java method that does the following: "AddPlayerInitCommand Method.".
Of course, here is the Java code you requested: ```java public void print(PrintStream out, ChangeLogSerializer changeLogSerializer) throws ParserConfigurationException, IOException, DatabaseException { List<ChangeSet> changeSets = generateChangeSets(); changeLogSerializer.write(changeSets, out); ...
Create a Java method that does the following: "Print the contents of this object to the specified stream.".
Of course, here is the Java code you requested: ```java @Override public NGScope scope() { NGScope scope = NGScope.create(); scope.put(getName(), "="); return scope; } ``` Hope this helps!
Create a Java method that does the following: "Returns the NGScope for this class.".
Of course, here is the Java code you requested: ```java public void dump(Writer writer, String lineSeparator) throws IOException { for (int i = 0; i < this.getRecordLenth(); i++) { StringBuilder txt = new StringBuilder(); try (StringReader reader = new StringReader(StringUtils.trimToEmp...
Create a Java method that does the following: "Dump the content of this record to a writer.".
Of course, here is the Java code you requested: ```java public double getAnomalyScore(Instance inst) { if(this.neighbourhood.size() < 2) return 1.0; Instance nearestNeighbour = getNearestNeighbour(inst, this.neighbourhood, false); Instance nnNearestNeighbour = getNearestNeighbour(nearestNeighbour, this.ne...
Create a Java method that does the following: "Returns the anomaly score of the given instance.".
Of course, here is the Java code you requested: ```java private void setLastWorkflowForUser(String workflowId) throws CmsException { CmsUser user = getCmsObject().getRequestContext().getCurrentUser(); user.setAdditionalInfo(PARAM_WORKFLOW_ID, workflowId); getCmsObject().writeUser(user); } ...
Create a Java method that does the following: "Sets the last workflow for the current user.".
Of course, here is the Java code you requested: ```java public boolean isMember(int x) { Assert.check(currentState != BitsState.UNKNOWN); return 0 <= x && x < (bits.length << wordshift) && (bits[x >>> wordshift] & (1 << (x & wordmask))) != 0; } ``` Hope this helps!
Create a Java method that does the following: "Returns true if x is a member of this set.".
Of course, here is the Java code you requested: ```java @Override public Object put(String name, Object value) throws IllegalArgumentException, ClassCastException { if (bean != null) { Object oldValue = get(name); BeanInvoker invoker = getWriteInvoker(name); if (invoker ...
Create a Java method that does the following: "Override the put method to add a value to the attribute.".
Of course, here is the Java code you requested: ```java @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case BpsimPackage.FLOATING_PARAMETER_TYPE__CURRENCY_UNIT: return getCurrencyUnit(); case BpsimPackage.FLOATING_PARAMETER_TYPE__TIME_UNIT: return...
Create a Java method that does the following: "Override eGet to return the value of the featureID.".
Of course, here is the Java code you requested: ```java @Descriptor("Send event admin messages") public void sendmessage(@Descriptor("sendmessage BUS [KEY=VALUE ]*") String... parameters) { assert parameters[0] != null; String bus = parameters[0]; Dictionary eventAdminPayload = new Hashtabl...
Create a Java method that does the following: "Send event admin messages to the specified bus.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") protected <E> EventDispatcher<? super E> getEventDispatcherOptional(Class<E> eventType) { return getEventDispatcher(eventType, false); } ``` Hope this helps!
Create a Java method that does the following: "Returns the dispatcher for the given event type.".