code
stringlengths
146
69.7k
prompt
stringlengths
55
1.5k
Of course, here is the Java code you requested: ```java private void traceConfig() { writer.println(new StringBuilder(180).append(impl.getClass().getName()).append(' ').append(traceID).append(" = new "). append(impl.getClass().getName()).append("();").toString()); try { ...
Create a Java method that does the following: "Trace the configuration of the class.".
Of course, here is the Java code you requested: ```java protected boolean isPartOfExpressionTree(EObject container) { if (container instanceof XExpression) { return true; } EClass type = container.eClass(); return type == XbasePackage.Literals.XCASE_PART || type == XbasePackage.Literals.XCATCH_CLAUSE || typ...
Create a Java method that does the following: "Replies if the given container is part of an expression tree.".
Of course, here is the Java code you requested: ```java public void insert(Document document, QueryOptions options) { int writeConcern = 1; int ms = 0; if (options != null && (options.containsKey("w") || options.containsKey("wtimeout"))) { // Some info about params: http://api.mongo...
Create a Java method that does the following: "Insert a document in the database.".
Of course, here is the Java code you requested: ```java public TroubleshootingResultInner beginGetTroubleshootingResult(String resourceGroupName, String networkWatcherName, String targetResourceId) { return beginGetTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResou...
Create a Java method that does the following: "Get the result of troubleshooting for a resource.".
Of course, here is the Java code you requested: ```java @Override protected boolean isAcquireTimeoutException(Exception e) { return e instanceof SQLTimeoutException || SQL_TRANSIENT_CONNECTION_EXCEPTION_CLASS_NAME.equals(e.getClass().getName()) || (e.getMessage() != null && Patt...
Create a Java method that does the following: "Override to check if an exception is a acquire timeout exception.".
Of course, here is the Java code you requested: ```java private List<O> findByDate(String dateField, Date start, Date end, int numObjects, boolean asc) { if (start == null) start = new Date(0); if (end == null) end = new Date(); return getDatastore().find(clazz).filter(d...
Create a Java method that does the following: "Find by date.".
Of course, here is the Java code you requested: ```java public static int encode(BigInteger value, byte[] dst, int dstOffset) { /* Encoding of first byte: 0x00: null low (unused) 0x01: negative signum; four bytes follow for value length 0x02..0x7f: negative signum; val...
Create a Java method that does the following: "Encodes a BigInteger into exactly 4 bytes.".
Of course, here is the Java code you requested: ```java @Override public ResourceSet<ExecutionStep> read(final TwilioRestClient client) { return new ResourceSet<>(this, client, firstPage(client)); } ``` Hope this helps!
Create a Java method that does the following: "Example of reading a .".
Of course, here is the Java code you requested: ```java private BudgetYear1DataType getBudgetJustificationAttachment(BudgetYear1DataType budgetYear) { AttachedFileDataType attachedFileDataType = null; budgetYear.setBudgetJustificationAttachment(null); for (NarrativeContract narrative : pdDoc.ge...
Create a Java method that does the following: "This method is to get the BudgetJustificationAttachment object from the Narrative list.".
Of course, here is the Java code you requested: ```java List<Entity> get(Iterable<Key> keys) throws IOException { return call(() -> ImmutableList.copyOf(rw.get(toArray(keys, Key.class)))); } ``` Hope this helps!
Create a Java method that does the following: "Get a list of entities from the database.".
Of course, here is the Java code you requested: ```java public <T> T invokeMethod(final Object bean, final Method method) { final WiringMode wiringMode = petiteConfig.resolveWiringMode(null); final BeanDefinition def = externalsCache.get( bean.getClass(), () -> { final BeanDefinition beanDefinition = creat...
Create a Java method that does the following: "Invoke a method on a bean.".
Of course, here is the Java code you requested: ```java public BoundingBox getBoundingBox() { BoundingBox boundingBox = new BoundingBox(getMinX(), getMinY(), getMaxX(), getMaxY()); return boundingBox; } ``` Hope this helps!
Create a Java method that does the following: "Get the bounding box of the rectangle".
Of course, here is the Java code you requested: ```java @Override public boolean decompose( ZMatrixRMaj mat ) { if( mat.numRows != mat.numCols ) { throw new IllegalArgumentException("Must be a square matrix."); } n = mat.numRows; T = mat; t = T.data; i...
Create a Java method that does the following: "Decomposes the matrix.".
Of course, here is the Java code you requested: ```java public double norm() { double t = 0; for (int r = 0; r < nRows; ++r) { double v = values[r][0]; t += v*v; } return (double) Math.sqrt(t); } ``` Hope this helps!
Create a Java method that does the following: "Returns the norm of the sequence.".
Of course, here is the Java code you requested: ```java public SamplingRuleUpdate withAttributes(java.util.Map<String, String> attributes) { setAttributes(attributes); return this; } ``` Hope this helps!
Create a Java method that does the following: "Sets the attributes for the SamplingRule.".
Of course, here is the Java code you requested: ```java private static void convolve(double[] xreal, double[] ximag, double[] yreal, double[] yimag, double[] outreal, double[] outimag) { // if (xreal.length != ximag.length || xreal.length != yreal.length || yreal.length != yimag.length || xreal.length != outre...
Create a Java method that does the following: "Convolve two data sets of data structures and store the results in outreal and outimag.".
Of course, here is the Java code you requested: ```java private void createRoleList(final VerticalLayout roleSummaryLayoutTabsheet, final List<AssignmentData> assignmentList) { final Comparator<AssignmentData> compare = (o1, o2) -> o1.getFromDate().compareTo(o2.getFromDate()); Collections.sort(assignmentList,...
Create a Java method that does the following: "Create the role list.".
Of course, here is the Java code you requested: ```java public void afterConnectionClosed(WebSocketSession session, CloseStatus status) { logger.debug("WebSocket closed: {}, Close Status: {}", session, status.toString()); } ``` Hope this helps!
Create a Java method that does the following: "Called after a connection has been closed.".
Of course, here is the Java code you requested: ```java public static void addTo( JTabbedPane tabbedPane, String title, JComponent component, boolean confirmClose) { if (confirmClose) { addTo(tabbedPane, title, component, CloseCallbacks.confirming()); } ...
Create a Java method that does the following: "Add a component to a JTabbedPane with a title and a component.".
Of course, here is the Java code you requested: ```java private void addExampleUsingStringArray() { add(new WHeading(HeadingLevel.H3, "WCheckBoxSelect created using a String array")); String[] options = new String[]{"Dog", "Cat", "Bird", "Turtle"}; final WCheckBoxSelect select = new WCheckBoxSelect(options); s...
Create a Java method that does the following: "Add example using a String array.".
Of course, here is the Java code you requested: ```java public void marshall(ArchiveFindingsRequest archiveFindingsRequest, ProtocolMarshaller protocolMarshaller) { if (archiveFindingsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } tr...
Create a Java method that does the following: "marshalls the given archive finding request to the JSON object.".
Of course, here is the Java code you requested: ```java public List getSteps() { // simply merge our 'step' with our 'next' List l; if (next != null) l = next.getSteps(); else l = new Vector(); l.add(0, step); return l; } ``` Hope this helps!
Create a Java method that does the following: "Get the steps of this node.".
Of course, here is the Java code you requested: ```java public EClass getIfcModulusOfLinearSubgradeReactionMeasure() { if (ifcModulusOfLinearSubgradeReactionMeasureEClass == null) { ifcModulusOfLinearSubgradeReactionMeasureEClass = (EClass) EPackage.Registry.INSTANCE .getEPackage(Ifc2x3tc1Package.eNS_URI)...
Create a Java method that does the following: "Get the IfcModulusOfLinearSubgradeReactionMeasure method.".
Of course, here is the Java code you requested: ```java @SneakyThrows @Subscribe public final synchronized void renew(final PropertiesChangedEvent propertiesChangedEvent) { dataSource = new MasterSlaveDataSource(dataSource.getDataSourceMap(), dataSource.getMasterSlaveRule(), propertiesChangedEvent.getP...
Create a Java method that does the following: "Renews the data source.".
Of course, here is the Java code you requested: ```java protected static KeyValueNode<?> transformMetaData(final CSNodeWrapper node, final Map<Integer, Node> nodes, final Map<String, SpecTopic> targetTopics, final List<CSNodeWrapper> relationshipFromNodes) { final KeyValueNode<?> keyValueNode; ...
Create a Java method that does the following: "Transform a Content Spec Node to a KeyValueNode.".
Of course, here is the Java code you requested: ```java public static List<CmsJspContentAccessBean> convertResourceList(CmsObject cms, List<CmsResource> resources) { return convertResourceList(cms, cms.getRequestContext().getLocale(), resources); } ``` Hope this helps!
Create a Java method that does the following: "Converts a list of resources to a list of jsp content access beans.".
Of course, here is the Java code you requested: ```java public void write(DataOutput out) throws IOException { if (array == null) { out.write(NDARRAY_SER_VERSION_HEADER_NULL); return; } INDArray toWrite; if (array.isView()) { toWrite = array.dup(); ...
Create a Java method that does the following: "Write the data in the CIS format".
Of course, here is the Java code you requested: ```java public void addBatch(final String sql) throws SQLException { if (batchQueries == null) { batchQueries = new ArrayList<>(); } if (sql == null) { throw ExceptionMapper.getSqlException("null cannot be set to addBatch( String sql)"); } ...
Create a Java method that does the following: "Add a batch of SQL statements to the batch.".
Of course, here is the Java code you requested: ```java private void init(final Window window, final CmsAccountsApp app, final CmsUserSettings settings, boolean enabled) { m_userdata.initFields(m_user, enabled ? EditLevel.all : EditLevel.none); if (m_user != null) { if (CmsStringUtil.isEmp...
Create a Java method that does the following: "Initializes the application.".
Of course, here is the Java code you requested: ```java @BetaApi public final Policy getIamPolicySubnetwork(String resource) { GetIamPolicySubnetworkHttpRequest request = GetIamPolicySubnetworkHttpRequest.newBuilder().setResource(resource).build(); return getIamPolicySubnetwork(request); } ``` Ho...
Create a Java method that does the following: "Gets the IAM policy for the specified resource.".
Of course, here is the Java code you requested: ```java public void addTerm(Term term) { // 是否有人名 if (!hasPerson && term.termNatures().personAttr.isActive()) { hasPerson = true; } if (!hasNumQua && term.termNatures().numAttr.isQua()) { hasNumQua = true; } TermUtil.insertTerm(terms, term, InsertTermT...
Create a Java method that does the following: "Add a term to the document.".
Of course, here is the Java code you requested: ```java public SmartHandle cast(Signature incoming) { return new SmartHandle(incoming, MethodHandles.explicitCastArguments(handle, incoming.type())); } ``` Hope this helps!
Create a Java method that does the following: "Cast a signature to a single object.".
Of course, here is the Java code you requested: ```java public Observable<Page<FailoverGroupInner>> listByServerAsync(final String resourceGroupName, final String serverName) { return listByServerWithServiceResponseAsync(resourceGroupName, serverName) .map(new Func1<ServiceResponse<Page<FailoverGro...
Create a Java method that does the following: "Gets a list of failover groups.".
Of course, here is the Java code you requested: ```java public static Cell create(String cellName) { return create(cellName, (Object) null, Boolean.FALSE, Boolean.FALSE); } ``` Hope this helps!
Create a Java method that does the following: "Create a new cell with the specified name.".
Of course, here is the Java code you requested: ```java public IfcLaborResourceTypeEnum createIfcLaborResourceTypeEnumFromString(EDataType eDataType, String initialValue) { IfcLaborResourceTypeEnum result = IfcLaborResourceTypeEnum.get(initialValue); if (result == null) throw new IllegalArgumentException( ...
Create a Java method that does the following: "Converts a String to a IfcLaborResourceTypeEnum.".
Of course, here is the Java code you requested: ```java @Override public synchronized void readFields(DataInput in) throws IOException { int numClasses = in.readInt(); groups.clear(); while (numClasses-- > 0) { String groupName = Text.readString(in); CounterGroup group = new CounterGroup(grou...
Create a Java method that does the following: "Read the data in the CRS file.".
Of course, here is the Java code you requested: ```java public static Request newUploadPhotoRequest(Session session, Bitmap image, Callback callback) { Bundle parameters = new Bundle(1); parameters.putParcelable(PICTURE_PARAM, image); return new Request(session, MY_PHOTOS, parameters, HttpMeth...
Create a Java method that does the following: "Creates a new Request configured to upload a photo to the user s default photo directory.".
Of course, here is the Java code you requested: ```java static int adjustByteCount(final int offset, final int count, final int memorySize) { final int available = Math.max(0, memorySize - offset); return Math.min(available, count); } ``` Hope this helps!
Create a Java method that does the following: "Adjust byte count.".
Of course, here is the Java code you requested: ```java public boolean isPositiveLS(long utc) { if (utc <= 0) { return false; } final ExtendedLSE[] events = this.getEventsInDescendingOrder(); for (int i = 0; i < events.length; i++) { long comp = events[i].utc(...
Create a Java method that does the following: "Is the utc value positive.".
Of course, here is the Java code you requested: ```java public static boolean canInteract(Member issuer, Member target) { Checks.notNull(issuer, "Issuer Member"); Checks.notNull(target, "Target Member"); Guild guild = issuer.getGuild(); if (!guild.equals(target.getGuild())) ...
Create a Java method that does the following: "Checks if the two members of the issuer member can be interacted with the target member.".
Of course, here is the Java code you requested: ```java @Override public List<JobInstance> getJobs(Query query) { return JqmClientFactory.getClient().getJobs(query); } ``` Hope this helps!
Create a Java method that does the following: "Get a list of jobs that match the specified query.".
Of course, here is the Java code you requested: ```java public void setPrimaryButtonColor(String color) throws HelloSignException { if (white_labeling_options == null) { white_labeling_options = new WhiteLabelingOptions(); } white_labeling_options.setPrimaryButtonColor(color); }...
Create a Java method that does the following: "Sets the signer primary button color.".
Of course, here is the Java code you requested: ```java @Deprecated protected Class<?> getGenericRole(Field field) { Type type = field.getGenericType(); if (type instanceof ParameterizedType) { ParameterizedType pType = (ParameterizedType) type; Type[] types = pType.get...
Create a Java method that does the following: "Get the generic role of a field.".
Of course, here is the Java code you requested: ```java public static void scale(File srcImageFile, File destImageFile, float scale) { scale(read(srcImageFile), destImageFile, scale); } ``` Hope this helps!
Create a Java method that does the following: "Scales the srcImageFile to a scale factor.".
Of course, here is the Java code you requested: ```java @Override protected Result check() throws Exception { final IndicesExistsResponse indicesExistsResponse = client.admin().indices().prepareExists(indices).get(); if (indicesExistsResponse.isExists()) { return Result.healthy(); ...
Create a Java method that does the following: "Check if the system is healthy.".
Of course, here is the Java code you requested: ```java public void destroy(SocketDestination dest, SocketAndStreams sands) throws Exception { sands.getSocket().close(); int numDestroyed = destroyed.incrementAndGet(); if(logger.isDebugEnabled()) logger.debug("Destroyed socket " + nu...
Create a Java method that does the following: "Destroy a connection to a single socket.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unused") // called through reflection by RequestServer public GridsV99 list(int version, GridsV99 s) { final Key[] gridKeys = KeySnapshot.globalSnapshot().filter(new KeySnapshot.KVFilter() { @Override public boolean filter(Key...
Create a Java method that does the following: "List all grids in the global snapshot.".
Of course, here is the Java code you requested: ```java public JMenuItem addMenuItem(JMenu menu, String strCommand, ActionListener targetListener, KeyStroke keyStroke) { BaseAction action = new BaseAction(strCommand, targetListener); if (keyStroke != null) action.putValue(Action.ACCELER...
Create a Java method that does the following: "Add this menu item to this menu.".
Of course, here is the Java code you requested: ```java public static List<OwnerAndPermission> resolveReplicatedOwnerAndPermissionsRecursively(FileSystem sourceFs, Path fromPath, Path toPath, CopyConfiguration copyConfiguration) throws IOException { if (!PathUtils.isAncestor(toPath, fromPath)) { throw...
Create a Java method that does the following: "Resolve the owner and permissions recursively.".
Of course, here is the Java code you requested: ```java public void setEnabled(boolean enabled) { if (isEnabled() == enabled) return; if (!fireEvent(new DisabledStateChange<>(this, enabled))) return; this.enabled = enabled; if (enabled) { setHovered(false); setFocused(false); } } ``` Hope ...
Create a Java method that does the following: "Enables or disables the device.".
Of course, here is the Java code you requested: ```java public com.google.api.ads.admanager.axis.v201902.VideoPositionTargeting getVideoPositionSegment() { return videoPositionSegment; } ``` Hope this helps!
Create a Java method that does the following: "Gets the videoPositionSegment value for this ProductSegmentation.".
Of course, here is the Java code you requested: ```java public List<com.ibm.wsspi.security.wim.model.CheckPointType> getCheckPoint() { if (checkPoint == null) { checkPoint = new ArrayList<com.ibm.wsspi.security.wim.model.CheckPointType>(); } return this.checkPoint; } ``` Hope t...
Create a Java method that does the following: "Gets the value of the checkPoint property.".
Of course, here is the Java code you requested: ```java @Override @SuppressFBWarnings ("IL_INFINITE_LOOP") public void write (final String s, final int off, final int len) throws IOException { _ensureOpen (); int b = off; final int t = off + len; while (b < t) { final int d = Math.min ...
Create a Java method that does the following: "Write a sequence of characters from a string to the output stream.".
Of course, here is the Java code you requested: ```java public final void load(final File fDirectory) throws PluginConfigurationException { File[] vFiles = fDirectory.listFiles(); if (vFiles != null) { for (File f : vFiles) { if (f.isDirectory()) { config...
Create a Java method that does the following: "Load the class from the directory.".
Of course, here is the Java code you requested: ```java private static boolean checkArgs(String[] args) { boolean result = (args.length > 0); if (!result) { System.out .println("Usage: java -jar JWPLTimeMachine.jar <config-file>"); } return result; } ``` Hope this helps!
Create a Java method that does the following: "Check the command line arguments.".
Of course, here is the Java code you requested: ```java @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AfplibPackage.RENDERING_INTENT__RESERVED: return getReserved(); case AfplibPackage.RENDERING_INTENT__IOCARI: return getIOCARI(); case Af...
Create a Java method that does the following: "Override eGet to return the value of the featureID".
Of course, here is the Java code you requested: ```java protected void addSourceFolder(String path) { final List<String> existingFolders1 = this.project.getCompileSourceRoots(); final List<String> existingFolders2 = this.project.getTestCompileSourceRoots(); if (!existingFolders1.contains(path) && !existingFolder...
Create a Java method that does the following: "Add a source folder to the project.".
Of course, here is the Java code you requested: ```java private double project(double[] pointA, int i) { assert (this.projections.size() < i && this.projections.get(i).length == pointA.length); return Metric.dotProduct(pointA, this.projections.get(i)); } ``` Hope this helps!
Create a Java method that does the following: "Project a point into a single value.".
Of course, here is the Java code you requested: ```java private void populateActivityCodes(Task task) { List<Integer> list = m_activityCodeAssignments.get(task.getUniqueID()); if (list != null) { for (Integer id : list) { ActivityCodeValue value = m_activityCodeMap.ge...
Create a Java method that does the following: "Populates activity codes for a task.".
Of course, here is the Java code you requested: ```java public static <T> Collector<T, ?, Optional<Double>> percentRank(T value, Comparator<? super T> comparator) { return percentRankBy(value, t -> t, comparator); } ``` Hope this helps!
Create a Java method that does the following: "Collect a stream of values to a metric by using the given comparator.".
Of course, here is the Java code you requested: ```java public XWPFRun insertNewHyperLinkRun(int pos, String link) { if (pos >= 0 && pos <= paragraph.getRuns().size()) { PackageRelationship relationship = paragraph.getDocument().getPackagePart() .addExternalRelationship(link, XW...
Create a Java method that does the following: "Insert a new hyperlink run in the paragraph at the given position.".
Of course, here is the Java code you requested: ```java public <C extends EvictionCandidate<A, E>> C evaluate(Iterable<C> evictionCandidates) { C selectedEvictionCandidate = null; long now = Clock.currentTimeMillis(); for (C currentEvictionCandidate : evictionCandidates) { if (selec...
Create a Java method that does the following: "Evaluate the list of EvictionCandidates.".
Of course, here is the Java code you requested: ```java private void validateFilter(Filter filter) throws IllegalArgumentException { switch (filter.getFilterTypeCase()) { case COMPOSITE_FILTER: for (Filter subFilter : filter.getCompositeFilter().getFiltersList()) { validateFilter(subFilter)...
Create a Java method that does the following: "Validate the filter.".
Of course, here is the Java code you requested: ```java public static String toStringConstructor(final Constructor constructor, final Map<String, Type> generics) { return String.format("%s(%s)", constructor.getDeclaringClass().getSimpleName(), toStringTypes(constructor.getGeneri...
Create a Java method that does the following: "ToString constructor.".
Of course, here is the Java code you requested: ```java public static void unbind(Name name) throws NameNotFoundException { String key = name.toString(); if( wrapperMap.remove(key) == null ) throw new NameNotFoundException(key+" was not found in the NonSerializableFactory map"); ...
Create a Java method that does the following: "Unbinds a class from the wrapper map.".
Of course, here is the Java code you requested: ```java public static Stack startIfNotEmpty() { Stack stack = getStack(); if (!stack.elements.isEmpty()) { stack.push(CombinedInterceptorAndDecoratorStackMethodHandler.NULL_INSTANCE); return stack; } else { // i...
Create a Java method that does the following: "Start empty stack.".
Of course, here is the Java code you requested: ```java private static boolean contains(final Multimap<String, ?> map, final String searchKey) { for (String key: map.keys()) { if (key.equalsIgnoreCase(searchKey)) { return true; } } return false; } ```...
Create a Java method that does the following: "Checks if the map contains the search key.".
Of course, here is the Java code you requested: ```java static void parse(String path, DbConn cnx) throws JqmXmlException { parse(path, cnx, null); } ``` Hope this helps!
Create a Java method that does the following: "Parse a CRTCTYPE file from a path.".
Of course, here is the Java code you requested: ```java public RESTData getDataOfImportTask(Integer importJobId, Integer taskId) throws Exception { final DeserializationFeature unwrapRootValueFeature = DeserializationFeature.UNWRAP_ROOT_VALUE; boolean unwrapRootValueFeatureIsEnabled = mapper.is...
Create a Java method that does the following: "Get the data of an import task.".
Of course, here is the Java code you requested: ```java protected Boolean getBoolean(final String key, final JSONObject jsonObject) { Boolean value = null; if(hasKey(key, jsonObject)) { try { value = jsonObject.getBoolean(key); } catch(JSONException e) { LOGGER.debug("Could no...
Create a Java method that does the following: "Get a boolean value from a JSONObject.".
Of course, here is the Java code you requested: ```java @Nonnull @ReturnsMutableCopy public static byte [] encodeBytesToBytes (@Nonnull final byte [] source) { byte [] encoded; try { encoded = encodeBytesToBytes (source, 0, source.length, NO_OPTIONS); } catch (final IOException ex) ...
Create a Java method that does the following: "Encode bytes to bytes.".
Of course, here is the Java code you requested: ```java public static boolean tryFillGap( final UnsafeBuffer logMetaDataBuffer, final UnsafeBuffer termBuffer, final int termId, final int gapOffset, final int gapLength) { int offset = (gapOffset + gapLength) - FRAME_A...
Create a Java method that does the following: "Try to fill gap in a single entry.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("synthetic-access") public void setEulerAngles(EulerAngles angles) { setEulerAngles( angles.getAttitude(), angles.getBank(), angles.getHeading(), angles.getSystem()); } ``` Hope this helps!
Create a Java method that does the following: "Sets the euler angles of this object.".
Of course, here is the Java code you requested: ```java public void writeRevision(final Task<Revision> task) throws IOException { if (task.getTaskType() == TaskTypes.TASK_PARTIAL_FIRST || task.getTaskType() == TaskTypes.TASK_FULL) { this.writer.write(WikipediaXMLKeys.KEY_START_PAGE.getKeyword() + "\...
Create a Java method that does the following: "Write a Revision to the output stream.".
Of course, here is the Java code you requested: ```java protected void setActivePane(ElementTreePane pane) { if (pane == activePane) { return; } if (activePane != null) { activePane.makeActivePane(false); } activePane = pane; ...
Create a Java method that does the following: "Set the active pane.".
Of course, here is the Java code you requested: ```java public ServiceCall router(Class<? extends Router> routerType) { ServiceCall target = new ServiceCall(this); target.router = Routers.getRouter(routerType); return target; } ``` Hope this helps!
Create a Java method that does the following: "Create a new ServiceCall with a router".
Of course, here is the Java code you requested: ```java public List<String> getStringChildren(Long parentId) { ArrayList<String> strings = new ArrayList<>(); List<StringEntity> entities = getByField(Column.PARENT_ID, parentId); for (StringEntity entity : entities) { strings.add(entity.getValue()); } retur...
Create a Java method that does the following: "Gets the list of string children of a given parent id.".
Of course, here is the Java code you requested: ```java public void releaseCache() { if (originalThunks != null) { // OPTIMIZATION: // Rather than use the standard iterator, which creates lots of int[] arrays on the heap, which need to be GC'd, // we use the fast version tha...
Create a Java method that does the following: "Release the cache of the original thunks.".
Of course, here is the Java code you requested: ```java public void cloneNoCheckout(boolean withProgress) throws Exception { CloneCommand clone = Git.cloneRepository().setURI(repositoryUrl).setDirectory(localRepo.getDirectory().getParentFile()).setNoCheckout(true); // https://bugs.eclipse.org/bugs/show...
Create a Java method that does the following: "Clones the local repository.".
Of course, here is the Java code you requested: ```java public static JsonGenerator createJsonGenerator(CoronaConf conf) throws IOException { OutputStream outputStream = new FileOutputStream(conf.getCMStateFile()); if (conf.getCMCompressStateFlag()) { outputStream = new GZIPOutputStream(outputStream)...
Create a Java method that does the following: "Create a JsonGenerator for the CM state file.".
Of course, here is the Java code you requested: ```java public HttpRequest withHeader(String name, String value) { headers.set(name, value); return this; } ``` Hope this helps!
Create a Java method that does the following: "Sets a header to the request.".
Of course, here is the Java code you requested: ```java protected final int initOutputDir(){ String parent = System.getProperty("user.dir"); String target = parent + File.separator + this.target; File targetDir = new File(target); File parentDir = targetDir.getParentFile(); if(targetDir.exists()){ //targ...
Create a Java method that does the following: "Initialize the output directory.".
Of course, here is the Java code you requested: ```java public ConnectionOptions withUri(String uriString) throws URISyntaxException, NoSuchAlgorithmException, KeyManagementException { factory.setUri(Assert.notNull(uriString, "uriString")); return this; } ``` Hope this helps!
Create a Java method that does the following: "Sets the URI of the connection.".
Of course, here is the Java code you requested: ```java public synchronized void write(char c[], int off, int len) throws IOException { checkClosed(); if ((off < 0) || (off > c.length) || (len < 0) || ((off + len) > c.length) || ((off + len) < 0)) { ...
Create a Java method that does the following: "Write a sequence of characters to the underlying stream.".
Of course, here is the Java code you requested: ```java public GetDomainCacheTTLResponse getDomainCacheTTL(GetDomainCacheTTLRequest request) { checkNotNull(request, "The parameter request should NOT be null."); InternalRequest internalRequest = createRequest(request, HttpMethodName.GET, DOMAIN, request...
Create a Java method that does the following: "Get the cache TTL of a domain.".
Of course, here is the Java code you requested: ```java public int pointToPosition(int x, int y) { Rect frame = mTouchFrame; if (frame == null) { mTouchFrame = new Rect(); frame = mTouchFrame; } final int count = getChildCount(); for (int i = count - 1; ...
Create a Java method that does the following: "Get the position of the view that is at the given position.".
Of course, here is the Java code you requested: ```java public static <T> T checkNotEmpty(T reference, String errorMessageTemplate, Object... errorMessageArgs) { checkNotNull(reference, errorMessageTemplate, errorMessageArgs); ...
Create a Java method that does the following: "Checks that a single object is not empty.".
Of course, here is the Java code you requested: ```java private RestException buildKnown(Constructor<RestException> constructor, RestFailure failure) { try { return constructor.newInstance(failure.exception.detail, null); } catch (Exception e) { return buildUnknown(failure); } } ``` Hope this help...
Create a Java method that does the following: "Build a RestException from a known exception.".
Of course, here is the Java code you requested: ```java public F1<P1, Option<R>> lift() { final F1<P1, R> me = this; return new F1<P1, Option<R>>() { @Override public Option<R> apply(P1 p1) { try { return some(me.apply(...
Create a Java method that does the following: "Lift this F1 to a F1.".
Of course, here is the Java code you requested: ```java public static byte[] encode(final TaskNode root) { try (final ByteArrayOutputStream bstream = new ByteArrayOutputStream(); final DataOutputStream dstream = new DataOutputStream(bstream)) { encodeHelper(dstream, root); return bstream.toByt...
Create a Java method that does the following: "Encode a topology into a byte array.".
Of course, here is the Java code you requested: ```java public static Class<?> getTypeParameter(Class<?> genericType, Class<?> type) { Type[] genericInterfaces = type.getGenericInterfaces(); for (Type genericInterface : genericInterfaces) { if (genericInterface instanceof ParameterizedType)...
Create a Java method that does the following: "Gets the type parameter of a generic type.".
Of course, here is the Java code you requested: ```java public static boolean rename(File pFrom, File pTo, boolean pOverWrite) throws IOException { if (!pFrom.exists()) { throw new FileNotFoundException(pFrom.getAbsolutePath()); } if (pFrom.isFile() && pTo.isDirectory()) { ...
Create a Java method that does the following: "Rename a file or directory to a new file.".
Of course, here is the Java code you requested: ```java public static void send(UnitRequest unitRequest, NotifyHandler handler) { unitRequest.getContext().setRouted(true); singleton.send(unitRequest, handler); } ``` Hope this helps!
Create a Java method that does the following: "Send a request to the application.".
Of course, here is the Java code you requested: ```java public Iterable<DUser> queryByDisplayName(java.lang.String displayName) { return queryByField(null, DUserMapper.Field.DISPLAYNAME.getFieldName(), displayName); } ``` Hope this helps!
Create a Java method that does the following: "query - by method for field displayName".
Of course, here is the Java code you requested: ```java public static void addInputPath(JobConf conf, Path path, Class<? extends InputFormat> inputFormatClass) { String inputFormatMapping = path.toString() + ";" + inputFormatClass.getName(); String inputFormats = conf.get("mapred.input.dir.format...
Create a Java method that does the following: "Add the path to the input directory.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public T create(Map<String, Object> data) { Object[] args = new Object[arguments.length]; for(int i=0, n=args.length; i<n; i++) { args[i] = arguments[i].getValue(data); } try { return (T) raw.newInstance(args); ...
Create a Java method that does the following: "Creates an instance of the class represented by the given map of data.".
Of course, here is the Java code you requested: ```java public void setProductCodes(java.util.Collection<ProductCode> productCodes) { if (productCodes == null) { this.productCodes = null; return; } this.productCodes = new com.amazonaws.internal.SdkInternalList<ProductCo...
Create a Java method that does the following: "Sets the value of the productCodes property.".
Of course, here is the Java code you requested: ```java public boolean isGuiceConstructorInjected(Class<?> c) { for (Constructor<?> con : c.getDeclaredConstructors()) { if (isInjectable(con)) { return true; } } return false; } ``` Hope this helps!
Create a Java method that does the following: "Checks if a Guice constructor is injected.".
Of course, here is the Java code you requested: ```java boolean isApproximatelyElliptical(EllipseRotated_F64 ellipse , List<Point2D_F64> points , int maxSamples ) { closestPoint.setEllipse(ellipse); double maxDistance2 = maxDistanceFromEllipse*maxDistanceFromEllipse; if( points.size() <= maxSamples ) { for...
Create a Java method that does the following: "Checks if the given ellipse is approximately elliptical".
Of course, here is the Java code you requested: ```java @Sensitive public String getReferrerURLFromCookies(HttpServletRequest req, String cookieName) { Cookie[] cookies = req.getCookies(); String referrerURL = CookieHelper.getCookieValue(cookies, cookieName); if (referrerURL != null) { ...
Create a Java method that does the following: "Get the referrer URL from the cookies.".