code
stringlengths
160
48.7k
prompt
stringlengths
38
3.13k
Of course, here is the Java code you requested: ```java public int scanCStringLength() throws IOException { int pos = index; while (true) { while (pos < endIndex) { if (buffer[pos++] == '\0') { return pos - index; } } if (!readMore(STRING_SCAN_SPAN)) { throw ...
Create a Java method that does the following: "Scan C String Length".
Of course, here is the Java code you requested: ```java private void addQueryParams(final Request request) { if (customerName != null) { request.addQueryParam("CustomerName", customerName); } if (friendlyName != null) { request.addQueryParam("FriendlyName", friendlyName...
Create a Java method that does the following: "Add the query params to the request.".
Of course, here is the Java code you requested: ```java public static RAExpression alias(RAExpression re, RelationID alias, TermFactory termFactory) { return new RAExpression(re.dataAtoms, re.filterAtoms, RAExpressionAttributes.alias(re.attributes, alias), termFactory); } ``` Hope this hel...
Create a Java method that does the following: "Alias an RAExpression.".
Of course, here is the Java code you requested: ```java Features getFeaturesAnnotation(final String[] value) { return new Features() { @Override public String[] value() { return value; } @Override public Class<Features> annotationTyp...
Create a Java method that does the following: "Gets the features annotation.".
Of course, here is the Java code you requested: ```java protected void processTusFiles(String assemblyUrl) throws IOException, ProtocolException { tusClient.setUploadCreationURL(new URL(getClient().getHostUrl() + "/resumable/files/")); tusClient.enableResuming(tusURLStore); for (Map.Entry<Stri...
Create a Java method that does the following: "Process the files in the tus files.".
Of course, here is the Java code you requested: ```java @Override public VariableInfo[] getVariableInfo(TagData data) { // construct the relevant VariableInfo object VariableInfo id = new VariableInfo( data.getAttributeString("id"), data.getAttributeString("type") ==...
Create a Java method that does the following: "Get the variable info from the tag data.".
Of course, here is the Java code you requested: ```java private void updateDisplayModeIcon() { FontAwesomeIcon icon = FontAwesomeIcon.CALENDAR; if (getDisplayMode().equals(DisplayMode.GRID)) { icon = FontAwesomeIcon.CALENDAR_ALT; } final Text graphic = FontAwesomeIconFactor...
Create a Java method that does the following: "Update the display mode icon.".
Of course, here is the Java code you requested: ```java @Override public int indexOf(Object elem) { int elemHash=elem.hashCode(); // Find the location to insert the object at int elemHashPos=binarySearchHashCode(elemHash); // Not found if(elemHashPos<0) return -1; // Try backwards until found or differ...
Create a Java method that does the following: "Returns the index of the specified object in this list.".
Of course, here is the Java code you requested: ```java private SegmentMetadataUpdateTransaction getSegmentUpdateTransaction(long segmentId) throws MetadataUpdateException { SegmentMetadataUpdateTransaction tsm = tryGetSegmentUpdateTransaction(segmentId); if (tsm == null) { throw new Metada...
Create a Java method that does the following: "Get the SegmentMetadataUpdateTransaction for the given Segment Id.".
Of course, here is the Java code you requested: ```java private void obtainValidateOnValueChange(@NonNull final TypedArray typedArray) { validateOnValueChange(typedArray .getBoolean(R.styleable.AbstractValidateableView_validateOnValueChange, DEFAULT_VALIDATE_ON_VALUE_CHA...
Create a Java method that does the following: "Obtains the validateOnValueChange setting from a specific typed array.".
Of course, here is the Java code you requested: ```java private synchronized boolean tryServerLock() throws IOException { if (!lockFile.exists() || lockFileChannel == null) return false; boolean lockObtained = true; try { serverLock = lockFileChannel.tryLock(); ...
Create a Java method that does the following: "Try to obtain the server lock.".
Of course, here is the Java code you requested: ```java @OnClose public void onClose(Session session, CloseReason closeReason) { logger.info("WebSocket closed. : SessionId={}, Reason={}", session.getId(), closeReason.toString()); AmLogServerAdapter.getInstance().onClose(session)...
Create a Java method that does the following: "WebSocket close event handler.".
Of course, here is the Java code you requested: ```java public SemanticVersion getNextVersion() { int major = head.getMajorVersion(); int minor = head.getMinorVersion(); int patch = head.getPatchVersion(); return new SemanticVersion(major, minor, patch + 1); } ``` Hope this helps!
Create a Java method that does the following: "Get the next version of the version list.".
Of course, here is the Java code you requested: ```java public void updateDependencyString(int id, String dep) { ClientResource resource = new ClientResource(Route.DEPENDENCY_STRING.url(id)); Reference ref = resource.getReference(); Form form = new Form(); form.add("string", dep); ...
Create a Java method that does the following: "Update the dependency string.".
Of course, here is the Java code you requested: ```java public void onSaveInstanceState(Bundle outState) { for (Screen screen : backStack) { screen.save(outState); screen.onSave(outState); } } ``` Hope this helps!
Create a Java method that does the following: "Save the state of the state of the screen.".
Of course, here is the Java code you requested: ```java public OutputStream asOutputStream() { if ( tmp != null ) throw new RuntimeException("can create Input/OutputStream only once"); tmp = new byte[1]; return new OutputStream() { @Override public void writ...
Create a Java method that does the following: "Returns an OutputStream that can be used to write the data to the underlying file.".
Of course, here is the Java code you requested: ```java public Reference addData() { //3 Reference t = new Reference(); if (this.data == null) this.data = new ArrayList<Reference>(); this.data.add(t); return t; } ``` Hope this helps!
Create a Java method that does the following: "Add this object to the data list.".
Of course, here is the Java code you requested: ```java @java.lang.Deprecated public java.util.Map<java.lang.String, com.google.protobuf.Value> getSourceProperties() { return getSourcePropertiesMap(); } ``` Hope this helps!
Create a Java method that does the following: "Gets the source properties map.".
Of course, here is the Java code you requested: ```java public static Drawable getDrawable(@NonNull final Context context, @StyleRes final int themeResourceId, @AttrRes final int resourceId) { TypedArray typedArray = null; t...
Create a Java method that does the following: "Retrieve a drawable from a specific theme and a resource ID.".
Of course, here is the Java code you requested: ```java public CloseableReference<Bitmap> createBitmap(Bitmap source, @Nullable Object callerContext) { return createBitmap(source, 0, 0, source.getWidth(), source.getHeight(), callerContext); } ``` Hope this helps!
Create a Java method that does the following: "Create a bitmap from a bitmap.".
Of course, here is the Java code you requested: ```java private void printTimeOfMapMatchQuery(final GraphHopper hopper, final MapMatching mapMatching) { // pick random start/end points to create a route, then pick random points from the route, // and then run the random points through map-matching. ...
Create a Java method that does the following: "Print time of map match query.".
Of course, here is the Java code you requested: ```java @BetaApi public final InstanceGroup getRegionInstanceGroup(ProjectRegionInstanceGroupName instanceGroup) { GetRegionInstanceGroupHttpRequest request = GetRegionInstanceGroupHttpRequest.newBuilder() .setInstanceGroup(instanceGroup == nul...
Create a Java method that does the following: "Gets the RegionInstanceGroup resource that corresponds to the specified instance group.".
Of course, here is the Java code you requested: ```java public void setBackgroundColor(int colorRes) { if (getBackground() instanceof ShapeDrawable) { final Resources res = getResources(); ((ShapeDrawable) getBackground()).getPaint().setColor(res.getColor(colorRes)); } } ```...
Create a Java method that does the following: "Set the background color of the image.".
Of course, here is the Java code you requested: ```java private TableAlias getTableAlias(String aPath, boolean useOuterJoins, UserAlias aUserAlias, String[] fieldRef, Map pathClasses) { TableAlias curr, prev, indirect; String attr, attrPath = null; ObjectReferenceDescriptor ord; C...
Create a Java method that does the following: "Gets the TableAlias for aPath and aUserAlias.".
Of course, here is the Java code you requested: ```java public SmartBinder foldVoid(SmartHandle function) { if (Arrays.equals(signature().argNames(), function.signature().argNames())) { return foldVoid(function.handle()); } else { return foldVoid(signature().asFold(void.class).p...
Create a Java method that does the following: "Fold void arguments into single argument.".
Of course, here is the Java code you requested: ```java public void marshall(UpdateEventSourceMappingRequest updateEventSourceMappingRequest, ProtocolMarshaller protocolMarshaller) { if (updateEventSourceMappingRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(.....
Create a Java method that does the following: "marshalls the given updateEventSourceMappingRequest to the given protocolMarshaller.".
Of course, here is the Java code you requested: ```java @Override public int read(byte[] b) throws IOException { checkState(InputStream.class); return ((InputStream)stream).read(b); } ``` Hope this helps!
Create a Java method that does the following: "read a sequence of bytes from the input stream.".
Of course, here is the Java code you requested: ```java public static String getIntersectPath(String ph0, String ph1, String dft) { // 木可能有交集 if (null == ph0 || null == ph1) return dft; String[] ss0 = Strings.splitIgnoreBlank(ph0, "[\\\\/]"); String[] ss1 = Strings.sp...
Create a Java method that does the following: "Gets the intersect path.".
Of course, here is the Java code you requested: ```java private BindRequest waitForBind(long timeout) throws IllegalStateException, TimeoutException { SessionState currentSessionState = getSessionState(); if (currentSessionState.equals(SessionState.OPEN)) { try { return bindRequestReceiver....
Create a Java method that does the following: "Wait for bind request.".
Of course, here is the Java code you requested: ```java public EntityDescFactory createEntityDescFactory( String packageName, Class<?> superclass, EntityPropertyDescFactory entityPropertyDescFactory, NamingType namingType, String originalStatesPropertyName, boolean showCatalogName, ...
Create a Java method that does the following: "Create an EntityDescFactory.".
Of course, here is the Java code you requested: ```java public void marshall(SimulationJobSummary simulationJobSummary, ProtocolMarshaller protocolMarshaller) { if (simulationJobSummary == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { ...
Create a Java method that does the following: "marshalls the given simulationJobSummary to the JSON object.".
Of course, here is the Java code you requested: ```java protected void checkIndex(int parameterIndex, int type, String getName) throws SQLException { checkIndex(parameterIndex); if (type != this.testReturn[parameterIndex - 1]) { throw new PSQLException( GT.tr("Parameter of type {0} was register...
Create a Java method that does the following: "checkIndex is called to check if the parameter is of the correct type.".
Of course, here is the Java code you requested: ```java public RequestParameters asParameters() { RequestParameters params = new RequestParameters(); if (title != null) params.put("title", title); if (description != null) params.put("description", description); if (provider != null) ...
Create a Java method that does the following: "Returns the object as a request parameters object.".
Of course, here is the Java code you requested: ```java private synchronized void removeExpiredEntriesSynced(long pTime) { if (pTime > nextExpiryTime) { //// long next = Long.MAX_VALUE; nextExpiryTime = next; // Avoid multiple runs... for (Iterator<Entry<K, ...
Create a Java method that does the following: "Remove expired entries from the cache.".
Of course, here is the Java code you requested: ```java @PostConstruct public void initSettings() { final Authentication authentication = new UsernamePasswordAuthenticationToken("system.init", "n/a", AuthorityUtils.createAuthorityList("ROLE_ADMIN")); SecurityContextHolder.getContext().setAuthentication(authentica...
Create a Java method that does the following: "Initialize the settings.".
Of course, here is the Java code you requested: ```java public void appendEAttribute(final Appendable appendable, final CharSequence attrName, final String attrRawValue) throws IOException { appendable.append(' ').append(attrName).append("=\"") .append(this.escaper.escapeXMLAttribute(attrRawValue)) ...
Create a Java method that does the following: "Append an XML attribute to a appendable.".
Of course, here is the Java code you requested: ```java static double[] slowLog(double xi) { double x[] = new double[2]; double x2[] = new double[2]; double y[] = new double[2]; double a[] = new double[2]; split(xi, x); /* Set X = (x-1)/(x+1) */ x[0] += 1.0; ...
Create a Java method that does the following: "Slow log function.".
Of course, here is the Java code you requested: ```java @Override public final synchronized Object lazyGetOtherBean( final String pBeanName) throws Exception { if (getDataSourceName().equals(pBeanName)) { return lazyGetDataSource(); } else { return lazyGetOtherRdbmsBean(pBeanName); } } ...
Create a Java method that does the following: "Get the other bean from the passed name.".
Of course, here is the Java code you requested: ```java public ListThingPrincipalsResult withPrincipals(String... principals) { if (this.principals == null) { setPrincipals(new java.util.ArrayList<String>(principals.length)); } for (String ele : principals) { this.princi...
Create a Java method that does the following: "A list of ID E. g. ID E. C. T.".
Of course, here is the Java code you requested: ```java public void marshall(AttachVolumeRequest attachVolumeRequest, ProtocolMarshaller protocolMarshaller) { if (attachVolumeRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { ...
Create a Java method that does the following: "marshalls the given AttachVolumeRequest to the given protocolMarshaller.".
Of course, here is the Java code you requested: ```java public ConsumableKey attachToDurableSubscription( LocalConsumerPoint consumerPoint, ConsumerDispatcherState subState) throws ...
Create a Java method that does the following: "Attaches a ConsumableKey to a durable subscription.".
Of course, here is the Java code you requested: ```java private synchronized PublicKey fetchPublicKey(JsonNode messageJson) { URI certUrl = URI.create(messageJson.get(SIGNING_CERT_URL).asText()); PublicKey publicKey = certificateCache.get(certUrl.toString()); if (publicKey == null) { ...
Create a Java method that does the following: "Fetch the public key from the certificate cache.".
Of course, here is the Java code you requested: ```java @Override public synchronized boolean addEntry(Principal caller, AccessControl aclEntry) { if (aclEntry == null) return false; Principal principal = aclEntry.getPrincipal(); Set<AccessControl> currentAcl = this.entries.get(principal); //...
Create a Java method that does the following: "Adds the specified AccessControl entry to the ACL set.".
Of course, here is the Java code you requested: ```java public static final String defaultToString(Object object) { if (object == null) return "null"; else return object.getClass().getName() + '@' + Integer.toHexString(System.identityHashCode(object)); } ``` Hope this helps!
Create a Java method that does the following: "Default toString method for a C ++ object".
Of course, here is the Java code you requested: ```java public java.util.List<String> getResourceIds() { if (resourceIds == null) { resourceIds = new com.amazonaws.internal.SdkInternalList<String>(); } return resourceIds; } ``` Hope this helps!
Create a Java method that does the following: "Gets the value of the resourceIds property.".
Of course, here is the Java code you requested: ```java static boolean doesNotNeedBidi(char[] text, int start, int len) { for (int i = start, e = i + len; i < e; i++) { if (text[i] >= FIRST_RIGHT_TO_LEFT) { return false; } } return true; } ``` Hope t...
Create a Java method that does the following: "Does the text need bidi?".
Of course, here is the Java code you requested: ```java public long skip(long n) { if (bytesRemaining >= n) { bytesRemaining -= n; return n; } else { int oldBytesRemaining = bytesRemaining; bytesRemaining = 0; return oldBytesRemaining; ...
Create a Java method that does the following: "Skip the specified number of bytes in the CE".
Of course, here is the Java code you requested: ```java public String execute(String... command) { return commandProcessor.run(aCommand("VBoxManage").withArguments(command)).getOutput(); } ``` Hope this helps!
Create a Java method that does the following: "Execute a VBoxManage command.".
Of course, here is the Java code you requested: ```java public static CallStackElement create(CallStackElement parent, String signature, long startTimestamp) { CallStackElement cse; if (useObjectPooling) { cse = objectPool.poll(); if (cse == null) { cse = new CallStackElement(); } } else { cse = ...
Create a Java method that does the following: "Create a new CallStackElement.".
Of course, here is the Java code you requested: ```java Rule variableDefinition() { return Sequence( group.types.type().label("type"), variableDefinitionPart().label("head"), ZeroOrMore(Sequence( Ch(','), group.basics.optWS(), variableDefinitionPart()).label("tail")), set(actions.createVa...
Create a Java method that does the following: "VariableDefinition Rule A".
Of course, here is the Java code you requested: ```java public static int cublasGetVectorAsync( int n, int elemSize, Pointer devicePtr, int incx, Pointer hostPtr, int incy, cudaStream_t stream) { return checkResult(cublasGetVectorAsyncNative(...
Create a Java method that does the following: "Create an asynchronous version of cublasGetVector for a CUDA TIFF entry.".
Of course, here is the Java code you requested: ```java public boolean vary(Map<String, CSSProperty> properties, Map<String, Term<?>> values) { // try inherit variant if (terms.size() == 1 && checkInherit(ALL_VARIANTS, terms.get(0), properties)) return true; // for all terms for (IntegerRef i = new...
Create a Java method that does the following: "Check if the variant is defined in this variant.".
Of course, here is the Java code you requested: ```java private void checkFailFast() { final long initializationTimeout = config.getInitializationFailTimeout(); if (initializationTimeout < 0) { return; } final long startTime = currentTime(); do { final PoolEntry pool...
Create a Java method that does the following: "checkFailFast - checks for connection failure.".
Of course, here is the Java code you requested: ```java @SafeVarargs public final <T> CommandLine processCommandLine( final String[] args, final Class<? extends Name<?>>... argClasses) throws IOException, BindException { for (final Class<? extends Name<?>> c : argClasses) { registerShortNameOf...
Create a Java method that does the following: "Process command line.".
Of course, here is the Java code you requested: ```java private void initServiceDescriptorModel() { List<ServiceDescriptorModel> sds = gu.getModel().getSds(); // Extract all WSDL files from source directory. List<File> wsdlFiles = FileUtil.getAllFilesMatching(targetFile, ".*\\.wsdl"); for (File wsdlFile :...
Create a Java method that does the following: "Initialize the service descriptor model.".
Of course, here is the Java code you requested: ```java public void marshall(DeleteMethodResponseRequest deleteMethodResponseRequest, ProtocolMarshaller protocolMarshaller) { if (deleteMethodResponseRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); ...
Create a Java method that does the following: "marshalls the given DeleteMethodResponseRequest to the given protocolMarshaller.".
Of course, here is the Java code you requested: ```java public MethodDescriptor[] getTeaContextMethodDescriptors( Class<?> contextClass, boolean specifiedClassOnly) { Vector<MethodDescriptor> v = new Vector<Metho...
Create a Java method that does the following: "Get the method descriptors for a single context class.".
Of course, here is the Java code you requested: ```java protected List<JoinableResourceBundle> filterBundlesToRender(List<JoinableResourceBundle> bundles) { List<JoinableResourceBundle> filteredBundles = new ArrayList<>(); for (JoinableResourceBundle bundle : bundles) { if (!bundle.getInclusionPattern().isInclu...
Create a Java method that does the following: "Filters the bundles to render.".
Of course, here is the Java code you requested: ```java @PreAuthorize( "hasPermission('ALL', 'java.lang.String', new org.apereo.portal.spring.security.evaluator.AuthorizableActivity('UP_PERMISSIONS', 'VIEW_PERMISSIONS'))") @RequestMapping("/v5-5/permissions/assignments/users/{username}") public Mod...
Create a Java method that does the following: "Get assignments for a user.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") protected <T extends Component> T findAncestor(Class<T> clazz) { Stack<? extends Component> componentStack = getComponentStack(); for (int i = componentStack.size() - 2; i >= 0; i--) { Component component = component...
Create a Java method that does the following: "Find the ancestor of the specified class.".
Of course, here is the Java code you requested: ```java public void marshall(MonitoringConfiguration monitoringConfiguration, ProtocolMarshaller protocolMarshaller) { if (monitoringConfiguration == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } ...
Create a Java method that does the following: "marshalls the given monitoringConfiguration to the JSON object.".
Of course, here is the Java code you requested: ```java public void setCreditStatus(com.google.api.ads.admanager.axis.v201805.CompanyCreditStatus creditStatus) { this.creditStatus = creditStatus; } ``` Hope this helps!
Create a Java method that does the following: "Sets the creditStatus value for this Company.".
Of course, here is the Java code you requested: ```java public Observable<GatewayRouteListResultInner> getLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName) { return getLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1<ServiceResponse<...
Create a Java method that does the following: "Get learned routes.".
Of course, here is the Java code you requested: ```java public String getSubmittedValue(final String rowKey, final int col) { return submittedValues.get(new SheetRowColIndex(rowKey, col)); } ``` Hope this helps!
Create a Java method that does the following: "Gets the submitted value.".
Of course, here is the Java code you requested: ```java public WebservicesMetaData loadFromVFSRoot(UnifiedVirtualFile root) { WebservicesMetaData webservices = null; UnifiedVirtualFile wsdd = root.findChildFailSafe("META-INF/webservices.xml"); // Maybe a web application deployment? if (nul...
Create a Java method that does the following: "Load the Webservices metadata from a VFS root.".
Of course, here is the Java code you requested: ```java private Map<String, Properties> loadRegisteredMessageResources() { Map<String, Properties> internalMessages = loadRegisteredMessageResources("pippo/pippo-messages%s.properties"); Map<String, Properties> applicationMessages = loadRegisteredMessageR...
Create a Java method that does the following: "Load the internal and application messages from the pippo - messages file.".
Of course, here is the Java code you requested: ```java private CompletableFuture<ExecutionResult> deferSupport(ExecutionContext executionContext, CompletableFuture<ExecutionResult> result) { return result.thenApply(er -> { DeferSupport deferSupport = executionContext.getDeferSupport(); ...
Create a Java method that does the following: "Defer support is detected.".
Of course, here is the Java code you requested: ```java private static String genCodeForLiteralKeyAccess(String containerExpr, String key) { return genCodeForLiteralKeyAccess(containerExpr, key, NotFoundBehavior.throwException()); } ``` Hope this helps!
Create a Java method that does the following: "Generate code for literal key access.".
Of course, here is the Java code you requested: ```java protected void update(ByteBuffer b) { if (b.hasArray()) { update(b.array(), b.arrayOffset() + b.position(), b.remaining()); b.position(b.limit()); } else { for (int remaining = b.remaining(); remaining > 0; remaining--) { update(...
Create a Java method that does the following: "Update the content of the CRAFF header.".
Of course, here is the Java code you requested: ```java public IntervalCollection<T> plus(Collection<? extends ChronoInterval<T>> intervals) { if (intervals.isEmpty()) { return this; } List<ChronoInterval<T>> windows = new ArrayList<>(this.intervals); for (ChronoInterval<...
Create a Java method that does the following: "Add the specified intervals to this collection.".
Of course, here is the Java code you requested: ```java @Override public SimpleOrderedMap<Object> create(ComponentStatus status, Boolean encode) throws IOException { SimpleOrderedMap<Object> mtasStatusResponse = new SimpleOrderedMap<>(); if (status.getMtasHandler) { mtasStatusResponse.add(NAME_MT...
Create a Java method that does the following: "Create the response.".
Of course, here is the Java code you requested: ```java public int newHandle(final int tag, final String owner, final String name, final String desc, final boolean itf) { return newHandleItem(tag, owner, name, desc, itf).index; } ``` Hope this helps!
Create a Java method that does the following: "Create a new handle.".
Of course, here is the Java code you requested: ```java public CharacterComponent getComponent (String className, String compName) throws NoSuchComponentException { // look up the list for that class ArrayList<CharacterComponent> comps = _classComps.get(className); if (comps != null...
Create a Java method that does the following: "Gets the CharacterComponent object for the specified class and component name.".
Of course, here is the Java code you requested: ```java @Nullable public SoyType getFieldType(String fieldName) { FieldWithType field = fields.get(fieldName); return field != null ? field.getType() : null; } ``` Hope this helps!
Create a Java method that does the following: "Returns the type of the field with the given name.".
Of course, here is the Java code you requested: ```java @Override public CommercePriceList fetchByG_S_Last(long groupId, int status, OrderByComparator<CommercePriceList> orderByComparator) { int count = countByG_S(groupId, status); if (count == 0) { return null; } List<CommercePriceList> list = findByG...
Create a Java method that does the following: "Returns the last commerce price list in the ordered set where groupId = &#63 ; and status = &#63 ;.".
Of course, here is the Java code you requested: ```java public Long toLong(final Object value, final Long defaultValue) { final Long result = toLong(value); if (result == null) { return defaultValue; } return result; } ``` Hope this helps!
Create a Java method that does the following: "Converts value into Long.".
Of course, here is the Java code you requested: ```java public CollectionInfo getInfo(String collectionId) throws JinxException { JinxUtils.validateParams(collectionId); Map<String, String> params = new TreeMap<>(); params.put("method", "flickr.collections.getInfo"); params.put("collection_id", collect...
Create a Java method that does the following: "Get information about a collection.".
Of course, here is the Java code you requested: ```java public EpollDatagramChannelConfig setIpTransparent(boolean ipTransparent) { try { ((EpollDatagramChannel) channel).socket.setIpTransparent(ipTransparent); return this; } catch (IOException e) { throw new Channel...
Create a Java method that does the following: "Sets the ipTransparent flag.".
Of course, here is the Java code you requested: ```java @Override @Transactional(enabled = false) public CPOption createCPOption(long CPOptionId) { return cpOptionPersistence.create(CPOptionId); } ``` Hope this helps!
Create a Java method that does the following: "Creates a new cp option in the database. Also notifies the appropriate model listeners.".
Of course, here is the Java code you requested: ```java public Observable<Page<DenyAssignmentInner>> listForResourceNextAsync(final String nextPageLink) { return listForResourceNextWithServiceResponseAsync(nextPageLink) .map(new Func1<ServiceResponse<Page<DenyAssignmentInner>>, Page<DenyAssignmentI...
Create a Java method that does the following: "Gets a list of CDNA records that can be used to access a resource.".
Of course, here is the Java code you requested: ```java public static GrayU8 removePointNoise(GrayU8 input, GrayU8 output) { output = InputSanityCheck.checkDeclare(input, output); if( BoofConcurrency.USE_CONCURRENT ) { ImplBinaryInnerOps_MT.removePointNoise(input, output); } else { ImplBinaryInnerOps.remo...
Create a Java method that does the following: "Removes the noise from the image.".
Of course, here is the Java code you requested: ```java public static Compressor getCompressor(CompressionCodec codec) { Compressor compressor = borrow(compressorPool, codec.getCompressorType()); if (compressor == null) { compressor = codec.createCompressor(); LOG.info("Got brand-new compressor"); ...
Create a Java method that does the following: "Get a compressor from the pool.".
Of course, here is the Java code you requested: ```java public Extractor getExtractor(String propertyName) { Extractor extractor = m_extractors.get(propertyName); if (extractor == null) { extractor = createDefaultExtractor(propertyName); m_extractors.put(propertyName, extractor)...
Create a Java method that does the following: "Gets the extractor for the specified property name.".
Of course, here is the Java code you requested: ```java public boolean isIntersectingNE(Envelope2D other) { return ((xmin <= other.xmin) ? xmax >= other.xmin : other.xmax >= xmin) && // check that x projections overlap ((ymin <= other.ymin) ? ymax >= other.ymin : other.ymax >= ymin); // check ...
Create a Java method that does the following: "Checks if the two envelope are intersecting.".
Of course, here is the Java code you requested: ```java public LocalDate minusMonths(int months) { if (months == 0) { return this; } long instant = getChronology().months().subtract(getLocalMillis(), months); return withLocalMillis(instant); } ``` Hope this helps!
Create a Java method that does the following: "Gets a copy of this date with the specified months subtracted.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") private void apply(File root, Iterable<? extends File> classPath) throws IOException { if (!root.isDirectory()) { throw new GradleException("Not a directory: " + root); } ClassLoaderResolver c...
Create a Java method that does the following: "Apply the class path transformation to the project.".
Of course, here is the Java code you requested: ```java private static int addAndCheck(final int x, final int y) { final long s = (long) x + (long) y; if (s < Integer.MIN_VALUE || s > Integer.MAX_VALUE) { throw new ArithmeticException("overflow: add"); } return (int) s; ...
Create a Java method that does the following: "Add checks.".
Of course, here is the Java code you requested: ```java public EClass getIfcAngularDimension() { if (ifcAngularDimensionEClass == null) { ifcAngularDimensionEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(11); } return ifcAngularDimensionECla...
Create a Java method that does the following: "Get the IfcAngularDimensionEClass for this feature.".
Of course, here is the Java code you requested: ```java private static Method[] getDeclaredMethods(Class<?> clazz) { Method[] result = declaredMethodsCache.get(clazz); if (result == null) { result = clazz.getDeclaredMethods(); declaredMethodsCache.put(clazz, result); } return result; } ``` Hope this he...
Create a Java method that does the following: "Get the declared methods of a class.".
Of course, here is the Java code you requested: ```java public AssetFilterInner createOrUpdate(String resourceGroupName, String accountName, String assetName, String filterName, AssetFilterInner parameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName, p...
Create a Java method that does the following: "Creates or updates an Asset Filter.".
Of course, here is the Java code you requested: ```java public static <A extends FastItemAdapter<Item>, Item extends IItem> DiffUtil.DiffResult calculateDiff(final A adapter, final List<Item> items, final DiffCallback<Item> callback) { return calculateDiff(adapter.getItemAdapter(), items, callback); } ``` ...
Create a Java method that does the following: "Calculate the diff between two items.".
Of course, here is the Java code you requested: ```java public PolicyDefinitionInner getAtManagementGroup(String policyDefinitionName, String managementGroupId) { return getAtManagementGroupWithServiceResponseAsync(policyDefinitionName, managementGroupId).toBlocking().single().body(); } ``` Hope this help...
Create a Java method that does the following: "Get the policy definition at management group.".
Of course, here is the Java code you requested: ```java @Override public ListAccessKeysResult listAccessKeys(ListAccessKeysRequest request) { request = beforeClientExecution(request); return executeListAccessKeys(request); } ``` Hope this helps!
Create a Java method that does the following: "Returns a list of access keys for a single language.".
Of course, here is the Java code you requested: ```java public static Policy getPoolConfigPolicy(com.impetus.client.cassandra.service.CassandraHost cassandraHost) { Policy policy = new Policy(); if (cassandraHost.getMaxActive() > 0) { policy.setMaxActivePerNode(cassandraHos...
Create a Java method that does the following: "Gets the pool config policy.".
Of course, here is the Java code you requested: ```java private void buildSubJobBatchWorkUnits() { List<Flow> flows = this.split.getFlows(); splitFlowWorkUnits = new ArrayList<BatchSplitFlowWorkUnit>(); for (Flow flow : flows) { // 1. First, we build the subjob JSLJob model for f...
Create a Java method that does the following: "Build the sub job batch work units.".
Of course, here is the Java code you requested: ```java protected void addIdInCommaSeparatedListCondition(final String propertyName, final String value) throws NumberFormatException { addIdInArrayCondition(propertyName, value.split(",")); } ``` Hope this helps!
Create a Java method that does the following: "Add id in comma separated list condition.".
Of course, here is the Java code you requested: ```java public void removeListSelectionListener(ListSelectionListener l) { listenerList.remove(javax.swing.event.ListSelectionListener.class, l); } ``` Hope this helps!
Create a Java method that does the following: "Removes a ListSelectionListener.".
Of course, here is the Java code you requested: ```java protected String key(String keyName, Locale locale) { CmsMessages messages = getMessages(locale); if (messages != null) { return messages.key(keyName); } return CmsMessages.formatUnknownKey(keyName); } ``` Hope th...
Create a Java method that does the following: "Returns the key for the given key name.".
Of course, here is the Java code you requested: ```java public void marshall(StepTimeline stepTimeline, ProtocolMarshaller protocolMarshaller) { if (stepTimeline == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarsha...
Create a Java method that does the following: "marshalls the given StepTimeline to the JSON object.".
Of course, here is the Java code you requested: ```java @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case BpsimPackage.USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE_GROUP: ((FeatureMap.Internal)getParameterValueGroup()).set(newValue); return; case BpsimPackage...
Create a Java method that does the following: "Override the eSet method for the FeatureID".