code
stringlengths
146
48.7k
prompt
stringlengths
55
1.51k
Of course, here is the Java code you requested: ```java public static <T extends Annotation> T create(Class<T> annotationType, Object value) { return new Builder<T>(annotationType).withValue(value).create(); } ``` Hope this helps!
Create a Java method that does the following: "Create an annotation with the given value.".
Of course, here is the Java code you requested: ```java static String parms(String types) { int[] pos = new int[] { 0 }; StringBuilder sb = new StringBuilder(); boolean first = true; String t; while ((t = desc(types, pos)) != null) { if (first) { f...
Create a Java method that does the following: "Get parms for a single type.".
Of course, here is the Java code you requested: ```java public void marshall(ListServersRequest listServersRequest, ProtocolMarshaller protocolMarshaller) { if (listServersRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { ...
Create a Java method that does the following: "Creates a protocolMarshaller instance for the given parameter object.".
Of course, here is the Java code you requested: ```java protected int chooseMeanCapacity(int size, double minLoad, double maxLoad) { return nextPrime(Math.max(size+1, (int) ((2*size / (minLoad+maxLoad))))); } ``` Hope this helps!
Create a Java method that does the following: "Returns the mean capacity of the given size.".
Of course, here is the Java code you requested: ```java public LocalDate atDay(int dayOfQuarter) { ValueRange.of(1, lengthOfQuarter()).checkValidValue(dayOfQuarter, DAY_OF_QUARTER); boolean leap = Year.isLeap(year); Month month = quarter.firstMonth(); while (dayOfQuarter > month.length(...
Create a Java method that does the following: "Gets the LocalDate at the given day of the quarter.".
Of course, here is the Java code you requested: ```java public static final synchronized void useValueFormat(String pattern) { if (pattern == null) sdf = null; else if (sdf == null) { sdf = new SimpleDateFormat(pattern); sdf.setCalendar(getCalendar()); } else sdf.applyPattern(pattern); ...
Create a Java method that does the following: "Use the value format for a calendar field.".
Of course, here is the Java code you requested: ```java public Integer getLoadOnStartup() { if (childNode.getTextValueForPatternName("load-on-startup") != null && !childNode.getTextValueForPatternName("load-on-startup").equals("null")) { return Integer.valueOf(childNode.getTextValueForPatternName("lo...
Create a Java method that does the following: "Get Load On Startup".
Of course, here is the Java code you requested: ```java public static final void checkName(String s) throws NullPointerException, InvalidXMLException { checkName(s.toCharArray(), 0, s.length()); } ``` Hope this helps!
Create a Java method that does the following: "Check the name of a class.".
Of course, here is the Java code you requested: ```java public TupleGeneratorBuilder combiners( TupleCombiner... combiners) { for( TupleCombiner combiner : combiners) { tupleGenerator_.addCombiner( combiner); } return this; } ``` Hope this helps!
Create a Java method that does the following: "Add a list of combiners to the generated tuple generator.".
Of course, here is the Java code you requested: ```java private void scanFraction(int pos) { skipIllegalUnderscores(); if ('0' <= reader.ch && reader.ch <= '9') { scanDigits(pos, 10); } int sp1 = reader.sp; if (reader.ch == 'e' || reader.ch == 'E') { read...
Create a Java method that does the following: "Scan fraction.".
Of course, here is the Java code you requested: ```java public void setGeometry(String name, Geometry value) { if (name == null) { geomPropertyName = null; geomValue = null; } else { geomPropertyName= name; geomValue = value; ...
Create a Java method that does the following: "Sets the value of the Geometry property.".
Of course, here is the Java code you requested: ```java protected RenderedImage doFilter(BufferedImage pImage, ServletRequest pRequest, ImageServletResponse pResponse) { // Get quality setting // SMOOTH | FAST | REPLICATE | DEFAULT | AREA_AVERAGING // See Image (mHints) int qualit...
Create a Java method that does the following: "Override this method to handle the GET request for the servlet.".
Of course, here is the Java code you requested: ```java public WorkspaceFolderContents listWorkspaceFolderItems(String accountId, String workspaceId, String folderId) throws ApiException { return listWorkspaceFolderItems(accountId, workspaceId, folderId, null); } ``` Hope this helps!
Create a Java method that does the following: "List workspace folder items. Returns workspace folder items.".
Of course, here is the Java code you requested: ```java public boolean addMeasureToVerb(String measureType, Number value, Number scaleMin, Number scaleMax, Number sampleSize) { Map<String, Object> container = new HashMap<String, Object>(); if (measureType != null) { con...
Create a Java method that does the following: "Add a measure to the verb.".
Of course, here is the Java code you requested: ```java public Jar addEntry(Path path, String file) throws IOException { return addEntry(path, Paths.get(file)); } ``` Hope this helps!
Create a Java method that does the following: "Add an entry to the jar.".
Of course, here is the Java code you requested: ```java public void assignAmounts(XEvent event, Map<String, Double> amounts) { XCostAmount.instance().assignValues(event, amounts); } ``` Hope this helps!
Create a Java method that does the following: "Assigns amounts to an event.".
Of course, here is the Java code you requested: ```java protected String toParameterString(boolean withJsonParameter, Parameter... parameters) { if (!isBlank(accessToken)) { parameters = parametersWithAdditionalParameter(Parameter.with(ACCESS_TOKEN_PARAM_NAME, accessToken), parameters); } if (!isBla...
Create a Java method that does the following: "Returns a string representation of the parameters.".
Of course, here is the Java code you requested: ```java public boolean allows(WebURL webURL) throws IOException, InterruptedException { if (!config.isEnabled()) { return true; } try { URL url = new URL(webURL.getURL()); String host = getHost(url); ...
Create a Java method that does the following: "Checks if a robotstxt server allows the specified URL.".
Of course, here is the Java code you requested: ```java public static void trimAll(final String... strings) { for (int i = 0; i < strings.length; i++) { String string = strings[i]; if (string != null) { strings[i] = string.trim(); } } } ``` Hope this helps!
Create a Java method that does the following: "Trims all the strings in the array.".
Of course, here is the Java code you requested: ```java @Override public List<CPFriendlyURLEntry> findByG_C_U(long groupId, long classNameId, String urlTitle, int start, int end, OrderByComparator<CPFriendlyURLEntry> orderByComparator) { return findByG_C_U(groupId, classNameId, urlTitle, start, end, orderByC...
Create a Java method that does the following: "Returns a range of cp friendly url entries where groupId = &#63 ; and classNameId = &#63 ; and urlTitle = &#63 ;.".
Of course, here is the Java code you requested: ```java public void subDivide() { MemoryWorkspace workspace = workspaceMode == WorkspaceMode.NONE ? new DummyWorkspace() : Nd4j.getWorkspaceManager().getWorkspaceForCurrentThread( workspaceConfigurat...
Create a Java method that does the following: "Subdivide the data in this node by the number of children".
Of course, here is the Java code you requested: ```java @Override public ListSubscribedWorkteamsResult listSubscribedWorkteams(ListSubscribedWorkteamsRequest request) { request = beforeClientExecution(request); return executeListSubscribedWorkteams(request); } ``` Hope this helps!
Create a Java method that does the following: "List all of the workteams that are subscribed to a user.".
Of course, here is the Java code you requested: ```java public VolumeStatusItem withActions(VolumeStatusAction... actions) { if (this.actions == null) { setActions(new com.amazonaws.internal.SdkInternalList<VolumeStatusAction>(actions.length)); } for (VolumeStatusAction ele : action...
Create a Java method that does the following: "Sets the value of the actions property.".
Of course, here is the Java code you requested: ```java private Iterable<Path> getPathEntries(String searchPath, Path emptyPathDefault) { ListBuffer<Path> entries = new ListBuffer<>(); for (String s: searchPath.split(Pattern.quote(File.pathSeparator), -1)) { if (s.isEmpty()) { ...
Create a Java method that does the following: "Get the path entries from a path string.".
Of course, here is the Java code you requested: ```java private void extract(int curProgress) { if (extractable != null) { extractable.extractResource(curProgress - lastProgress); } for (final ExtractorListener listener : listeners) { listener.notifyE...
Create a Java method that does the following: "Extract the resource from the extractable.".
Of course, here is the Java code you requested: ```java public void add(final ConfigItem item) { failed = failed || item.getType() == ConfigItemTypes.ERROR; this.list.add(item); } ``` Hope this helps!
Create a Java method that does the following: "Add a new item to the list.".
Of course, here is the Java code you requested: ```java public static void setFontSize(String inFontSize) { // weconsultants@users 20050215 - Changed for Compatbilty fix for JDK 1.3 // Convert Strng to float for deriveFont() call Float stageFloat = new Float(inFontSize); float fontSize...
Create a Java method that does the following: "Sets the font size of the image.".
Of course, here is the Java code you requested: ```java public static Class getTypeClass(Type type) { Class typeClassClass = null; if (type instanceof Class) { typeClassClass = (Class) type; } else if (type instanceof ParameterizedType) { typeClassClass = (Class) ((...
Create a Java method that does the following: "Get the type class.".
Of course, here is the Java code you requested: ```java public String getPrintStructure() { if (getRawContent().hasLocale(m_requestedLocale)) { List<I_CmsXmlContentValue> values = new ArrayList<I_CmsXmlContentValue>( getRawContent().getValues(m_requestedLocale)); Collec...
Create a Java method that does the following: "Returns the print structure of the content.".
Of course, here is the Java code you requested: ```java @Override public void merge(MtasDataCollector<?, ?> newDataCollector, Map<MtasDataCollector<?, ?>, MtasDataCollector<?, ?>> map, boolean increaseSourceNumber) throws IOException { closeNewList(); if (!collectorType.equals(newDataCollector.ge...
Create a Java method that does the following: "Merge the data collector.".
Of course, here is the Java code you requested: ```java public static INDArray col2im(INDArray col, int sH, int sW, int ph, int pW, int kH, int kW) { if (col.rank() != 6) throw new IllegalArgumentException("col2im input array must be rank 6"); INDArray output = Nd4j.create(col.dataType(), ...
Create a Java method that does the following: "2 - D Conv2D Transpose of a column".
Of course, here is the Java code you requested: ```java public boolean process( DMatrixSparseCSC A ) { init(A); TriangularSolver_DSCC.eliminationTree(A,true,parent,gwork); countNonZeroInR(parent); countNonZeroInV(parent); // if more columns than rows it's possible that Q*R !=...
Create a Java method that does the following: "Computes the homography of A.".
Of course, here is the Java code you requested: ```java public PersistentHashArrayMappedTrie<K,V> put(K key, V value) { if (root == null) { return new PersistentHashArrayMappedTrie<>(new Leaf<>(key, value)); } else { return new PersistentHashArrayMappedTrie<>(root.put(key, value, key.hashCode(), 0)...
Create a Java method that does the following: "Put a value into the trie.".
Of course, here is the Java code you requested: ```java public ByteArray rdbLoadLzfStringObject(int flags) throws IOException { boolean plain = (flags & RDB_LOAD_PLAIN) != 0; boolean encode = (flags & RDB_LOAD_ENC) != 0; long clen = rdbLoadLen().len; long len = rdbLoadLen().len; ...
Create a Java method that does the following: "Read a ByteArray object from the underlying stream.".
Of course, here is the Java code you requested: ```java public static String toInitialCaps(String inString) { String lowerString = inString.toLowerCase(); String outString = ""; String alphaChars = "abcdefghijklmnopqrstuvwxyz"; boolean doUpper = true; for (int i = 0; i < lowerString.length(); ...
Create a Java method that does the following: "Converts a String to the initial Caps format".
Of course, here is the Java code you requested: ```java @Override protected void buildClassPath(ArrayList<String> pathList) { if (! _classDir.getScheme().equals("file")) return; try { if (! _classDir.isDirectory() && _sourceDir.isDirectory()) { try { _classDir.mkdirs(); ...
Create a Java method that does the following: "Build the classpath for the class.".
Of course, here is the Java code you requested: ```java public PresenceImpl setCacheStatus(OnlineStatus status) { if (status == null) throw new NullPointerException("Null OnlineStatus is not allowed."); if (status == OnlineStatus.OFFLINE) status = OnlineStatus.INVISIBLE; ...
Create a Java method that does the following: "Sets the status of the subject.".
Of course, here is the Java code you requested: ```java void refresh_stack_information() { int sz = stack.size(); if (0 == sz) { top0 = -1; top1 = -1; } else if (1 == sz) { top0 = stack.get(sz - 1); top1 = -1; }...
Create a Java method that does the following: "refresh_stack_information This method is called to refresh the information in the application.".
Of course, here is the Java code you requested: ```java public Map<String, PubApi> getPubapis(Collection<JavaFileObject> explicitJFOs, boolean explicits) { // Maps ":java.lang" to a package level pub api (with only types on top level) Map<String, PubApi> result = new HashMap<>(); for (ClassSym...
Create a Java method that does the following: "Gets the pubapis for all classes in this class.".
Of course, here is the Java code you requested: ```java public static base_responses delete(nitro_service client, String zonename[]) throws Exception { base_responses result = null; if (zonename != null && zonename.length > 0) { dnszone deleteresources[] = new dnszone[zonename.length]; for (int i=0;i<zonenam...
Create a Java method that does the following: "Use this API to delete dnszone resources of given names.".
Of course, here is the Java code you requested: ```java public boolean intersects(Geometry geometry) { if (geometry == null || isEmpty() || geometry.isEmpty()) { return false; } if (geometry.getNumGeometries() > 1) { for (int n = 0; n < geometry.getNumGeometries(); n++) { if (intersects(geometry.getGe...
Create a Java method that does the following: "Checks if this geometry intersects the given geometry.".
Of course, here is the Java code you requested: ```java public void excludeClass(String... classNames) { if (classNames == null) { excludeClassNames = null; } else { for (String className : classNames) { if (!isExcludePackage(className)) { if ...
Create a Java method that does the following: "Exclude classes from the result.".
Of course, here is the Java code you requested: ```java public static String convert(final String text, final List<String> vars) { String[] array = new String[vars.size()]; StringBuilder sb = new StringBuilder(); convert(sb,text,vars.toArray(array)); return sb.toString(); } ``` Hope this helps!
Create a Java method that does the following: "Convert a text string with the given variables.".
Of course, here is the Java code you requested: ```java @Override protected void valueCreate(String[] strings, Value value) { for (int i = 0; i < strings.length; i++) { value.addPrimitiveValue(labels[i], strings[i]); } for (Entry<Pattern, String[]> entry : simpleJoinMap.entrySe...
Create a Java method that does the following: "Override valueCreate to create the value.".
Of course, here is the Java code you requested: ```java protected ArrayList<AptProperty> initProperties() { ArrayList<AptProperty> properties = new ArrayList<AptProperty>(); if (_propertySet == null || _propertySet.getMethods() == null ) return properties; // Add all d...
Create a Java method that does the following: "Initializes the properties of the entity.".
Of course, here is the Java code you requested: ```java private boolean isSymlink(File base, String path) { return isSymlink(base, SelectorUtils.tokenizePath(path)); } ``` Hope this helps!
Create a Java method that does the following: "Checks if the path is a symbolic link.".
Of course, here is the Java code you requested: ```java @Override public ListRolesResult listRoles(ListRolesRequest request) { request = beforeClientExecution(request); return executeListRoles(request); } ``` Hope this helps!
Create a Java method that does the following: "Returns a list of roles that are contained in a CA.".
Of course, here is the Java code you requested: ```java public double evaluate(double x, double epsilon, int maxIterations) { final double small = 1e-50; double hPrev = getA(0, x); // use the value of small as epsilon criteria for zero checks if (Precision.isEquals(hPrev, 0.0, small)) ...
Create a Java method that does the following: "Evaluate the value of the class A with the specified epsilon and maximum iterations.".
Of course, here is the Java code you requested: ```java public ReplicationClientFactory usingApiKey(String apiKey) { if (Objects.equal(_apiKey, apiKey)) { return this; } return new ReplicationClientFactory(_jerseyClient, apiKey); } ``` Hope this helps!
Create a Java method that does the following: "Returns a new instance of the replication client factory with the specified API key.".
Of course, here is the Java code you requested: ```java public double get(double defaultValue) { final String value = getInternal( Double.toString(defaultValue), false); if (value == null) { return limit(defaultValue); } doubl...
Create a Java method that does the following: "Get the value of the property.".
Of course, here is the Java code you requested: ```java public static int from(String state) { switch (state.toUpperCase()) { case ACTIVE: return Bundle.ACTIVE; case INSTALLED: return Bundle.INSTALLED; case RESOLVED: return Bun...
Create a Java method that does the following: "Get the CRA from the String state.".
Of course, here is the Java code you requested: ```java public Query range(ByteStringRange range) { RowRange.Builder rangeBuilder = RowRange.newBuilder(); switch (range.getStartBound()) { case OPEN: rangeBuilder.setStartKeyOpen(range.getStart()); break; case CLOSED: rangeBu...
Create a Java method that does the following: "Add a range query to the query.".
Of course, here is the Java code you requested: ```java public void setGroups(com.google.api.ads.adwords.axis.v201809.rm.RuleItemGroup[] groups) { this.groups = groups; } ``` Hope this helps!
Create a Java method that does the following: "Sets the groups value for this CIDCTYPE.".
Of course, here is the Java code you requested: ```java public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (this.getOwner() != null) this.getOwner().setOpenMode(this.getOwner().getOpenMode() | DBConstants.OPEN_REFRESH_AND_LOCK_ON_CHANGE_STRATEGY); // Make sure keys...
Create a Java method that does the following: "Set the owner for this record.".
Of course, here is the Java code you requested: ```java public static IntBuffer toBuffer(int... arr) { ByteBuffer directBuffer = ByteBuffer.allocateDirect(arr.length * 4).order(ByteOrder.nativeOrder()); IntBuffer buffer = directBuffer.asIntBuffer(); for (int i = 0; i < arr.length; i++) ...
Create a Java method that does the following: "Convert an array of int to a byte buffer.".
Of course, here is the Java code you requested: ```java public void fillUpdatedObjectProperty(Object entity, Object currentNode, StructuralProperty property, Field field, String node, Map<String, Object> map) throws ODataException { for (Map.Entry<String, Object> entry...
Create a Java method that does the following: "Fill the updated object property.".
Of course, here is the Java code you requested: ```java public static String getJsonString(Object object) { ObjectMapper objectMapper = new ObjectMapper(); String json = null; try { json = objectMapper.writeValueAsString(object); } catch (JsonProcessingException e) { ...
Create a Java method that does the following: "Get the json string from an object".
Of course, here is the Java code you requested: ```java protected void nowReconnectedSync(IOException originalExcep) throws IOException { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Reconnected sync for " + this); } if (!resetWriteBuffers()) { ...
Create a Java method that does the following: "This method is called by the TCPSessionImpl. nowReconnectedSync method.".
Of course, here is the Java code you requested: ```java private void fixFunctionType(Node functionNode) { JSType t = functionNode.getJSType(); if (t == null) { return; } FunctionType ft = t.toMaybeFunctionType(); if (ft != null) { functionNode.setJSType(convertMethodToFunction(ft)); ...
Create a Java method that does the following: "Fix the function type.".
Of course, here is the Java code you requested: ```java public TaskServiceResponse abortTaskSet(Nexus nexus) { try { this.taskSet.abort(nexus); return TaskServiceResponse.FUNCTION_COMPLETE; } catch (InterruptedException e) { return TaskServiceResponse.SERVICE...
Create a Java method that does the following: "Abort the task set.".
Of course, here is the Java code you requested: ```java private ReferenceType computeFirstCommonSuperclassOfSameDimensionArrays(ArrayType aArrType, ArrayType bArrType) throws ClassNotFoundException { assert aArrType.getDimensions() == bArrType.getDimensions(); Type aBaseType = aArrType.get...
Create a Java method that does the following: "Compute the first common supertype of the two arrays.".
Of course, here is the Java code you requested: ```java String objectsToString(String key, Object objects) { java.io.StringWriter stringWriter = new java.io.StringWriter(); stringWriter.write(key); stringWriter.write(":"); if (objects == null) { stringWriter.write("\n"); ...
Create a Java method that does the following: "This method is used to write a String object to a String".
Of course, here is the Java code you requested: ```java public String getLongDiffString() { StringBuilder deltas = new StringBuilder(); for(Delta delta:getPatch().getDeltas()){ deltas.append("DeltaType: "+delta.getType().toString()); deltas.append(System.getProperty("line.separator")); deltas.append("Orig...
Create a Java method that does the following: "Get the long diff string.".
Of course, here is the Java code you requested: ```java public static CommerceCurrency fetchByG_P_A_First(long groupId, boolean primary, boolean active, OrderByComparator<CommerceCurrency> orderByComparator) { return getPersistence() .fetchByG_P_A_First(groupId, primary, active, orderByComparator); } ...
Create a Java method that does the following: "Returns the commerce currency in the ordered set where groupId = &#63 ; and primary = &#63 ; and active = &#63 ;.".
Of course, here is the Java code you requested: ```java int getState() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getState"); int currentState; synchronized (stateLock) { currentState = state; } if (TraceCo...
Create a Java method that does the following: "Get the state of the application.".
Of course, here is the Java code you requested: ```java static public FileSystemManager getManager(){ StandardFileSystemManager fsManager = new StandardFileSystemManager(); try { fsManager.init(); } catch (FileSystemException e) { log.error("Cannot initialize StandardFileSystemManager.", e); } r...
Create a Java method that does the following: "Gets the FileSystemManager.".
Of course, here is the Java code you requested: ```java public static SessionConfigurationException fromThrowable(Throwable cause) { return (cause instanceof SessionConfigurationException) ? (SessionConfigurationException) cause : new SessionConfigurationException(cause); } ...
Create a Java method that does the following: "Converts a Throwable to a SessionConfigurationException. If the Throwable is a SessionConfigurationException it will be passed through unmodified ; otherwise it will be wrapped in a new SessionConfigurationException.".
Of course, here is the Java code you requested: ```java public void setRGB(int r, int g, int b){ setValue(Pixel.rgb(r, g, b)); } ``` Hope this helps!
Create a Java method that does the following: "Sets the RGB value of this color to the given values.".
Of course, here is the Java code you requested: ```java public static void transformN(WaveletDescription<WlCoef_F32> desc , GrayF32 input , GrayF32 output , GrayF32 storage , int numLevels ) { if( numLevels == 1 ) { transform1(desc,input,output, storage); return; } UtilWavel...
Create a Java method that does the following: "Transform the image using the N - levels.".
Of course, here is the Java code you requested: ```java public byte[] compress(final String data, byte[] uploadFile) throws CompressionException { if (!StringUtils.hasText(data)) { return null; } ByteArrayOutputStream baos = null; OutputStream deflater = null; byte[] compressedData = null; try { ba...
Create a Java method that does the following: "Compress the data using Deflate.".
Of course, here is the Java code you requested: ```java public <T extends MessageLite> T readMessage( final Parser<T> parser, final ExtensionRegistryLite extensionRegistry) throws IOException { int length = readRawVarint32(); if (recursionDepth >= recursionLimit) { throw InvalidProtocol...
Create a Java method that does the following: "Read a message from the input stream.".
Of course, here is the Java code you requested: ```java public static <A> Will<A> failedWill(Throwable throwable) { return forListenableFuture(Futures.<A>immediateFailedFuture(throwable)); } ``` Hope this helps!
Create a Java method that does the following: "Creates a Will object that will be used to report a failed exception.".
Of course, here is the Java code you requested: ```java public int readLine(byte b[], int off, int len) throws IOException { int result, left = totalExpected - totalRead; if (left <= 0) { return -1; } else { result = ((ServletInputStream)in).readLine(b, off, Math.min(left, len)); } if (...
Create a Java method that does the following: "Read a line of bytes from the underlying input stream.".
Of course, here is the Java code you requested: ```java public void setDateReleased(CmsRequestContext context, CmsResource resource, long dateReleased) throws CmsException, CmsSecurityException { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); try { checkOfflineProject(dbc...
Create a Java method that does the following: "Sets the date released for a resource.".
Of course, here is the Java code you requested: ```java @Deprecated public static <R extends Runnable> void run(Class<R> runnableClass, IFactory factory, PrintStream out, PrintStream err, Help.Ansi ansi, String... args) { CommandLine cmd = new CommandLine(runnableClass, factory); cmd.parseWithHandlers(...
Create a Java method that does the following: "Run a runnable class with the specified arguments.".
Of course, here is the Java code you requested: ```java private void tryWriteBytes() throws IOException { lock.lock(); try { // Iterate through the outbound ByteBuff queue, pushing as much as possible into the OS' network buffer. Iterator<ByteBuffer> bytesIterator = bytesToWrite...
Create a Java method that does the following: "Try to write bytes into the underlying file.".
Of course, here is the Java code you requested: ```java @Override public final void exportTo(final File target, final boolean overwrite) throws ArchiveExportException, FileExistsException { // Get stream and perform precondition checks final OutputStream out = this.getOutputStreamToFile(tar...
Create a Java method that does the following: "Export the CRA to the specified file.".
Of course, here is the Java code you requested: ```java protected void appendDetail(StringBuilder buffer, String fieldName, short[] array) { buffer.append(arrayStart); for (int i = 0; i < array.length; i++) { if (i > 0) { buffer.append(arraySeparator); } ...
Create a Java method that does the following: "Append the detail of the array of shorts.".
Of course, here is the Java code you requested: ```java public static TraceComponent register(String name, Class<?> aClass, String[] groups) { return register(name, aClass, groups, null); } ``` Hope this helps!
Create a Java method that does the following: "Register a class with the trace context.".
Of course, here is the Java code you requested: ```java public boolean enter(long maxWait, TimeUnit unit) throws Exception { long startMs = System.currentTimeMillis(); boolean hasMaxWait = (unit != null); long maxWaitMs = hasMaxWait ? TimeUnit.MILLISECONDS....
Create a Java method that does the following: "Enter a new entry in the cache.".
Of course, here is the Java code you requested: ```java protected byte[] getFileBytes(ClassFile classFile) throws IOException { File file = new File(classFile.getFilePath()); FileInputStream fin = new FileInputStream(file); byte[] raw=InputStreamUtils.getBytes(fin); fin.close(); return raw; } ``` Hope this...
Create a Java method that does the following: "Get the bytes of a file.".
Of course, here is the Java code you requested: ```java private SOAPElement constructSoapHeader(Map<String, Object> headerData, AdWordsServiceDescriptor adWordsServiceDescriptor) { String requestHeaderNamespace = adWordsApiConfiguration.getNamespacePrefix() + "/" + adWordsServiceDescripto...
Create a Java method that does the following: "Construct the SOAP header for the request".
Of course, here is the Java code you requested: ```java @Override public Pool create(int minimum, int maximum, EJBPMICollaborator beanPerf, PoolDiscardStrategy d) { PoolImplBase result = new PoolImplThreadSafe(minimum, maximum, beanPerf, d, this); if (TraceComponent.isAnyTracingEnabled() && tc....
Create a Java method that does the following: "Create a new instance of the NIC.".
Of course, here is the Java code you requested: ```java public EClass getIfcLuminousIntensityDistributionMeasure() { if (ifcLuminousIntensityDistributionMeasureEClass == null) { ifcLuminousIntensityDistributionMeasureEClass = (EClass) EPackage.Registry.INSTANCE .getEPackage(Ifc2x3tc1Package.eNS_URI).getEC...
Create a Java method that does the following: "Get the IfcLuminousIntensityDistributionMeasure object from the Registry.".
Of course, here is the Java code you requested: ```java public com.google.api.ads.adwords.axis.v201809.o.AdGroupEstimate[] getAdGroupEstimates() { return adGroupEstimates; } ``` Hope this helps!
Create a Java method that does the following: "Gets the adGroupEstimates value for this CdnEstimate.".
Of course, here is the Java code you requested: ```java private Object getStaticMethods(Class sender, String name) { final MetaMethodIndex.Entry entry = metaMethodIndex.getMethods(sender, name); if (entry == null) return FastArray.EMPTY_LIST; Object answer = entry.staticMethods; ...
Create a Java method that does the following: "Get the static methods of a class.".
Of course, here is the Java code you requested: ```java long executeSQL(boolean isFinal) throws VoltAbortException { long count = 0; VoltTable[] results = voltExecuteSQL(isFinal); for (VoltTable result : results) { long dmlUpdated = result.asScalarLong(); if (dmlUpdated ...
Create a Java method that does the following: "Execute the SQL statement.".
Of course, here is the Java code you requested: ```java private void updateMaxExtent() { if (targetMap.getMapModel().isInitialized() && getGraphics().isReady()) { // map view size may not have been set yet ! getMapModel().getMapView().setSize(getWidth(), getHeight()); Bbox targetMaxBounds = getOverviewMaxBo...
Create a Java method that does the following: "Update the max extent rectangle.".
Of course, here is the Java code you requested: ```java public CredentialsConfig getResolvingCredentialsConfig() { if (resolverCredentialsConfig != null && resolverCredentialsConfig.isCredentialsProvided()) { return getResolverCredentialsConfig(); } if (deployerCredentialsConfig != ...
Create a Java method that does the following: "Get the resolving credentials config.".
Of course, here is the Java code you requested: ```java public void setAlternativeUnitTypeForecasts(com.google.api.ads.admanager.axis.v201808.AlternativeUnitTypeForecast[] alternativeUnitTypeForecasts) { this.alternativeUnitTypeForecasts = alternativeUnitTypeForecasts; } ``` Hope this helps!
Create a Java method that does the following: "Sets the alternativeUnitTypeForecasts value for this BaseProductForecast.".
Of course, here is the Java code you requested: ```java private boolean matchStrings(String pattern, String str, Map<String, String> uriTemplateVariables) { return getStringMatcher(pattern).matchStrings(str, uriTemplateVariables); } ``` Hope this helps!
Create a Java method that does the following: "Match strings.".
Of course, here is the Java code you requested: ```java public void saveAsSVG(File file) throws IOException, TransformerFactoryConfigurationError, TransformerException { OutputStream out = new BufferedOutputStream(new FileOutputStream(file)); // TODO embed linked images. javax.xml.transform.Result result =...
Create a Java method that does the following: "Save the document as an SVG file.".
Of course, here is the Java code you requested: ```java private void updateUserMessage() throws IOException { final byte from = in.readByte(); final byte dest = in.readByte(); final byte type = in.readByte(); final int size = in.readInt(); if (size > 0) { ...
Create a Java method that does the following: "Update the user message.".
Of course, here is the Java code you requested: ```java public static <T> QBean<T> fields(Path<? extends T> type, Map<String, ? extends Expression<?>> bindings) { return new QBean<T>(type.getType(), true, bindings); } ``` Hope this helps!
Create a Java method that does the following: "Create a new instance of a class with the given type and bindings.".
Of course, here is the Java code you requested: ```java static HeapUpdateDoublesSketch heapifyInstance(final Memory srcMem) { final long memCapBytes = srcMem.getCapacity(); if (memCapBytes < 8) { throw new SketchesArgumentException("Source Memory too small: " + memCapBytes + " < 8"); } final int...
Create a Java method that does the following: "Heapify the given Memory.".
Of course, here is the Java code you requested: ```java public void marshall(UpdateProvisionedProductRequest updateProvisionedProductRequest, ProtocolMarshaller protocolMarshaller) { if (updateProvisionedProductRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(.....
Create a Java method that does the following: "marshalls the given parameter object.".
Of course, here is the Java code you requested: ```java public static vpnglobal_sharefileserver_binding[] get(nitro_service service) throws Exception{ vpnglobal_sharefileserver_binding obj = new vpnglobal_sharefileserver_binding(); vpnglobal_sharefileserver_binding response[] = (vpnglobal_sharefileserver_binding[]...
Create a Java method that does the following: "Use this API to fetch a vpnglobal_sharefileserver_binding resources.".
Of course, here is the Java code you requested: ```java private Set<VarBindingDef> getPropertyProviders( Set<String> properties) { Set<VarBindingDef> bindings = new HashSet<VarBindingDef>(); for( String property : properties) { bindings.addAll( propertyProviders_.get( property)); } r...
Create a Java method that does the following: "Get the property providers for the given properties.".
Of course, here is the Java code you requested: ```java public static double checkPostconditionD( final double value, final boolean condition, final DoubleFunction<String> describer) { return innerCheckD(value, condition, describer); } ``` Hope this helps!
Create a Java method that does the following: "Check postcondition d.".
Of course, here is the Java code you requested: ```java public static Class<?> getType(Object object) { Class<?> type = null; if (isClass(object)) { type = (Class<?>) object; } else if (object != null) { type = object.getClass(); } return type; } ``` ...
Create a Java method that does the following: "Get the type of the object.".