code
stringlengths
146
48.7k
prompt
stringlengths
55
1.51k
Of course, here is the Java code you requested: ```java private void renderJQueryAfterComponent(ResponseWriter rw, String clientId, SelectOneMenu menu) throws IOException { Boolean select2 = menu.isSelect2(); if (select2 != null && select2) { rw.startElement("script", menu); rw.writeAttribute("type", "text/j...
Create a Java method that does the following: "Render the jquery after a select component".
Of course, here is the Java code you requested: ```java public static void reply(XMPPConnection connection, Message original, Message reply) throws XMPPErrorException, InterruptedException, NotConnectedException, NoResponseException, FeatureNotSupportedException { MultipleRecipientInfo info = getMu...
Create a Java method that does the following: "Reply to a message.".
Of course, here is the Java code you requested: ```java public java.util.List<ServiceTypeDetail> getServiceType() { if (serviceType == null) { serviceType = new com.amazonaws.internal.SdkInternalList<ServiceTypeDetail>(); } return serviceType; } ``` Hope this helps!
Create a Java method that does the following: "Gets the value of the serviceType property.".
Of course, here is the Java code you requested: ```java private void setToken(String userToken, UserDetail userDetail, boolean loginPending) { boolean changed = !isEqual(this.userToken, userToken); this.userToken = userToken; if (null == userDetail) { userDetail = new UserDetail(); } this.userDetail = use...
Create a Java method that does the following: "Sets the token of the user.".
Of course, here is the Java code you requested: ```java private void saveToSession(HttpServletRequest req, String reqURL, Map params) { HttpSession postparamsession = req.getSession(true); if (postparamsession != null && params != null && !params.isEmpty()) { postparamsession.setAttribute(INITIAL_URL, reqURL); ...
Create a Java method that does the following: "Saves the request URL to the session.".
Of course, here is the Java code you requested: ```java @Override public void destroy() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "destroy", this); setState(STATE_DESTROYING); if (_mbeanFactory != null) ((MessagingMBeanFactor...
Create a Java method that does the following: "Destroy the managed message store and message processor.".
Of course, here is the Java code you requested: ```java public void setLineJoinImage(String lineJoinImage) { String val = setNonEmptyValueAttribute(lineJoinImage); if (val != null) _iState.setLineJoinImage(setNonEmptyValueAttribute(val)); } ``` Hope this helps!
Create a Java method that does the following: "Sets the lineJoinImage attribute.".
Of course, here is the Java code you requested: ```java public Excel07SaxReader read(OPCPackage opcPackage, int sheetIndex) throws POIException { InputStream sheetInputStream = null; try { final XSSFReader xssfReader = new XSSFReader(opcPackage); // 获取共享样式表 stylesTable = xssfReader.getStylesTable()...
Create a Java method that does the following: "Reads an Excel file from an OPCPackage.".
Of course, here is the Java code you requested: ```java public void startScroll(float startValue, float finalValue) { finished = false; startRtc = SystemClock.elapsedRealtime(); this.startValue = startValue; this.finalValue = finalValue; currValue = startValue; } ``` Hope ...
Create a Java method that does the following: "Start the scroll.".
Of course, here is the Java code you requested: ```java public void marshall(ListPrincipalPoliciesRequest listPrincipalPoliciesRequest, ProtocolMarshaller protocolMarshaller) { if (listPrincipalPoliciesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); ...
Create a Java method that does the following: "marshalls the given list of Policy objects to the given protocolMarshaller.".
Of course, here is the Java code you requested: ```java protected String createQueryStringFromCriteria(Criteria criteria, @Nullable Class<?> domainType) { return createQueryStringFromNode(criteria, domainType); } ``` Hope this helps!
Create a Java method that does the following: "Create query string from criteria.".
Of course, here is the Java code you requested: ```java public JsonResponse getTemplate(String template) throws IOException { Map<String, Object> data = new HashMap<String, Object>(); data.put(Template.PARAM_TEMPLATE, template); return apiGet(ApiAction.template, data); } ``` Hope this help...
Create a Java method that does the following: "Get a template".
Of course, here is the Java code you requested: ```java @SuppressLint("NewApi") public static String getPath(final Context context, final Uri uri) { final boolean isKitKat = BuildUtils.isKitKat(); // DocumentProvider if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) { ...
Create a Java method that does the following: "Gets the path of the content of a URI.".
Of course, here is the Java code you requested: ```java @Override public INDArray getActivation(INDArray in, boolean training) { // no support in ELU native to override alpha if (this.alpha != 1.00) { INDArray alphaMultiple = Nd4j.getExecutioner().exec(new ELU(in.dup())); al...
Create a Java method that does the following: "This method is used to get the activation of the image".
Of course, here is the Java code you requested: ```java private String[] getAltIds(FedoraClient fedora, String vitalPid, String dsPid) { Datastream ds = getDatastream(fedora, vitalPid, dsPid); if (ds != null) { return ds.getAltIDs(); } return new String[]{}; ...
Create a Java method that does the following: "Get the alt ids of a single instance of a class.".
Of course, here is the Java code you requested: ```java static public String listToJSONString(List<?> list) { if (list == null || list.size() == 0) { return "[]"; } StringBuilder sb = new StringBuilder("["); for (Object o : list) { buildAppendString(sb, o).append(',').append(' '); } return sb.delete(...
Create a Java method that does the following: "Converts a list of objects to a JSON string.".
Of course, here is the Java code you requested: ```java @Override protected void remapData(int[][] mapping) throws IOException { super.remapData(mapping); T1[][] originalFullValueList = fullValueList.clone(); fullValueList = operations.createMatrix1(mapping.length); for (int i = 0; i < mapping.length...
Create a Java method that does the following: "remapData is called to remap the data in the sequence of the sequence of the sequence of the sequence of the sequence.".
Of course, here is the Java code you requested: ```java public void writeStringValue(HKey hk, String key, String valueName, String value) throws RegistryException { try { ReflectedMethods.writeStringValue(hk.root(), hk.hex(), key, valueName, value); } catch (Exception e) { throw new RegistryException("Ca...
Create a Java method that does the following: "Write a string value to the registry.".
Of course, here is the Java code you requested: ```java @Override public void deliver(WriteStream os, OutHttp2 outHttp) throws IOException { outHttp.writePriority(_streamId, _streamRef, _weight); } ``` Hope this helps!
Create a Java method that does the following: "Write the sequence number to the output stream.".
Of course, here is the Java code you requested: ```java public static List<String> getServices() throws ApiException { V1ServiceList listNamespacedService = COREV1_API.listNamespacedService( DEFAULT_NAME_SPACE, null, null, null, null, ...
Create a Java method that does the following: "Get the services".
Of course, here is the Java code you requested: ```java public com.google.api.ads.adwords.axis.v201809.cm.UniversalAppCampaignAdsPolicyDecisions[] getAdsPolicyDecisions() { return adsPolicyDecisions; } ``` Hope this helps!
Create a Java method that does the following: "Gets the adsPolicyDecisions value for this UniversalAppCampaignSetting.".
Of course, here is the Java code you requested: ```java public BindingAssert<T> hasSameValue(ObservableValue<T> expectedValue) { new ObservableValueAssertions<>(actual).hasSameValue(expectedValue); return this; } ``` Hope this helps!
Create a Java method that does the following: "Fails if the binding has the same value as the given observable value.".
Of course, here is the Java code you requested: ```java public final Set<Map.Entry<K,V>> entrySet() { return new AbstractSet<Map.Entry<K,V>>() { public Iterator<Map.Entry<K,V>> iterator() { return entryIterator(); } public int size() { return size; } }; } ``` Hope this helps!
Create a Java method that does the following: "Returns a set of entries in this map.".
Of course, here is the Java code you requested: ```java @Override public AbstractCache createCache(String name, long capacity, long expireAfterWrite, long expireAfterAccess, ICacheLoader cacheLoader) { String cacheName = buildCacheName(name); try { AbstractCache cache = cach...
Create a Java method that does the following: "Create a cache with the specified name capacity expireAfterWrite and expireAfterAccess.".
Of course, here is the Java code you requested: ```java public static String getBase64EncodedImage(String imgSrc, BinaryResourcesHandler binaryRsHandler, HttpServletRequest request) { String encodedResult = null; if (null == binaryRsHandler) { throw new JawrLinkRenderingException( "You are using a Jawr...
Create a Java method that does the following: "Returns the base64 encoded image path".
Of course, here is the Java code you requested: ```java public Collection<T> getDescriptors(TestClass testClass) { final List<T> descriptors = new ArrayList<T>(); for (Method testMethod : testClass.getMethods(resourceAnnotation)) { descriptors.addAll(getDescriptorsDefinedFor(testMethod)); ...
Create a Java method that does the following: "Gets the descriptors defined for the test class.".
Of course, here is the Java code you requested: ```java public void marshall(DomainName domainName, ProtocolMarshaller protocolMarshaller) { if (domainName == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.m...
Create a Java method that does the following: "marshalls the given parameter object.".
Of course, here is the Java code you requested: ```java private void readCRLF() throws IOException { int cr = in.read(); int lf = in.read(); if ((cr != '\r') || (lf != '\n')) { throw new IOException( "CRLF expected at end of chunk: " + cr + "/" + lf); } }...
Create a Java method that does the following: "Read CRLF from the underlying stream.".
Of course, here is the Java code you requested: ```java public void init(Converter converter, Record thisFile, String iNamePrefix, String iNameFirst, String iNameMiddle, String iNameSur, String iNameSuffix, String iNameTitle) { super.init(converter); m_recThis = thisFile; m_iNamePrefix = iN...
Create a Java method that does the following: "Initialize the base class.".
Of course, here is the Java code you requested: ```java public AuthEventType withChallengeResponses(ChallengeResponseType... challengeResponses) { if (this.challengeResponses == null) { setChallengeResponses(new java.util.ArrayList<ChallengeResponseType>(challengeResponses.length)); } ...
Create a Java method that does the following: "A list of challenge responses.".
Of course, here is the Java code you requested: ```java @Override public void syr(char order, char Uplo, int N, double alpha, INDArray X, INDArray A) { if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL) OpProfiler.getInstance().processBlasCall(false, A, X); ...
Create a Java method that does the following: "SVD method for SVD".
Of course, here is the Java code you requested: ```java private String getApiIndex(Api api) { return getApiIndex(api.getOrganizationId(), api.getApiId(), api.getVersion()); } ``` Hope this helps!
Create a Java method that does the following: "Get the index of the API".
Of course, here is the Java code you requested: ```java static <K, V> ViewQueryParameters<K, V> reversePaginationQueryParameters (ViewQueryParameters<K, V> initialQueryParameters, K startkey, String startkey_docid) { // Get a copy of the parameters, using the forward pagination method ViewQueryPara...
Create a Java method that does the following: "Reverse the pagination query parameters.".
Of course, here is the Java code you requested: ```java public int expectUInt24() throws IOException { int b1 = in.read(); if (b1 < 0) { throw new IOException("Missing byte 1 to expected uint24"); } int b2 = in.read(); if (b2 < 0) { throw new IOException(...
Create a Java method that does the following: "expectUInt24 returns the next uint24 value.".
Of course, here is the Java code you requested: ```java public Element createElement(String tagName) { return new Element(Tag.valueOf(tagName, ParseSettings.preserveCase), this.baseUri()); } ``` Hope this helps!
Create a Java method that does the following: "Create an Element with the specified tag name.".
Of course, here is the Java code you requested: ```java public static Object getParent(TreeModel treeModel, Object node) { return getParent(treeModel, node, treeModel.getRoot()); } ``` Hope this helps!
Create a Java method that does the following: "Gets the parent of the given node.".
Of course, here is the Java code you requested: ```java static public List<String> hasIssues(List<Context> contexts) { List<String> issues = new ArrayList<>(); // Check that individual contexts are valid for (Context context : contexts) { issues.addAll(ContextChecker.hasIssues(context)); } ...
Create a Java method that does the following: "Checks that all the issues in the contexts are valid.".
Of course, here is the Java code you requested: ```java @GwtCompatible(serializable = true) public static <T> Predicate<T> notNull() { return ObjectPredicate.NOT_NULL.withNarrowedType(); } ``` Hope this helps!
Create a Java method that does the following: "Returns a predicate that returns true if the object is not null.".
Of course, here is the Java code you requested: ```java public void train(JavaRDD<String> corpusRDD) throws Exception { log.info("Start training ..."); if (workers > 0) corpusRDD.repartition(workers); // SparkContext final JavaSparkContext sc = new JavaSparkContext(corpusR...
Create a Java method that does the following: "Train the CNN".
Of course, here is the Java code you requested: ```java public static void pollInSameThread() { defaultExecutorLifecycle = ExecutorLifecycle.withNormalCleanupBehavior(new Supplier<ExecutorService>() { @Override public ExecutorService get() { return InternalExecutorServic...
Create a Java method that does the following: "Poll in same thread executor service.".
Of course, here is the Java code you requested: ```java protected String getFindAssociationTargetEmbeddedValues(String relationshipType, AssociationKeyMetadata associationKeyMetadata) { StringBuilder queryBuilder = findAssociationPartialQuery( relationshipType, associationKeyMetadata ); queryBuilder.append( "OPTIO...
Create a Java method that does the following: "Returns the query to find the target embedded values of an association.".
Of course, here is the Java code you requested: ```java @API(status = EXPERIMENTAL) public List<String> prepare(final Correlation correlation, final HttpResponse response) throws IOException { final StringBuilder statusLineBuilder = new StringBuilder(64); statusLineBuilder.append(response.getProtoc...
Create a Java method that does the following: "Prepare a single resource for a single resource.".
Of course, here is the Java code you requested: ```java public static void assertArrayEquals(String message, double[] expecteds, double[] actuals, double delta) throws ArrayComparisonFailure { new InexactComparisonCriteria(delta).arrayEquals(message, expecteds, actuals); } ``` Hope this helps!
Create a Java method that does the following: "Asserts that the two array of vectors are equal.".
Of course, here is the Java code you requested: ```java @Override public void reset() throws IOException { if (markSupported()) { super.reset(); if (digestLastMarked == null) { resetDigest(); } else { digest = cloneFrom(digestLastMarked);...
Create a Java method that does the following: "Resets the underlying stream.".
Of course, here is the Java code you requested: ```java public Conversation viewConversation(final String id) throws NotFoundException, GeneralException, UnauthorizedException { if (id == null) { throw new IllegalArgumentException("Id must be specified"); } String url = CONVERSATION...
Create a Java method that does the following: "Gets a single conversation.".
Of course, here is the Java code you requested: ```java @Override public List<ImageConfiguration> customizeConfig(List<ImageConfiguration> configs) { runtimeMode = clusterAccess.resolveRuntimeMode(mode, log); log.info("Running in [[B]]%s[[B]] mode", runtimeMode.getLabel()); if (runtimeMode ...
Create a Java method that does the following: "Override config to customize the image.".
Of course, here is the Java code you requested: ```java public static int cuGraphAddDependencies(CUgraph hGraph, CUgraphNode from[], CUgraphNode to[], long numDependencies) { return checkResult(cuGraphAddDependenciesNative(hGraph, from, to, numDependencies)); } ``` Hope this helps!
Create a Java method that does the following: "Adds a set of dependencies to a graph.".
Of course, here is the Java code you requested: ```java private static boolean isFileModifiedInCollectionPeriod(File file){ long diff = m_currentTimeMillis - file.lastModified(); if(diff >= 0) { return TimeUnit.MILLISECONDS.toDays(diff)+1 <= m_config.days; } return false; ...
Create a Java method that does the following: "Checks if the file has been modified in the collection period.".
Of course, here is the Java code you requested: ```java public static Pair<String, String> splitColumnName(String columnName) { final int i = columnName.indexOf('.'); if (i < 0) { return Pair.of(columnName, null); } else { return Pair.of(columnName.substring(0, i), columnName.substring(i + 1)...
Create a Java method that does the following: "Split the column name into a pair of column name and the group name.".
Of course, here is the Java code you requested: ```java private void initRemoteCommands() { if (rpcService != null) { // register commands suspend = rpcService.registerCommand(new RemoteCommand() { public String getId() { return "org.exo...
Create a Java method that does the following: "init remote commands".
Of course, here is the Java code you requested: ```java public void service(ServletRequest req, ServletResponse res, WebAppServletInvocationEvent evt) throws IOException, ServletException { // 569469 if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) { ...
Create a Java method that does the following: "service - This method is called by the servlet to service the request and response.".
Of course, here is the Java code you requested: ```java public static final DataGridStateFactory getInstance(ServletRequest request) { Object obj = request.getAttribute(KEY); if(obj != null) { assert obj instanceof DataGridStateFactory; return (DataGridStateFactory)obj; ...
Create a Java method that does the following: "Get the instance of the DataGridStateFactory from the request.".
Of course, here is the Java code you requested: ```java static int getNameReferenceCount(Node node, String name) { return getCount(node, new MatchNameNode(name), Predicates.alwaysTrue()); } ``` Hope this helps!
Create a Java method that does the following: "Gets the reference count of a name.".
Of course, here is the Java code you requested: ```java public RedBlackTreeNode<Key, Value> floorNode(Key key) { if (isEmpty()) { return null; } RedBlackTreeNode<Key, Value> x = floor(root, key); if (x == null) { return null; } else { return x; } } ``` Hope this helps!
Create a Java method that does the following: "Returns the node with the smallest key less than or equal to key.".
Of course, here is the Java code you requested: ```java public static base_response add(nitro_service client, location resource) throws Exception { location addresource = new location(); addresource.ipfrom = resource.ipfrom; addresource.ipto = resource.ipto; addresource.preferredlocation = resource.preferredlo...
Create a Java method that does the following: "Use this API to add location.".
Of course, here is the Java code you requested: ```java @Override public void lazyDestroy() { // NOTE: if you change this logic, be sure to update recycle() as well! synchronized (availableMemorySegments) { if (!isDestroyed) { MemorySegment segment; while ((segment = availableMemorySegments.poll()) != ...
Create a Java method that does the following: "This method is called by the buffer pool when it is being destroyed.".
Of course, here is the Java code you requested: ```java @Override public void handleMessage(Message message) throws Fault { MicroProfileClientProviderFactory factory = MicroProfileClientProviderFactory.getInstance(message); List<ProviderInfo<Object>> aiiProviderList = factory.getAsyncI...
Create a Java method that does the following: "Override this method to add async interceptors to the message.".
Of course, here is the Java code you requested: ```java private String readFileAsString(File file) throws java.io.IOException { StringBuilder fileData = new StringBuilder(1000); try (BufferedReader reader = new BufferedReader(ReaderFactory.newReader(file, this.encoding))) { char[] buf = new...
Create a Java method that does the following: "readFileAsString This method is used to read a file into a String.".
Of course, here is the Java code you requested: ```java public static boolean showDocument(String urlstring){ try{ URL url = new URL(urlstring); return showDocument(url); } catch (MalformedURLException e){ logger.warn("malformed URL {}", urlstring, e); return false; } } ``` Hope this helps!
Create a Java method that does the following: "Show a document from a URL string.".
Of course, here is the Java code you requested: ```java public static boolean setAttribute(String word, String natureWithFrequency) { CoreDictionary.Attribute attribute = CoreDictionary.Attribute.create(natureWithFrequency); return setAttribute(word, attribute); } ``` Hope this helps!
Create a Java method that does the following: "Sets the attribute for a CID .".
Of course, here is the Java code you requested: ```java private static String valueString(Object value, Schema schema) { if (value == null || schema.getType() == Schema.Type.NULL) { return null; } switch (schema.getType()) { case BOOLEAN: case FLOAT: case DOUBLE: case INT: ...
Create a Java method that does the following: "This method is used to get the value of a field from a value object and schema.".
Of course, here is the Java code you requested: ```java protected void processMap(final URI map) { assert !map.isAbsolute(); this.map = map; currentFile = job.tempDirURI.resolve(map); // parse logger.info("Processing " + currentFile); final Document doc; try { ...
Create a Java method that does the following: "Process the map.".
Of course, here is the Java code you requested: ```java public int[] getIndexOfColumns(String... columnNames) { int[] out = new int[columnNames.length]; for (int i = 0; i < out.length; i++) { out[i] = getIndexOfColumn(columnNames[i]); } return out; } ``` Hope this helps...
Create a Java method that does the following: "Gets the indexes of the specified column names.".
Of course, here is the Java code you requested: ```java public String getTableNames(boolean bAddQuotes) { return (m_tableName == null) ? Record.formatTableNames(FOLDER_FILE, bAddQuotes) : super.getTableNames(bAddQuotes); } ``` Hope this helps!
Create a Java method that does the following: "Get the table name for the SEVCTYPE file.".
Of course, here is the Java code you requested: ```java @Override public void cacheResult( List<CommercePriceListAccountRel> commercePriceListAccountRels) { for (CommercePriceListAccountRel commercePriceListAccountRel : commercePriceListAccountRels) { if (entityCache.getResult( CommercePriceListAccountRe...
Create a Java method that does the following: "Caches the commerce price list account rels in the entity cache if it is enabled.".
Of course, here is the Java code you requested: ```java public static ArrayList<ConfigSource> getDefaultSources(ClassLoader classloader) { ArrayList<ConfigSource> sources = new ArrayList<>(); sources.add(new SystemConfigSource()); sources.add(new EnvConfigSource()); sources.addAll(get...
Create a Java method that does the following: "Get the default config sources.".
Of course, here is the Java code you requested: ```java public DisasterRecoveryConfigurationInner createOrUpdate(String resourceGroupName, String serverName, String disasterRecoveryConfigurationName) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, disasterRecoveryConfigurationNam...
Create a Java method that does the following: "Creates or updates a Disaster Recovery Configuration.".
Of course, here is the Java code you requested: ```java public static StreamEx<int[]> ofCombinations(int n, int k) { checkNonNegative("k", k); checkNonNegative("n", n); if (k > n) { return StreamEx.empty(); } if (k == 0) { return StreamEx.of(new int[0]); ...
Create a Java method that does the following: "Create a stream of combinations of n and k elements.".
Of course, here is the Java code you requested: ```java protected void readJsonSyntaxChar(byte[] b) throws IOException { byte ch = reader.read(); if (ch != b[0]) { throw new ProtocolException("Unexpected character:" + (char) ch); } } ``` Hope this helps!
Create a Java method that does the following: "Read a single character from the input stream.".
Of course, here is the Java code you requested: ```java @RequestMapping(value="/{providerId}", method=RequestMethod.DELETE) public RedirectView removeConnections(@PathVariable String providerId, NativeWebRequest request) { ConnectionFactory<?> connectionFactory = connectionFactoryLocator.getConnectionFactory(provid...
Create a Java method that does the following: "Removes all connections from the specified provider.".
Of course, here is the Java code you requested: ```java private Integer getStrength(String password) { ScriptEngineManager factory = new ScriptEngineManager(); ScriptEngine engine = factory.getEngineByName("JavaScript"); String js = "function getStrength(p) {var stringReverse = function(str) ...
Create a Java method that does the following: "getStrength This is the function that returns the strength of the password".
Of course, here is the Java code you requested: ```java public static void writeObject(CodedOutputStream out, int order, FieldType type, Object o, boolean list) throws IOException { if (o == null) { return; } if (type == FieldType.OBJECT) { Class cls = o.ge...
Create a Java method that does the following: "Write Object method.".
Of course, here is the Java code you requested: ```java public static String getLine(String content, int line) { if (content == null) { return null; } String[] contentSplit = content.replace("\r\n", "\n").split("\n"); if (contentSplit.length < line) { return null; } return content...
Create a Java method that does the following: "Get the line of content".
Of course, here is the Java code you requested: ```java public RecommendedActionInner get(String resourceGroupName, String serverName, String databaseName, String advisorName, String recommendedActionName) { return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName, advisorName, recommende...
Create a Java method that does the following: "Gets a recommended action.".
Of course, here is the Java code you requested: ```java private StringBuffer singleFieldToPigScript(FieldDescriptor fieldDescriptor, int numTabs, boolean isLast) throws FrontendException { assert fieldDescriptor.getType() != FieldDescriptor.Type.MESSAGE : "singleFieldToPigScript called with field of type " + field...
Create a Java method that does the following: "Convert single field to pig script".
Of course, here is the Java code you requested: ```java protected void copyShareLog4jConfig() throws MojoExecutionException { if (!useCustomShareLog4jConfig) { getLog().info("NOT overriding share/WEB-INF/classes/log4j.properties"); return; } final String warOutputDir = ...
Create a Java method that does the following: "Copy Share log4j. properties to the output directory.".
Of course, here is the Java code you requested: ```java public static Predicate<? super Throwable> statusCode(int... codes) { return t -> t instanceof ClientV2Exception && Arrays.stream(codes).anyMatch(candidate -> ((ClientV2Exception) t).getCode().equals(candidate)); } ``` Hope this helps!
Create a Java method that does the following: "Returns a predicate that returns true if the Throwable is a ClientV2Exception with the given status code.".
Of course, here is the Java code you requested: ```java public String getActiveServerAddress() { CuratorFramework client = curatorFactory.clientInstance(); String serverAddress = null; try { HAConfiguration.ZookeeperProperties zookeeperProperties = HAConfiguratio...
Create a Java method that does the following: "Get the active server address.".
Of course, here is the Java code you requested: ```java public static <E> Iterator<Tuple2<E, Integer>> withIndex(Iterator<E> self, int offset) { return new ZipPostIterator<E>(self, offset); } ``` Hope this helps!
Create a Java method that does the following: "Create an iterator that iterates over the elements of the iterator starting at the given offset.".
Of course, here is the Java code you requested: ```java public static Policy createPolicy(final String resourceName) { if (StringUtils.isBlank(resourceName)) { throw new SystemException("AntiSamy Policy resourceName cannot be null "); } URL resource = HtmlSanitizerUtil.class.getClassLoader().getResource(resou...
Create a Java method that does the following: "Create a AntiSamy Policy from the given resource name.".
Of course, here is the Java code you requested: ```java public void setFeedback(SetFeedbackRequest request) { checkNotNull(request, "object request should not be null."); if (request.getEmail() != null && request.getEmail().trim().length() > 0) { checkIsEmail(request.getEmail()); } ...
Create a Java method that does the following: "Set the ID of the Cognizen Tesla Ses Resource.".
Of course, here is the Java code you requested: ```java @Override public DeleteBackupSelectionResult deleteBackupSelection(DeleteBackupSelectionRequest request) { request = beforeClientExecution(request); return executeDeleteBackupSelection(request); } ``` Hope this helps!
Create a Java method that does the following: "Deletes the backup selection.".
Of course, here is the Java code you requested: ```java protected AptControlInterface initControlInterface() { TypeMirror controlType = _fieldDecl.getType(); if (! (controlType instanceof DeclaredType)) { _ap.printError( _fieldDecl, "control.field.bad.type" ); return...
Create a Java method that does the following: "Initialize the control interface.".
Of course, here is the Java code you requested: ```java public MoneyAmountStyle withExtendedGroupingSize(Integer extendedGroupingSize) { int sizeVal = (extendedGroupingSize == null ? -1 : extendedGroupingSize); if (extendedGroupingSize != null && sizeVal < 0) { throw new IllegalArgumentE...
Create a Java method that does the following: "Returns a copy of this style with the specified extended grouping size.".
Of course, here is the Java code you requested: ```java @Override public ListIncomingTypedLinksResult listIncomingTypedLinks(ListIncomingTypedLinksRequest request) { request = beforeClientExecution(request); return executeListIncomingTypedLinks(request); } ``` Hope this helps!
Create a Java method that does the following: "Lists the incoming typed links for an app.".
Of course, here is the Java code you requested: ```java public void addType(String type) { try { messageCreators.add(Class.forName(type).newInstance()); } catch (ClassNotFoundException | IllegalAccessException e) { throw new CitrusRuntimeException("Unable to access message creat...
Create a Java method that does the following: "Adds a message creator type.".
Of course, here is the Java code you requested: ```java public static boolean waitCompleted(FileSystem fs, AlluxioURI uri) throws IOException, AlluxioException, InterruptedException { return FileSystemUtils.waitCompleted(fs, uri, -1, TimeUnit.MILLISECONDS); } ``` Hope this helps!
Create a Java method that does the following: "Wait completed.".
Of course, here is the Java code you requested: ```java public static boolean isFileExist(final String filePathString) throws Exception { File f = new File(filePathString); return f.exists(); } ``` Hope this helps!
Create a Java method that does the following: "Check if the file exists.".
Of course, here is the Java code you requested: ```java @Override public RoleSet getRolesForAccessId(String appName, String accessId) { if (!populated) { return null; } if (getApplicationName().equals(appName)) { return rolesForAccessId(accessId); } else { ...
Create a Java method that does the following: "Get the roles for the given accessId.".
Of course, here is the Java code you requested: ```java private void ensureIndexIsUnlocked(String dataDir) { Collection<File> lockFiles = new ArrayList<File>(2); lockFiles.add( new File( CmsFileUtil.addTrailingSeparator(CmsFileUtil.addTrailingSeparator(dataDir) + "index") +...
Create a Java method that does the following: "Ensure index is unlocked.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") @Override public T create(CreationalContext<T> creationalContext) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "create", creationalContext); } T insta...
Create a Java method that does the following: "Create an instance of the class that is defined by the CDI bean manager.".
Of course, here is the Java code you requested: ```java protected void removeEntry(T entry) { T prev = entry.getPrev(); T next = entry.getNext(); if (prev != null) { prev.setNext(next); } else { head = next; } if (next != null) { next....
Create a Java method that does the following: "Removes an entry from the list of unclassified attributes.".
Of course, here is the Java code you requested: ```java public TwoDHashMap<K2, K3, V> getAs2d(final K1 firstKey) { final HashMap<K2, HashMap<K3, V>> innerMap1 = map.get(firstKey); if( innerMap1 != null ) { return new TwoDHashMap<K2, K3, V>(innerMap1); } else { return new TwoDHashMap<K2, K3, V>(); } }...
Create a Java method that does the following: "Gets the value of the first key as a two - dimensional map.".
Of course, here is the Java code you requested: ```java @Override public int read(byte b[], int offset, int length) { if (b == null) { throw new NullPointerException(); } // avoid int overflow if (offset < 0 || offset > b.length || length < 0 || length > ...
Create a Java method that does the following: "read method for the Craige - Telnet tag.".
Of course, here is the Java code you requested: ```java public void resolveAdviceBeanClass(AspectRule aspectRule) throws IllegalRuleException { String beanIdOrClass = aspectRule.getAdviceBeanId(); if (beanIdOrClass != null) { Class<?> beanClass = resolveBeanClass(beanIdOrClass, aspectRule);...
Create a Java method that does the following: "Resolves the advice bean class.".
Of course, here is the Java code you requested: ```java public void setErrors(java.util.Collection<TableVersionError> errors) { if (errors == null) { this.errors = null; return; } this.errors = new java.util.ArrayList<TableVersionError>(errors); } ``` Hope this hel...
Create a Java method that does the following: "Sets the value of the errors property.".
Of course, here is the Java code you requested: ```java private String createString(String f) { return "function="+function+f+ "gridDimX="+gridDimX+f+ "gridDimY="+gridDimY+f+ "gridDimZ="+gridDimZ+f+ "blockDimX="+blockDimX+f+ "b...
Create a Java method that does the following: "Create a string containing the contents of a file.".
Of course, here is the Java code you requested: ```java protected static void checkSameExecutionContext(DataSet<?> set1, DataSet<?> set2) { if (set1.getExecutionEnvironment() != set2.getExecutionEnvironment()) { throw new IllegalArgumentException("The two inputs have different execution contexts."); } } ``` H...
Create a Java method that does the following: "Checks if two data sets have the same execution context.".
Of course, here is the Java code you requested: ```java public static AccessType getAccessType(final UUID _uuid) throws CacheReloadException { final Cache<UUID, AccessType> cache = InfinispanCache.get().<UUID, AccessType>getCache(AccessType.UUIDCACHE); if (!cache.containsKey(_uuid)) { ...
Create a Java method that does the following: "Get the access type for a given UUID.".
Of course, here is the Java code you requested: ```java @Override public Request createRequest(Request origRequest) throws SipException { Request request = super.createRequest(origRequest); if (wrappedDialog == null) { // hack uri and address headers final SIPRequest sipRequest = (SIPRequest) request;...
Create a Java method that does the following: "Override this method to add headers to the request".