code
stringlengths
160
48.7k
prompt
stringlengths
55
1.51k
Of course, here is the Java code you requested: ```java public byte[] get() { // Uniqueness is guaranteed by combining the hostname and the current nano second, hashing the result, and // selecting the first x bytes of the result String timestamp = String.valueOf(System.nanoTime()); b...
Create a Java method that does the following: "Get the message ID.".
Of course, here is the Java code you requested: ```java @Override public void addSubPropertyOfAxiom(ObjectPropertyExpression ope1, ObjectPropertyExpression ope2) throws InconsistentOntologyException { checkSignature(ope1); checkSignature(ope2); objectPropertyAxioms.addInclusion(ope1, ope2);...
Create a Java method that does the following: "Add a sub - inheritance axiom between two object property expressions.".
Of course, here is the Java code you requested: ```java private static int splitPatternInto2Part(String intervalPattern) { boolean inQuote = false; char prevCh = 0; int count = 0; /* repeatedPattern used to record whether a pattern has already seen. It is a pattern applies t...
Create a Java method that does the following: "Split the interval pattern into two parts.".
Of course, here is the Java code you requested: ```java public void setLaunchTemplateNames(java.util.Collection<String> launchTemplateNames) { if (launchTemplateNames == null) { this.launchTemplateNames = null; return; } this.launchTemplateNames = new com.amazonaws.inte...
Create a Java method that does the following: "Sets the value of the launchTemplateNames property.".
Of course, here is the Java code you requested: ```java private static String getClassNameandPath (String className, Path path) { if (path == null) { return getClassNameandPath(className, "/"); } else { return getClassNameandPath(className, path.value()); } } ``` Ho...
Create a Java method that does the following: "Gets the classname and path.".
Of course, here is the Java code you requested: ```java public static <T1, T2, R> FluentFunctions.FluentBiFunction<T1, T2, R> of(final BiFunction<T1, T2, R> fn) { return new FluentBiFunction<>( fn); } ``` Hope this helps!
Create a Java method that does the following: "Creates a FluentBiFunction from a binary function.".
Of course, here is the Java code you requested: ```java @Deprecated public static String replaceShorthand(char c, Map<String, String> headers) { return replaceShorthand(c, headers, false, 0, 0); } ``` Hope this helps!
Create a Java method that does the following: "Replace the shorthand of a character with a header map.".
Of course, here is the Java code you requested: ```java public void addType(String resourceType) { m_searchObject.addType(resourceType); m_searchObjectChanged = true; ValueChangeEvent.fire(this, m_searchObject); } ``` Hope this helps!
Create a Java method that does the following: "Add a type to the search object.".
Of course, here is the Java code you requested: ```java @Override public String classify(String text) throws IllegalArgumentException, IllegalStateException { Map<String, Double> scoreMap = predict(text); return CollectionUtility.max(scoreMap); } ``` Hope this helps!
Create a Java method that does the following: "Classify a single phrase.".
Of course, here is the Java code you requested: ```java public void popContextData(){ if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "popContextData"); } // If we pushed thread context onto the thread, be sure to reset it before // t...
Create a Java method that does the following: "This method is called by the application to restore the thread s context data.".
Of course, here is the Java code you requested: ```java @Override public Object invoke(Object self, Method thisMethod, Method proceed, Object[] args) throws Throwable { // Get an instance of the implementing class via Guice final Object instance = registry.getInjector().getInstance(clazz); return thisMethod.i...
Create a Java method that does the following: "Override this method to allow subclasses to override the default implementation of the service.".
Of course, here is the Java code you requested: ```java public static filterprebodyinjection get(nitro_service service) throws Exception{ filterprebodyinjection obj = new filterprebodyinjection(); filterprebodyinjection[] response = (filterprebodyinjection[])obj.get_resources(service); return response[0]; } ```...
Create a Java method that does the following: "Use this API to fetch all the filterprebodyinjection resources that are configured on netscaler.".
Of course, here is the Java code you requested: ```java protected void initField(Element elem, CmsXmlContentDefinition contentDef) throws CmsXmlException { String nameVal = elem.elementText(CmsConfigurationReader.N_PROPERTY_NAME); if (nameVal == null) { throw new CmsXmlException(Messages.g...
Create a Java method that does the following: "Initialize the field.".
Of course, here is the Java code you requested: ```java protected int getIntValue() throws LazyException{ int i=startIndex; boolean sign=false; int value=0; if(type==VALUE_FLOAT){ return (int)getDoubleValue(); }else if(type==VALUE_STRING || type==VALUE_ESTRING){ // Attempt to parse as an int, throw if ...
Create a Java method that does the following: "Returns the value of this field as an int.".
Of course, here is the Java code you requested: ```java public void scanClass(InputStream bits) throws IOException { DataInputStream dstream = new DataInputStream(new BufferedInputStream(bits)); ClassFile cf = null; try { cf = new ClassFile(dstream); classIndex.put(cf.ge...
Create a Java method that does the following: "Scans the class.".
Of course, here is the Java code you requested: ```java public static List<Map<String,String>> readCSVWithHeader(String path, char quoteChar, char escapeChar) throws IOException { String[] labels = null; List<Map<String,String>> rows = Generics.newArrayList(); for (String line : IOUtils.readLines(path))...
Create a Java method that does the following: "Reads a CSV file with a header.".
Of course, here is the Java code you requested: ```java @NotNull @Contract(pure = true) @SuppressWarnings("unchecked") public static <T> Optional<T> empty() { return (Optional<T>) EMPTY; } ``` Hope this helps!
Create a Java method that does the following: "Returns an empty CID .".
Of course, here is the Java code you requested: ```java public FilterableSet<Entry<K,V>> entrySetByValueDescending() { return new AbstractFilterableSet<Entry<K,V>>() { @Override public Iterator<Entry<K,V>> iterator() { return new TransactionalBidiTreeMapDescend...
Create a Java method that does the following: "Returns a FilterableSet of Entry objects that are sorted descending by their value.".
Of course, here is the Java code you requested: ```java @Override public <R1, R> Future<R> forEach2(Function<? super T, ? extends MonadicValue<R1>> value1, BiFunction<? super T, ? super R1, Boolean> filterFunction, BiFunction<? super T, ? ...
Create a Java method that does the following: "Perform a For Comprehension over a MonadicValue<R1 > containing a generating function. This method will be called for every value of the containing type and the second parameter.".
Of course, here is the Java code you requested: ```java public String convertIfcEnergySequenceEnumToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); } ``` Hope this helps!
Create a Java method that does the following: "This method is called to convert an EnergySequenceEnum to a String.".
Of course, here is the Java code you requested: ```java private SecretarialClerical getSecretarialClerical( OtherPersonnelDto otherPersonnel) { SecretarialClerical secretarialClerical = SecretarialClerical.Factory .newInstance(); if (otherPersonnel != null) { se...
Create a Java method that does the following: "This method is to get the SecretarialClerical object.".
Of course, here is the Java code you requested: ```java public final void useCache(final boolean useCache) { synchronized (cache) { this.useCache = useCache; logger.logDebug(getClass(), useCache ? "Enabled" : "Disabled" + " caching"); if (!useCache) { clearC...
Create a Java method that does the following: "Sets whether the cache should be used.".
Of course, here is the Java code you requested: ```java private void sendCancelRpcCall(int numberRetries) { final LogicalSlot slot = assignedResource; if (slot != null) { final TaskManagerGateway taskManagerGateway = slot.getTaskManagerGateway(); final ComponentMainThreadExecutor jobMasterMainThreadExecutor...
Create a Java method that does the following: "Cancel the task.".
Of course, here is the Java code you requested: ```java @Override public TimeZone cloneAsThawed() { OlsonTimeZone tz = (OlsonTimeZone)super.cloneAsThawed(); if (finalZone != null) { // TODO Do we really need this? finalZone.setID(getID()); tz.finalZone = (SimpleT...
Create a Java method that does the following: "Override to clone the TimeZone as thawed.".
Of course, here is the Java code you requested: ```java public static String convertStreamToString(InputStream in) throws Exception { BufferedReader reader = new BufferedReader(new InputStreamReader(in)); StringBuilder stringbuilder = new StringBuilder(); String line = null; while...
Create a Java method that does the following: "Convert a stream of a to a string.".
Of course, here is the Java code you requested: ```java public static String getTypeFromRef(String ref) { Matcher matcher = match(ref); return matcher != null ? matcher.group(1) : null; } ``` Hope this helps!
Create a Java method that does the following: "Get the type from a resource reference.".
Of course, here is the Java code you requested: ```java public ArrayList<OvhProductInformation> cart_cartId_domainTransfer_GET(String cartId, String domain) throws IOException { String qPath = "/order/cart/{cartId}/domainTransfer"; StringBuilder sb = path(qPath, cartId); query(sb, "domain", domain); String res...
Create a Java method that does the following: "Get all product information about a domain transfer".
Of course, here is the Java code you requested: ```java public List<Integer> getPageIdsNotContainingTemplateFragments(List<String> templateFragments) throws WikiApiException{ return getFragmentFilteredPageIds(templateFragments,false); } ``` Hope this helps!
Create a Java method that does the following: "Returns a list of page ids that do not contain any of the given template fragments.".
Of course, here is the Java code you requested: ```java public static BufferedReader buffr(Reader reader) { if (reader instanceof BufferedReader) return (BufferedReader) reader; return new BufferedReader(reader); } ``` Hope this helps!
Create a Java method that does the following: "Returns a buffered reader that wraps the specified reader.".
Of course, here is the Java code you requested: ```java public Observable<ServiceResponse<Page<DataLakeStoreAccountBasicInner>>> listWithServiceResponseAsync(final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { return listSinglePageAsync(...
Create a Java method that does the following: "List all the records in the specified account.".
Of course, here is the Java code you requested: ```java private Object[] nextArgs(Iterator[] iterators) { if (runStatus != OK) return null; Object[] next = new Object[iterators.length]; for (int i = 0; i < iterators.length; i++) try { next[i] = iterators[i].next(); } catch (Throwable t...
Create a Java method that does the following: "This method is called to get the next arguments from the iterator.".
Of course, here is the Java code you requested: ```java private void abort(Error error) { try { if (mContext == null || mContext.getError() != null || mContext.isDoneUnsafe()) { // Note, we may reach here via events due to network errors bubbling up before // mContext is initialized, or strea...
Create a Java method that does the following: "Abort the request with an error.".
Of course, here is the Java code you requested: ```java public EList<Annotation> getAnnotations() { if (annotations == null) { annotations = new EObjectContainmentEList<Annotation>(Annotation.class, this, XtextPackage.ABSTRACT_RULE__ANNOTATIONS); } return annotations; } ``` Hope this helps!
Create a Java method that does the following: "Replies the annotations.".
Of course, here is the Java code you requested: ```java @Override public void close() { LOG.info("Closing " + this.getClass().getSimpleName()); try (Connection conn = createConnection()) { JdbcWriterCommands commands = createJdbcWriterCommands(conn); if (!this.createdStagingTables.isEmpty()) { ...
Create a Java method that does the following: "Close the database.".
Of course, here is the Java code you requested: ```java private void setEnabledButtons() { int currentStep = getCurrentStep(); if(currentStep < 0) { return; } boolean isPreviousEnabled = true; boolean isNextEnabled = true; if(getNextStep(curr...
Create a Java method that does the following: "setEnabledButtons This method is called to enable the buttons of the application.".
Of course, here is the Java code you requested: ```java @Override public RandomVariable mult(double value) { return apply(OperatorType.MULT, new RandomVariable[]{this, constructNewAADRandomVariable(value)}); } ``` Hope this helps!
Create a Java method that does the following: "Multiplies this random variable by the given value.".
Of course, here is the Java code you requested: ```java public void shutdown(final String reason) { OtpOutputStream shutdown = new OtpOutputStream(); shutdown.write(OtpExternal.versionTag); final OtpErlangObject[] tuple = {new OtpErlangAtom("shutdown"), ...
Create a Java method that does the following: "Shutdown the current application.".
Of course, here is the Java code you requested: ```java public void addLibs( File directoryName, String[] includes, String[] excludes ) throws ArchiverException { addDirectory( directoryName, "WEB-INF/lib/", includes, excludes ); } ``` Hope this helps!
Create a Java method that does the following: "Add libraries to the application.".
Of course, here is the Java code you requested: ```java protected void addCommonHeaders(DapRequest drq) throws IOException { // Add relevant headers ResponseFormat format = drq.getFormat(); if(format == null) format = ResponseFormat.NONE; DapProtocol.Cont...
Create a Java method that does the following: "Add relevant headers to the response.".
Of course, here is the Java code you requested: ```java @Deprecated public SocketFactory getSocketFactory() { if (socketFactory != null) { return socketFactory; } else if (getSslSettings().isEnabled()) { return sslContext == null ? DEFAULT_SSL_SOCKET_FACTORY : sslContext.get...
Create a Java method that does the following: "Get the SocketFactory for this session.".
Of course, here is the Java code you requested: ```java public void put(Object o) throws InterruptedException { synchronized(lock) { while (size==maxSize) lock.wait(); elements[tail]=o; if(++tail==maxSize) tail=0; ...
Create a Java method that does the following: "Put an object into the array.".
Of course, here is the Java code you requested: ```java @Override public Map<String,Object> getRowData() { if (_resultSet == null) { return null; } else if (!isRowAvailable()) { throw new IllegalArgumentException( "the requested ro...
Create a Java method that does the following: "Get the row data for the current row of the result set.".
Of course, here is the Java code you requested: ```java @Override public int release(String path, FuseFileInfo fi) { LOG.trace("release({})", path); OpenFileEntry oe; final long fd = fi.fh.get(); synchronized (mOpenFiles) { oe = mOpenFiles.getFirstByField(ID_INDEX, fd); mOpenFiles.remove(...
Create a Java method that does the following: "Release the file.".
Of course, here is the Java code you requested: ```java private RuntimeState getNextState(RuntimeState[] states, int[] lastState, int xstate) { // Use the StateInfo with the most bits that matches that of state. // If there are none, then fallback to // the StateInfo with a state of 0, indicati...
Create a Java method that does the following: "Get the next state in the array.".
Of course, here is the Java code you requested: ```java public static Class<?> classForName(final String name, final ClassLoader loader) throws ClassNotFoundException { if (name.startsWith("[")) { throw new UnsupportedOperationException("No support for arrays, etc. Name was: " + name); } else if (...
Create a Java method that does the following: "Get the class for the given name using the given class loader.".
Of course, here is the Java code you requested: ```java @Override public ICounter getCounter(String name) { try { return counterCache.get(name); } catch (ExecutionException e) { throw new RuntimeException(e); } } ``` Hope this helps!
Create a Java method that does the following: "Get a counter by name.".
Of course, here is the Java code you requested: ```java public CalendarDate add(CalendarPeriod period) { switch (period.getField()) { case Millisec: return new CalendarDate(cal, dateTime.plusMillis(period.getValue())); case Second: return new CalendarDate(cal, dateTime.plusSeconds(...
Create a Java method that does the following: "Adds the specified calendar period to this calendar date.".
Of course, here is the Java code you requested: ```java public static Path getWriterStagingDir(State state, int numBranches, int branchId, String attemptId) { Preconditions.checkArgument(attemptId != null && !attemptId.isEmpty(), "AttemptId cannot be null or empty: " + attemptId); return new Path(getWriterStag...
Create a Java method that does the following: "Get the path to the staging directory for the given state.".
Of course, here is the Java code you requested: ```java public Double isValidSum(IMolecularFormula formula) { double result = 1.0; IMolecularFormula formulaWith = isValid(formula); Map<Object, Object> properties = formulaWith.getProperties(); Iterator<IRule> iterRules = rules.iterator...
Create a Java method that does the following: "Get the sum of all the rules in the given IMolecularFormula.".
Of course, here is the Java code you requested: ```java public long guessNextBCFRecordStart(long beg, long end) throws IOException { // Buffer what we need to go through. byte[] arr = new byte[ bgzf ? BGZF_MAX_BYTES_READ : UNCOMPRESSED_BYTES_NEEDED]; this.inFile.seek(beg); int totalRead = 0; for (int...
Create a Java method that does the following: "This method tries to guess the start of the next BCF record in the file.".
Of course, here is the Java code you requested: ```java public static <T> Matcher<Iterable<? extends T>> containsInOrder(final Iterable<T> items) { return IsIterableContainingInOrder.containsInOrder(items); } ``` Hope this helps!
Create a Java method that does the following: "Matches an iterable that contains items in the order of the items in the order of the items in the order of the items in the order they are returned.".
Of course, here is the Java code you requested: ```java public static Condition basicAuth(String username, String password) { final String authString = username + ":" + password; final String encodedAuthString = new String(Base64.encodeBase64(authString.getBytes())); return new Condition(input ...
Create a Java method that does the following: "Checks if a user is authenticated with a base64 encoded password.".
Of course, here is the Java code you requested: ```java public List<PKIXCertPathChecker> getCertPathCheckers() { List<PKIXCertPathChecker> tmpList = new ArrayList<PKIXCertPathChecker>(); for (PKIXCertPathChecker ck : certPathCheckers) { tmpList.add((PKIXCertPathChecker)ck.clone()); ...
Create a Java method that does the following: "Gets the list of CertPathCheckers.".
Of course, here is the Java code you requested: ```java private List<String> getDefaultTextValue(FormField field) { // Get the Id String fieldId = field.getName(); // Create new HashMap 'fieldAttributes' and new list 'definedValues' Map<String, String> fieldAttributes = new HashMap<String, String>(); List<...
Create a Java method that does the following: "Get the default text value for a FormFiled field.".
Of course, here is the Java code you requested: ```java @Override protected void onInitializeComponents() { super.onInitializeComponents(); multiSplitPane = newJXMultiSplitPane(newLayoutDefinition()); int screenHeight = (int)(ScreenSizeExtensions.getScreenHeight() / 1.1d); int screenWidth = (int)(ScreenSize...
Create a Java method that does the following: "Initialize the component.".
Of course, here is the Java code you requested: ```java public static InputStream decryptStream(InputStream inputStream, String keyBase64, String ivBase64, RemoteStoreFileEncryptionMaterial enc...
Create a Java method that does the following: "Decrypt a stream.".
Of course, here is the Java code you requested: ```java public static HazardCurve createHazardCurveFromHazardRate(String name, double[] times, double[] givenHazardRates){ double[] givenSurvivalProbabilities = new double[givenHazardRates.length]; if(givenHazardRates[0]<0) { throw new IllegalArgumentException("...
Create a Java method that does the following: "Create a HazardCurve from the given times and given hazard rates.".
Of course, here is the Java code you requested: ```java @Override protected void doIterationProcedure (final int n) { if (n == 1) return; // already initialized if (m_fMid < 0) { m_fXNeg = m_fXMid; // the root is in the xPos half m_fNeg = m_fMid; } else { m_fXPos = ...
Create a Java method that does the following: "This method is called by the iteration procedure to perform the iteration of the iteration.".
Of course, here is the Java code you requested: ```java private static String convertToStandardFormat(String valueAfterMD5) { String raw = valueAfterMD5.toUpperCase(); StringBuilder sb = new StringBuilder(); sb.append(raw.substring(0, 8)) .append("-") .append(raw.substring(8...
Create a Java method that does the following: "Convert the valueAfterMD5 to the standard format".
Of course, here is the Java code you requested: ```java public void introspect(IntrospectionWriter writer) { writer.begin("HomeOfHomes Dump ---> " + this.toString()); writer.begin("homesByName keys : "); List<String> j2eeNameStrings = new ArrayList<String>(); // 619922.1 for (Enume...
Create a Java method that does the following: "Introspect this object to print out the content of the IntrospectWriter.".
Of course, here is the Java code you requested: ```java public static void log(TreeLogger logger, TreeLogger.Type type, String formatString, Object... args) { if (logger.isLoggable(type)) { logger.log(type, format(formatString, args)); } } ``` Hope this helps!
Create a Java method that does the following: "Log a single element of a sequence of tokens.".
Of course, here is the Java code you requested: ```java private boolean isSetCurrentComponent(FacesContext context) { if (null != isSetCurrentComponent) { return isSetCurrentComponent; } Boolean bool = (Boolean) context.getAttributes().get(HONOR_CURRENT_COMPONENT_A...
Create a Java method that does the following: "isSetCurrentComponent This method is called to check if the current component is set in the context.".
Of course, here is the Java code you requested: ```java private void backPath(Lexeme l , LexemePath option){ while(option.checkCross(l)){ option.removeTail(); } } ``` Hope this helps!
Create a Java method that does the following: "Remove the last node of a path.".
Of course, here is the Java code you requested: ```java public static WaitStrategy fibonacciWait(long maximumTime, @Nonnull TimeUnit maximumTimeUnit) { Preconditions.checkNotNull(maximumTimeUnit, "The maximum time unit may not be null"); return new Fibonacci...
Create a Java method that does the following: "Creates a FibonacciWaitStrategy.".
Of course, here is the Java code you requested: ```java public static String[] schedulerCommandArgs( Config config, Config runtime, List<Integer> freePorts) { // First let us have some safe checks if (freePorts.size() < PORTS_REQUIRED_FOR_SCHEDULER) { throw new RuntimeException("Failed to find enou...
Create a Java method that does the following: "Creates the command arguments for the scheduler.".
Of course, here is the Java code you requested: ```java private DocPath getPath(LinkInfoImpl linkInfo) { if (linkInfo.context == LinkInfoImpl.Kind.PACKAGE_FRAME) { //Not really necessary to do this but we want to be consistent //with 1.4.2 output. return DocPath.forName(link...
Create a Java method that does the following: "Get the path to the class file.".
Of course, here is the Java code you requested: ```java @Override public void eUnset(int featureID) { switch (featureID) { case AfplibPackage.GSCR__PREC: setPREC(PREC_EDEFAULT); return; } super.eUnset(featureID); } ``` Hope this helps!
Create a Java method that does the following: "Declarative Services method for setting the value of the featureID attribute.".
Of course, here is the Java code you requested: ```java private void startConferenceTimer() { final long conferenceTotalLifeInMillis = RestcommConfiguration.getInstance().getMain().getConferenceTimeout()*1000; final long conferenceRemainingLife = conferenceTotalLifeInMillis - conferenceAge(); ...
Create a Java method that does the following: "Start the conference timer.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case AfplibPackage.BPG__PAGE_NAME: setPageName((String)newValue); return; case AfplibPackage.BPG__TRIPLETS: getTriplets().clear(...
Create a Java method that does the following: "Override the eSet method to allow the caller to override the eSet method.".
Of course, here is the Java code you requested: ```java private void addToJsonArray(String key, JsonValue value){ if (value == null){ throw new NullPointerException("Value cannot be null."); } PiwikJsonArray a = (PiwikJsonArray)parameters.get(key); if (a == null){ ...
Create a Java method that does the following: "Add a value to the array.".
Of course, here is the Java code you requested: ```java protected CmsMessages getMessages() { if (m_messages == null) { // initialize the localized messages m_messages = new CmsMessages(Messages.get().getBundleName(), getLocale().toString()); } return m_messages; } ...
Create a Java method that does the following: "Returns the localized messages.".
Of course, here is the Java code you requested: ```java protected void updateContent(CmsSitemapClipboardData data) { if (data == null) { return; } m_modified.clearList(); boolean hasElements = false; for (CmsClientSitemapEntry entry : data.getModifications().values(...
Create a Java method that does the following: "Updates the content of the sitemap.".
Of course, here is the Java code you requested: ```java public Object convertIfNeed(Object arg) { // #date_parade if (propertyType.isPrimitive()) { return convertPrimitiveWrapper(arg); } else if (Number.class.isAssignableFrom(propertyType)) { return convertNumber(arg); }...
Create a Java method that does the following: "Convert if need.".
Of course, here is the Java code you requested: ```java public com.google.api.ads.adwords.axis.v201809.rm.DataUploadResult getDataUploadResult() { return dataUploadResult; } ``` Hope this helps!
Create a Java method that does the following: "Gets the dataUploadResult value for this BaseProductPackageItem.".
Of course, here is the Java code you requested: ```java public void reverse() { mPlayingBackwards = !mPlayingBackwards; if (mPlayingState == RUNNING) { long currentTime = AnimationUtils.currentAnimationTimeMillis(); long currentPlayTime = currentTime - mStartTime; lo...
Create a Java method that does the following: "Reverse the image.".
Of course, here is the Java code you requested: ```java public void remove(String suggestion) { Node n = getNode(suggestion); if(n == null) return; n.weight = -1; size--; Node m = n; if(n.mid == null) { Node replacement = removeNode(n); ...
Create a Java method that does the following: "Remove a suggestion from the tree.".
Of course, here is the Java code you requested: ```java protected void generateNumericConstants(IStyleAppendable it) { appendComment(it, "numerical constants"); //$NON-NLS-1$ appendMatch(it, "sarlNumber", "[0-9][0-9]*\\.[0-9]\\+([eE][0-9]\\+)\\?[fFdD]\\?"); //$NON-NLS-1$ //$NON-NLS-2$ appendMatch(it, "sarlNumber...
Create a Java method that does the following: "Generate the numeric constants.".
Of course, here is the Java code you requested: ```java public void write(int ch) throws IOException { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { // 306998.15 Tr.debug(tc, "write --> " + ch + ", limit->" + limit); } if (limit > -1) { if (total >= limit) {...
Create a Java method that does the following: "Write a single byte to the output stream.".
Of course, here is the Java code you requested: ```java public String normalizePathWithoutLeadingSlash(String fileName, boolean enforceUnixSeparator) { String fileNameNormalized = enforceUnixSeparator ? FilenameUtils.normalize(fileName, true) : FilenameUtils.normalize(fileName);...
Create a Java method that does the following: "Normalize the filename without leading slash.".
Of course, here is the Java code you requested: ```java @Override public CreateHyperParameterTuningJobResult createHyperParameterTuningJob(CreateHyperParameterTuningJobRequest request) { request = beforeClientExecution(request); return executeCreateHyperParameterTuningJob(request); } ``` Hope ...
Create a Java method that does the following: "Creates a new hyperparameter job.".
Of course, here is the Java code you requested: ```java @Deprecated public static <V> FluentFuture<V> from(FluentFuture<V> future) { return checkNotNull(future); } ``` Hope this helps!
Create a Java method that does the following: "Returns a new FluentFuture that is composed of the given future.".
Of course, here is the Java code you requested: ```java public static <T1, R> Plan0<R> then(/* this */Observable<T1> source, Func1<T1, R> selector) { if (source == null) { throw new NullPointerException("source"); } if (selector == null) { throw new NullPointerException(...
Create a Java method that does the following: "Create a pattern that matches the source observable using the selector.".
Of course, here is the Java code you requested: ```java public static String ruleToRuleContentsString(Rule originalRule, int indentLevel) { if (originalRule instanceof Context && ((Context) originalRule).containsKey(RuleMetadataType.RULE_XML)) { return (String) ((Context) originalRule)....
Create a Java method that does the following: "Returns a string representation of the given rule.".
Of course, here is the Java code you requested: ```java public static URI buildUriInClientFormat(ConfigKeyPath configKeyPath, ConfigStore cs, boolean returnURIWithAuthority) { try { if (!returnURIWithAuthority) { return new URI(cs.getStoreURI().getScheme(), null, configKeyPath.getAbsolutePathS...
Create a Java method that does the following: "Build a URI based on the configKeyPath and ConfigStore.".
Of course, here is the Java code you requested: ```java public static void main(String[] args) { File dir = null; System.out.println("checkLocalRserve: " + checkLocalRserve()); try { RConnection c = new RConnection(); //c.eval("cat('123')"); dir = new File(c...
Create a Java method that does the following: "Main method for testing.".
Of course, here is the Java code you requested: ```java private Channel unlinkFromOrigin() { if (originResponseReceiver != null) { originResponseReceiver.unlinkFromClientRequest(); originResponseReceiver = null; } if (concurrentReqCount > 0) { origin.recordP...
Create a Java method that does the following: "Unlink from origin.".
Of course, here is the Java code you requested: ```java public static Integer getDayOfWeek(Date date) { if (date == null) return null; Calendar calendar = Calendar.getInstance(); calendar.setTime(date); return calendar.get(Calendar.DAY_OF_WEEK); } ``` Hope this helps...
Create a Java method that does the following: "Get the day of week of the calendar.".
Of course, here is the Java code you requested: ```java private void checkSessions() { long term = context.getTerm(); // Iterate through all currently registered sessions. for (ServerSessionContext session : context.getStateMachine().executor().context().sessions().sessions.values()) { // If the ses...
Create a Java method that does the following: "Check sessions.".
Of course, here is the Java code you requested: ```java private void indexArrayStore(int e, int i) { if (valueIndexStore.length < e) { int oldLength = valueIndexStore.length; valueIndexStore = Arrays.copyOf(valueIndexStore, e + 2); Arrays.fill(valueIndexStore, ol...
Create a Java method that does the following: "Index array store.".
Of course, here is the Java code you requested: ```java public void marshall(RunPipelineActivityRequest runPipelineActivityRequest, ProtocolMarshaller protocolMarshaller) { if (runPipelineActivityRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); }...
Create a Java method that does the following: "marshalls the given RunPipelineActivityRequest to the given protocolMarshaller.".
Of course, here is the Java code you requested: ```java public static HttpEntity newStringEntity(String s) { try { return new StringEntity(s); } catch (UnsupportedEncodingException e) { throw new SdkClientException("Unable to create HTTP entity: " + e.getMessage(), e); }...
Create a Java method that does the following: "Creates a new HTTP entity from a string.".
Of course, here is the Java code you requested: ```java public static MethodDelegation to(Object target, String fieldName) { return withDefaultConfiguration().to(target, fieldName); } ``` Hope this helps!
Create a Java method that does the following: "Delegation to method.".
Of course, here is the Java code you requested: ```java public void setBitCount(int count) { bitCount = count; discretes = new BitVector(count); //set correct length, without counting unitid and fc setDataLength(discretes.byteSize() + 1); } ``` Hope this helps!
Create a Java method that does the following: "Sets the bit count of the record.".
Of course, here is the Java code you requested: ```java @PostConstruct public void init() throws Exception { long startTime = System.currentTimeMillis(); filterLoader.putFiltersForClasses(config.getClassNames()); manageFiles(); startPoller(); LOG.warn("...
Create a Java method that does the following: "Initialize the CRUD.".
Of course, here is the Java code you requested: ```java public Class findClass(String name) throws ClassNotFoundException { log("Finding class " + name, Project.MSG_DEBUG); return findClassInComponents(name); } ``` Hope this helps!
Create a Java method that does the following: "Find a class by name.".
Of course, here is the Java code you requested: ```java public Element dereferenceVariable(String name, boolean lookupOnly, Term[] terms) throws InvalidTermException { boolean duplicate = false; Element result = localVariables.get(name); // If the result is null, then try to look up a global variable. if ...
Create a Java method that does the following: "Dereference a variable.".
Of course, here is the Java code you requested: ```java AddIfCluster addIfCluster(Object... objects) { if (addIfCluster == null) { addIfCluster = new AddIfCluster(!getWebServer().isStandalone()); } addIfCluster.ifAdd(objects); return addIfCluster; } ``` Hope this helps!
Create a Java method that does the following: "Add a list of objects to the Cluster.".
Of course, here is the Java code you requested: ```java protected final FluentModelTImpl prepareInlineUpdate(FluentModelTImpl model) { FluentModelTImpl childResource = find(model.childResourceKey()); if (childResource != null) { throw new IllegalArgumentException(pendingOperationMessage(mod...
Create a Java method that does the following: "Override prepareForFutureCommitOrPostRun to add an inline update to the child collection.".
Of course, here is the Java code you requested: ```java public DatanodeProtocol getNSNamenode(int namespaceId) throws IOException { NamespaceService nsos = namespaceManager.get(namespaceId); if(nsos == null || nsos.getDatanodeProtocol() == null) { throw new IOException("cannot find a namnode proxy for na...
Create a Java method that does the following: "Get the datanode protocol for a given namespace".
Of course, here is the Java code you requested: ```java public void marshall(UpdateDirectoryConfigRequest updateDirectoryConfigRequest, ProtocolMarshaller protocolMarshaller) { if (updateDirectoryConfigRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); ...
Create a Java method that does the following: "marshalls the given UpdateDirectoryConfigRequest to the JSON object.".