code stringlengths 160 48.7k | prompt stringlengths 55 1.51k |
|---|---|
Of course, here is the Java code you requested:
```java
public BoxTask.Info addTask(BoxTask.Action action, String message, Date dueAt) {
JsonObject itemJSON = new JsonObject();
itemJSON.add("type", "file");
itemJSON.add("id", this.getID());
JsonObject requestJSON = new JsonObject();
... | Create a Java method that does the following: "Adds a new task to this file.". |
Of course, here is the Java code you requested:
```java
public static int requireUnsignedByte(int i) {
if (i > UNSIGNED_BYTE_MAX_VALUE) {
throw new IllegalArgumentException(
String.format("%d is larger than %d bits", i, UNSIGNED_BYTE_SIZE));
}
return i;
}
```
Hope this helps! | Create a Java method that does the following: "Require an unsigned byte.". |
Of course, here is the Java code you requested:
```java
@Override
public String placeLimitOrder(LimitOrder limitOrder) throws IOException {
String pair;
if (limitOrder.getCurrencyPair().equals(CurrencyPair.BTC_BRL)) {
pair = "btc_brl";
} else if (limitOrder.getCurrencyPair().equals(new CurrencyPa... | Create a Java method that does the following: "Override the placeLimitOrder method to place a limit order". |
Of course, here is the Java code you requested:
```java
public JsonObject put(String name, Number value) {
content.put(name, value);
return this;
}
```
Hope this helps! | Create a Java method that does the following: "Add a value to the object.". |
Of course, here is the Java code you requested:
```java
public static Node addDomAttr(Document doc, String tagName,
String tagNamespaceURI, String attrName, String attrValue) {
// Create a Document to work on
Document newDoc = null;
try {
System.setProperty("javax... | Create a Java method that does the following: "This method is used to add dom attributes to a DOM document.". |
Of course, here is the Java code you requested:
```java
protected long preConnection() throws SQLException{
long statsObtainTime = 0;
if (this.pool.poolShuttingDown){
throw new SQLException(this.pool.shutdownStackTrace);
}
if (this.pool.statisticsEnabled){
statsObtainTime = System.nanoTime(... | Create a Java method that does the following: "Called by the connection pool to establish a new connection.". |
Of course, here is the Java code you requested:
```java
public static int safeMultiply(int a, int b)
{
if (a == 0 || b == 0) {
return 0;
}
long max = a < 0 == b < 0 ? Integer.MAX_VALUE : Integer.MIN_VALUE;
if ((b > 0 && b > max / a) || (b < 0 && b < max / a)) {
throw new ArithmeticException(
"Int ov... | Create a Java method that does the following: "Safe multiply.". |
Of course, here is the Java code you requested:
```java
public String determineUsername() {
if (CollectionUtils.isEmpty(this.parsedAddresses)) {
return this.username;
}
Address address = this.parsedAddresses.get(0);
return (address.username != null) ? address.username : this.username;
}
```
Hope this help... | Create a Java method that does the following: "Determine the username of the user.". |
Of course, here is the Java code you requested:
```java
@Override
public void getLeasesForPeers(final PeerLeaseTable peerLeaseTable, String recoveryGroup) throws Exception {
if (tc.isEntryEnabled())
Tr.entry(tc, "getLeasesForPeers", new Object[] { peerLeaseTable, recoveryGroup, this });
... | Create a Java method that does the following: "This method is called by the application to get the leases for all the peers.". |
Of course, here is the Java code you requested:
```java
public List<E> order() {
int index = 0;
for (E item : input) {
index = output.indexOf(item);
if (index == -1) {
insert(item, item);
}
}
return output;
}
```
Hope this helps! | Create a Java method that does the following: "Returns a list of elements in the order specified in the constructor.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public List<ApiBuddy> execute() {
BuddyList buddyList = extension.getParentZone()
.getBuddyListManager()
.getBuddyList(user);
return (List) buddyList.... | Create a Java method that does the following: "Execute the BuddyList API". |
Of course, here is the Java code you requested:
```java
public ServiceFuture<ServerCommunicationLinkInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String communicationLinkName, String partnerServer, final ServiceCallback<ServerCommunicationLinkInner> serviceCallback) {
return Serv... | Create a Java method that does the following: "Creates or updates a CDN communication link.". |
Of course, here is the Java code you requested:
```java
public static String readStateAttribute(String rawValue) throws ParseException {
if (MODEL.DELETED.looselyMatches(rawValue, true)) {
return "D";
} else if (MODEL.INACTIVE.looselyMatches(rawValue, true)) {
return "I";
... | Create a Java method that does the following: "Read the state attribute from raw value.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
@Override
public EList<IfcGridAxis> getVAxes() {
return (EList<IfcGridAxis>) eGet(Ifc4Package.Literals.IFC_GRID__VAXES, true);
}
```
Hope this helps! | Create a Java method that does the following: "Gets the value of the VAxes property.". |
Of course, here is the Java code you requested:
```java
public void setValue(org.openprovenance.prov.model.Value value) {
if (value!=null) {
this.value = value;
getAllAttributes().add((org.openprovenance.prov.model.Attribute)value); //FIXME: should replace previous value!
}
}
```
Hope this helps! | Create a Java method that does the following: "Sets the value of the entity.". |
Of course, here is the Java code you requested:
```java
private String getBetaAromaticType(String symb, boolean imidazolium, boolean anion) {
return getAromaticType(betaTypes, 'B', symb, imidazolium, anion);
}
```
Hope this helps! | Create a Java method that does the following: "Get the aromatic type for beta types.". |
Of course, here is the Java code you requested:
```java
public void register(final long masterId, final List<ConfigProperty> configList)
throws IOException {
retryRPC(() -> {
mClient.registerMaster(RegisterMasterPRequest.newBuilder().setMasterId(masterId)
.setOptions(RegisterMasterPOptions.ne... | Create a Java method that does the following: "Register a master with the cluster.". |
Of course, here is the Java code you requested:
```java
public static boolean equalsTopElement(final LinkedList<String> stack, final String str) {
if(stack.isEmpty()) {
return false;
}
return stack.peekFirst().equals(str);
}
```
Hope this hel... | Create a Java method that does the following: "Checks if the top element of a list is equal to the given string.". |
Of course, here is the Java code you requested:
```java
@Override
public boolean isCacheable() {
boolean supportsConditionals = has("Last-Modified", this.response) || has("ETag", this.response);
boolean isCacheable =
has("Cache-Control", "s-maxage", this.response)
|| has("Cache-Control", "max-age", this.r... | Create a Java method that does the following: "Returns true if the response is cacheable.". |
Of course, here is the Java code you requested:
```java
@Override
public UndeliverableReturnCode handleUndeliverableMessage(
SIMPMessage msg,
int exceptionReason,
... | Create a Java method that does the following: "This method is called by the application to handle a message that has been delivered to a target destination.". |
Of course, here is the Java code you requested:
```java
private void matchX509Certs(CertSelector selector,
Collection<Certificate> matches) {
for (Object obj : certSubjects.values()) {
if (obj instanceof X509Certificate) {
X509Certificate cert = (X509Certificate)obj;
... | Create a Java method that does the following: "Match X509Certs.". |
Of course, here is the Java code you requested:
```java
protected LocPathIterator changePartToRef(final QName uniquePseudoVarName, WalkingIterator wi,
final int numSteps, final boolean isGlobal)
{
Variable var = new Variable();
var.setQName(uniquePseudoVarName);
var.setIsGl... | Create a Java method that does the following: "Change the part of the path to the reference.". |
Of course, here is the Java code you requested:
```java
public void init(FilterConfig filterConfig) throws ServletException {
ctx = filterConfig.getServletContext();
String temp = filterConfig.getInitParameter("debug");
debug = (String.valueOf(temp).equals("true"));
}
```
Hope this helps! | Create a Java method that does the following: "Initialize the servlet.". |
Of course, here is the Java code you requested:
```java
public List<OPFItem> getItems()
{
return (items != null) ? items.getItems() : ImmutableList.<OPFItem> of();
}
```
Hope this helps! | Create a Java method that does the following: "Returns the items of the node.". |
Of course, here is the Java code you requested:
```java
protected void updateName(TreeElement parentNode, int index)
{
setName(getNodeName(parentNode, index));
TreeElement[] children = getChildren();
for (int i = 0; i < children.length; i++) {
children[i].updateName(this, i);
... | Create a Java method that does the following: "Update the name of the element.". |
Of course, here is the Java code you requested:
```java
public String addSecuredAttribute(String vaultBlock, String attributeName, char[] attributeValue) throws Exception {
vault.store(vaultBlock, attributeName, attributeValue, null);
return securedAttributeConfigurationString(vaultBlock, attributeName... | Create a Java method that does the following: "Add a secured attribute to the vault.". |
Of course, here is the Java code you requested:
```java
protected int countSteps(LocPathIterator lpi)
{
if(lpi instanceof WalkingIterator)
{
WalkingIterator wi = (WalkingIterator)lpi;
AxesWalker aw = wi.getFirstWalker();
int count = 0;
while(null != aw)
{
count++;
aw = aw.getNextW... | Create a Java method that does the following: "Count the number of steps in the LocPathIterator.". |
Of course, here is the Java code you requested:
```java
private void moveIndexesToNextCombination()
{
for (int i = currentIndexes.length - 1, j = list.size() - 1; i >= 0; i--, j--)
{
if (currentIndexes[i] != j)
{
currentIndexes[i]++;
for (int ... | Create a Java method that does the following: "move indexes to next combination of the generated code". |
Of course, here is the Java code you requested:
```java
private void jarDir(File dirOrFile2jar, JarOutputStream jos, String path)
throws IOException {
if (mVerbose) {
System.out.println("checking " + dirOrFile2jar);
}
if (dirOrFile2jar.isDirectory()) {
String[] dirList = dirOrFile2jar.list();
String s... | Create a Java method that does the following: "This method is used to write a directory to a jar file.". |
Of course, here is the Java code you requested:
```java
public String getDisplayName(String id, ULocale locale) {
Map<String, Factory> m = getVisibleIDMap();
Factory f = m.get(id);
if (f != null) {
return f.getDisplayName(id, locale);
}
Key key = createKey(id);
... | Create a Java method that does the following: "Get the display name for a specific locale.". |
Of course, here is the Java code you requested:
```java
protected Declaration createDeclaration(String property, Term<?> term)
{
Declaration d = CSSFactory.getRuleFactory().createDeclaration();
d.unlock();
d.setProperty(property);
d.add(term);
return d;
}
```
Hope this ... | Create a Java method that does the following: "Create a declaration for a single class.". |
Of course, here is the Java code you requested:
```java
public Quaternion randomize (Random rand) {
// pick angles according to the surface area distribution
return fromAngles(MathUtil.lerp(-Math.PI, +Math.PI, rand.nextFloat()),
Math.asin(MathUtil.lerp(-1f, +1f, rand.nextFloat... | Create a Java method that does the following: "Randomize the quaternion.". |
Of course, here is the Java code you requested:
```java
public BatchGetDeploymentGroupsResult withDeploymentGroupsInfo(DeploymentGroupInfo... deploymentGroupsInfo) {
if (this.deploymentGroupsInfo == null) {
setDeploymentGroupsInfo(new com.amazonaws.internal.SdkInternalList<DeploymentGroupInfo>(depl... | Create a Java method that does the following: "Adds the deploymentGroupsInfo value to the batch request.". |
Of course, here is the Java code you requested:
```java
public void setName(final String newName) {
String oldName = this.name;
this.name = newName;
propertySupport.firePropertyChange("name", oldName, this.name);
}
```
Hope this helps! | Create a Java method that does the following: "Sets the name of the class.". |
Of course, here is the Java code you requested:
```java
public void setItemSize(int columnWidth, int columnHeight) {
if (itemWidth == columnWidth) {
return;
}
itemWidth = columnWidth;
itemHeight = columnHeight;
itemLayoutParams = new GridView.LayoutParams(itemWidth, itemHeight);
notifyDataSetChanged... | Create a Java method that does the following: "Sets the item size.". |
Of course, here is the Java code you requested:
```java
public ApiResponse<List<CorporationAlliancesHistoryResponse>> getCorporationsCorporationIdAlliancehistoryWithHttpInfo(
Integer corporationId, String datasource, String ifNoneMatch) throws ApiException {
com.squareup.okhttp.Call call = getCorpo... | Create a Java method that does the following: "Get corporationId Alliance history. get corporationId Alliance history. get corporationId Alliance history". |
Of course, here is the Java code you requested:
```java
protected static IAtomContainer makeAtomContainer(IAtom atom, List<IBond> parts, IAtom excludedAtom) {
IAtomContainer partContainer = atom.getBuilder().newInstance(IAtomContainer.class);
partContainer.addAtom(atom);
for (IBond aBond : part... | Create a Java method that does the following: "Create a molecule from a atom and a list of bonds.". |
Of course, here is the Java code you requested:
```java
Collection<BindingStrategy> collectFromAggregates(Collection<Class<? extends AggregateRoot>> aggregateClasses) {
Collection<BindingStrategy> bindingStrategies = new ArrayList<>();
Map<Type[], Key<?>> allGenerics = new HashMap<>();
for (Cl... | Create a Java method that does the following: "Collect all binding strategies from the given aggregate classes.". |
Of course, here is the Java code you requested:
```java
private String getParentOutlineNumber(String outlineNumber)
{
String result;
int index = outlineNumber.lastIndexOf('.');
if (index == -1)
{
result = "";
}
else
{
result = outlineNumber.substring(0, in... | Create a Java method that does the following: "Get the parent outline number.". |
Of course, here is the Java code you requested:
```java
public void sessionPropertiesChangedAllPlugin(Session session) {
logger.debug("sessionPropertiesChangedAllPlugin");
for (ExtensionHook hook : extensionHooks.values()) {
for (SessionChangedListener listener : hook.getSessionListenerL... | Create a Java method that does the following: "SessionPropertiesChangedAllPlugin is called by the SessionChangedListener.". |
Of course, here is the Java code you requested:
```java
@Override
public CreateOrUpdateStatus createOrUpdate(SpatialReferenceSystem data)
throws SQLException {
CreateOrUpdateStatus status = super.createOrUpdate(data);
updateDefinition_12_063(data);
return status;
}
```
Hope this helps! | Create a Java method that does the following: "Override the method to do the work of creating or updating a spatial reference system.". |
Of course, here is the Java code you requested:
```java
public static Collection<Class<?>> getInterfaces(Class<?> object, Class<?> base)
{
Check.notNull(object);
Check.notNull(base);
final Collection<Class<?>> interfaces = new ArrayList<>();
Class<?> current = object;
... | Create a Java method that does the following: "Get the interfaces of the specified class and all superclasses.". |
Of course, here is the Java code you requested:
```java
public static double norm2(double[] x) {
double norm = 0.0;
for (double n : x) {
norm += n * n;
}
norm = Math.sqrt(norm);
return norm;
}
```
Hope this helps! | Create a Java method that does the following: "Compute the 2 - norm of a set of numbers.". |
Of course, here is the Java code you requested:
```java
public void createNewSecurityDomain(String securityDomainName, LoginModuleRequest... loginModules)
throws Exception {
//do not close the controller client here, we're using our own..
CoreJBossASClient coreClient = new CoreJBossASClient... | Create a Java method that does the following: "Create a new security domain.". |
Of course, here is the Java code you requested:
```java
public static servicegroup_servicegroupmember_binding[] get(nitro_service service, String servicegroupname) throws Exception{
servicegroup_servicegroupmember_binding obj = new servicegroup_servicegroupmember_binding();
obj.set_servicegroupname(servicegroupnam... | Create a Java method that does the following: "Use this API to fetch servicegroup_servicegroupmember_binding resources of given name.". |
Of course, here is the Java code you requested:
```java
public TwoStepsGOV3Function<T> build() throws IOException {
if (built) throw new IllegalStateException("This builder has been already used");
built = true;
if (transform == null) {
if (chunkedHashStore != null) transform = chunkedHashStore.transform(... | Create a Java method that does the following: "Build the function.". |
Of course, here is the Java code you requested:
```java
protected Html unmarshal(StringBuilder sb) throws JAXBException {
Html html = null;
sb = replaceIframeEndTag(sb);
sb = removeDoctypeDeclaration(sb);
sb = replaceNamedEntity(sb);
StringReader stringReader = new StringReader(... | Create a Java method that does the following: "Unmarshals the XML string builder.". |
Of course, here is the Java code you requested:
```java
private void cumulateSoil( List<Coordinate> pathCoordinates, List<Boolean> isBetweenSlopesCondition ) {
// pm.beginTask("Cumulate Soil...", pathCoordinates.size());
java.awt.Point point = new java.awt.Point();
GridGeometry2D gridGeometry ... | Create a Java method that does the following: "Cumulate the soil map.". |
Of course, here is the Java code you requested:
```java
public void empty() {
for (Entry<String, String> entry : idToVersion.entrySet()) {
expirationVersion.remove(entry.getValue());
versionToItem.remove(entry.getValue());
if (collectionCachePath != null
&& !collectionCachePath.resolve(... | Create a Java method that does the following: "Empty the cache.". |
Of course, here is the Java code you requested:
```java
public void waitForAttribute(String attributeName, String pattern, long timeout) throws WidgetException {
waitForAttributePatternMatcher(attributeName, pattern, timeout, true);
}
```
Hope this helps! | Create a Java method that does the following: "Waits until an attribute with the specified name matches the given pattern.". |
Of course, here is the Java code you requested:
```java
public int find(CharSequence str, int start) {
final int pLen = this.len;
final int sLen = str.length();
if (sLen == 0) {
throw new IllegalArgumentException("Cannot find empty string.");
}
int pPos = start;
final char first = str.charAt(0)... | Create a Java method that does the following: "Find the first occurrence of the specified character sequence in this string.". |
Of course, here is the Java code you requested:
```java
@DoesServiceRequest
public TablePermissions downloadPermissions(TableRequestOptions options, OperationContext opContext)
throws StorageException {
if (opContext == null) {
opContext = new OperationContext();
}
... | Create a Java method that does the following: "Download the permissions for a single language.". |
Of course, here is the Java code you requested:
```java
@Override
protected void useImportDeclaration(ImportDeclaration importDeclaration) throws BinderException {
LOG.debug("Create proxy" + importDeclaration.getMetadata());
JAXWSImportDeclarationWrapper pojo = JAXWSImportDeclarationWrapper.create... | Create a Java method that does the following: "Override this method to use the specified import declaration.". |
Of course, here is the Java code you requested:
```java
@Override
public ServletOutputStream getOutputStream() throws IOException {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "getOutputStream: " + this);
}
if (null != this.outWriter) {
... | Create a Java method that does the following: "This method is called by the ServletOutputStream interface to get the ServletOutputStream.". |
Of course, here is the Java code you requested:
```java
@Override
public boolean isWrapperFor(ServletRequest wrapped) {
final ServletRequest request = getHttpServletRequest();
if (request == wrapped) {
return true;
} else if (request instanceof ServletRequestWrapper) {
... | Create a Java method that does the following: "Check if the request is a wrapper for the specified ServletRequest.". |
Of course, here is the Java code you requested:
```java
public static <T> Single<T> toSingle(CompletableFuture<T> completableFuture) {
return RxJava2FutureUtils.createSingle(Java8FutureUtils.createValueSource(completableFuture));
}
```
Hope this helps! | Create a Java method that does the following: "Convert a CompletableFuture to a Single.". |
Of course, here is the Java code you requested:
```java
public ToConverter getToConverter(Class toClass, Class domainClass) throws JTransfoException {
ToConverter converter = withPreConverter(toClass);
List<SyntheticField> domainFields = reflectionHelper.getSyntheticFields(domainClass);
for (F... | Create a Java method that does the following: "Get the ToConverter object.". |
Of course, here is the Java code you requested:
```java
protected boolean semanticallyEquivalent(BioPAXElement other)
{
final xref anXref = (xref) other;
return
(DB != null ?
DB.equalsIgnoreCase(anXref.getDB()) :
anXref.getDB() == null)
&&
(ID != null ?
ID.equalsIgnoreCase(anXref.getID())... | Create a Java method that does the following: "Checks if two BioPAXElements are semantically equivalent.". |
Of course, here is the Java code you requested:
```java
public void buildModel(String wordFileName) throws IOException {
BufferedReader br = new BufferedReader(new FileReader(new File(wordFileName)));
String str;
while ((str = br.readLine()) != null) {
List<String> tokens = Stanfor... | Create a Java method that does the following: "Build the model from a file containing a file containing a sentence.". |
Of course, here is the Java code you requested:
```java
public RestTemplateBuilder setConnectTimeout(Duration connectTimeout) {
return new RestTemplateBuilder(this.detectRequestFactory, this.rootUri,
this.messageConverters, this.requestFactorySupplier,
this.uriTemplateHandler, this.errorHandler, this.basicAu... | Create a Java method that does the following: "Sets the connect timeout.". |
Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "http://schema.intuit.com/finance/v3", name = "Invoice", substitutionHeadNamespace = "http://schema.intuit.com/finance/v3", substitutionHeadName = "IntuitObject")
public JAXBElement<Invoice> createInvoice(Invoice value) {
r... | Create a Java method that does the following: "Create an instance of the Invoice class". |
Of course, here is the Java code you requested:
```java
@Nullable public GeoTarget getIdAncestor(GeoTarget.Type type) {
for (GeoTarget target = this; target != null; target = target.idParent) {
if (target.key.type == type) {
return target;
}
}
return null;
}
```
Hope this helps! | Create a Java method that does the following: "Get the id ancestor of a target of a given type.". |
Of course, here is the Java code you requested:
```java
@Override
public final void stop() {
if (DynamicTasks.getTaskQueuingContext() != null) {
doStop();
} else {
Task<?> task = Tasks.builder().name("stop").body(new Runnable() {
public void run() {
... | Create a Java method that does the following: "Stop the application.". |
Of course, here is the Java code you requested:
```java
protected void updateRates (QueueStatMeasurements rateMeasurements, long dequeueCountDelta, long enqueueCountDelta) {
double oldDequeueRateOneMinute = rateMeasurements.messageRates.getOneMinuteAverageDequeueRate();
double oldDequeueRateOneHour = r... | Create a Java method that does the following: "Update the message rates.". |
Of course, here is the Java code you requested:
```java
public static <K, V> Map<K, V> filterAndTransform(Map<K, V> map,
FilteringTransformer<Map.Entry<K, V>> filteringTransformer) {
Assert.notNull(map, "Map is required");
Assert.notNull(filteringTransformer, "FilteringTransformer is required");
re... | Create a Java method that does the following: "Filter and transform a Map. Entry". |
Of course, here is the Java code you requested:
```java
public Observable<CertificateOperation> createCertificateAsync(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map<String, String> tags) {
return createCertificateWithServiceRe... | Create a Java method that does the following: "Creates a certificate in a specified key vault.". |
Of course, here is the Java code you requested:
```java
@Programmatic
public DocumentType findByReference(
final String reference) {
return queryResultsCache.execute(
() -> repositoryService.firstMatch(
new QueryDefault<>(DocumentType.class,
... | Create a Java method that does the following: "Find by a reference.". |
Of course, here is the Java code you requested:
```java
public static boolean isAssignableFrom(Type from, Class<?> to) {
return TypeVisitor.of(from, b -> b
.onClass(to::isAssignableFrom)
.onParameterizedType(pt -> TypeVisitor.of(pt.getRawType(), bb -> bb
.onClass(to::isAssignableFro... | Create a Java method that does the following: "Checks if the given type is assignable from the given class.". |
Of course, here is the Java code you requested:
```java
public String endsWith(final CharSequence text) {
if (dialect == null) {
throw new IllegalStateException("dialect is not set.");
}
if (StringUtils.isEmpty(text)) {
return "%";
} else {
return "%" + dialect.escapeLikePattern(text);
}
}
```
Hop... | Create a Java method that does the following: "Returns the string that ends with the given text.". |
Of course, here is the Java code you requested:
```java
@Override
public void close() throws IOException {
try {
this.pool.returnObject(this.object);
} catch (Exception exc) {
throw new IOException(exc);
} finally {
this.returned = true;
}
}
```
Hope this helps! | Create a Java method that does the following: "Close the object.". |
Of course, here is the Java code you requested:
```java
public String getIconPath(CmsListItem item) {
boolean showingUsers = isShowingUsers();
try {
CmsPrincipal principal;
if (showingUsers) {
principal = getCms().readUser((String)item.get(LIST_COLUMN_NAME));
... | Create a Java method that does the following: "Returns the icon path for the item.". |
Of course, here is the Java code you requested:
```java
public String getBindingActualTable(final String dataSource, final String logicTable, final String otherActualTable) {
int index = -1;
for (TableRule each : tableRules) {
index = each.findActualTableIndex(dataSource, otherActualTable);... | Create a Java method that does the following: "Get binding actual table name.". |
Of course, here is the Java code you requested:
```java
@Override
protected final void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
support.bindServer(request, response);
}
```
Hope this helps! | Create a Java method that does the following: "Override doGet to bind the server to the resource.". |
Of course, here is the Java code you requested:
```java
public MatcherController setDefaultContentUri(String authority, String path) {
if (this.lastAddTableInfo == null) {
throw new IllegalStateException("There is a problem with the order of function call.");
}
this.lastAddTableInfo... | Create a Java method that does the following: "Sets the default content URI.". |
Of course, here is the Java code you requested:
```java
public void doInternalCache(Identity oid, Object obj, int type)
{
processQueue();
// pass new materialized objects immediately to application cache
if(type == TYPE_NEW_MATERIALIZED)
{
boolean result = putToApp... | Create a Java method that does the following: "This method is called by the cache to process a single entry. It is called by the cache to process the entry and put it to the application cache. It is called by the cache when the object is materialized.". |
Of course, here is the Java code you requested:
```java
public static int randomIntLessThan(int maxExclusive) {
checkArgument(
maxExclusive > Integer.MIN_VALUE, "Cannot produce int less than %s", Integer.MIN_VALUE);
return randomInt(Integer.MIN_VALUE, maxExclusive);
}
```
Hope this helps! | Create a Java method that does the following: "Returns a random int that is less than the given int.". |
Of course, here is the Java code you requested:
```java
public static Pattern remove(String regex, int flags) {
return POOL.remove(new RegexWithFlag(regex, flags));
}
```
Hope this helps! | Create a Java method that does the following: "Returns a new Pattern that matches the given regular expression with the given flags.". |
Of course, here is the Java code you requested:
```java
public Oag createSemantics(List<Attribute> firstAttrs) throws GenericException {
Layout layout;
int[][] internalAttrs;
Visits[] visits;
layout = createLayout(firstAttrs);
internalAttrs = createInternalAttributes(layout);
... | Create a Java method that does the following: "Create a semantic object from the attributes.". |
Of course, here is the Java code you requested:
```java
private Encoder getColumnEncoder(Schema fieldAvroSchema, OutputStream out) {
// Use a special Avro encoder that has special handling for int, long,
// and String types. See ColumnEncoder for more information.
if (fieldAvroSchema.getType() == Type.INT
... | Create a Java method that does the following: "Get the ColumnEncoder for the given field". |
Of course, here is the Java code you requested:
```java
private void defineSliders(UIDefaults d) {
// Rossi: slider inner color changed from gray to "white"
d.put("sliderTrackBorderBase", new Color(0x709ad0));
// d.put("sliderTrackInteriorBase", new Color(0x709ad0)); // blue better?
d.put(... | Create a Java method that does the following: "Define the Slider UI resources.". |
Of course, here is the Java code you requested:
```java
void writeTo(JsonGenerator generator) throws IOException {
DeserializationState deserState = _deserState.get();
if (deserState.isDeserialized()) {
// Object has already been deserialized, use standard writer
generator.writ... | Create a Java method that does the following: "Writes the contents of the current object to the given generator.". |
Of course, here is the Java code you requested:
```java
protected void writeCsvLocal(final MBasicTable table, final OutputStream outputStream,
final char csvSeparator, final DateFormat dateFormat) throws IOException {
// récupération des informations utiles
final int columnCount = table.getColumnModel().getC... | Create a Java method that does the following: "Writes a CSV file to the outputStream using the specified csv separator and date format.". |
Of course, here is the Java code you requested:
```java
@Nonnull
public TypeaheadDataset setHeader (@Nullable final String sHeaderHTML)
{
return setHeader (StringHelper.hasText (sHeaderHTML) ? JSExpr.lit (sHeaderHTML) : (IJSExpression) null);
}
```
Hope this helps! | Create a Java method that does the following: "Sets the header HTML.". |
Of course, here is the Java code you requested:
```java
protected void prepareImplicitWayRelations(TDWay tdWay) {
if (tdWay.isCoastline()) {
// find matching tiles on zoom level 12
Set<TileCoordinate> coastLineTiles = GeoUtils.mapWayToTiles(tdWay, TileInfo.TILE_INFO_ZOOMLEVEL, 0);
... | Create a Java method that does the following: "Prepare implicit way relations.". |
Of course, here is the Java code you requested:
```java
public static <R> TerminalOp<Double, R>
makeDouble(Supplier<R> supplier,
ObjDoubleConsumer<R> accumulator,
BinaryOperator<R> combiner) {
Objects.requireNonNull(supplier);
Objects.requireNonNull(accumulator);
... | Create a Java method that does the following: "Creates a TerminalOp that combines two tuples of type Double.". |
Of course, here is the Java code you requested:
```java
public void setAlgorithm(KeyAgreementType dh)
{
log("DH algorithm set: " + getDHName(dhMode) + " -> " + getDHName(dh));
try {
if(dhMode != null && dh.keyType == dhMode.keyType) return;
dhMode = dh;
switch (dhMode.keyType) {
case Ke... | Create a Java method that does the following: "Sets the algorithm of the KeyAgreement object.". |
Of course, here is the Java code you requested:
```java
private static Map<String, String> initializeAwsIdentityDocument() {
InputStream stream = null;
try {
stream = openStream(AWS_INSTANCE_IDENTITY_DOCUMENT_URI);
String awsIdentityDocument = slurp(new InputStreamReader(stream, Charset.forName("UT... | Create a Java method that does the following: "Initialize the AWS Identity document.". |
Of course, here is the Java code you requested:
```java
public static void sendBinaryBlocking(final ByteBuffer data, final WebSocketChannel wsChannel) throws IOException {
sendBlockingInternal(data, WebSocketFrameType.BINARY, wsChannel);
}
```
Hope this helps! | Create a Java method that does the following: "Sends a binary message using blocking IO.". |
Of course, here is the Java code you requested:
```java
public com.google.api.ads.adwords.axis.v201809.rm.AddressInfo getAddressInfo() {
return addressInfo;
}
```
Hope this helps! | Create a Java method that does the following: "Gets the addressInfo value for this CIDCTYPE.". |
Of course, here is the Java code you requested:
```java
private String createStringValue(CmsObject cms, I_CmsXmlDocument document) {
Element data = m_element.element(CmsXmlPage.NODE_CONTENT);
if (data == null) {
String content = m_element.getText();
m_element.clearContent();
... | Create a Java method that does the following: "Create the string value of the page.". |
Of course, here is the Java code you requested:
```java
static JMethod getter(FieldOutline fieldOutline) {
final JDefinedClass theClass = fieldOutline.parent().implClass;
final String publicName = fieldOutline.getPropertyInfo().getName(true);
final JMethod getgetter = theClass.getMethod("get" +... | Create a Java method that does the following: "Get the getter method for the fieldOutline.". |
Of course, here is the Java code you requested:
```java
Optional<Container> allocateContainer(final ResourceRequestEvent requestEvent) {
Container container = null;
final Optional<String> nodeName = getPreferredNode(requestEvent.getNodeNameList());
if (nodeName.isPresent()) {
container = allocateBa... | Create a Java method that does the following: "Allocate a container based on the request event.". |
Of course, here is the Java code you requested:
```java
private <T> T resolvePropertyTypedValueFromForeignResource(FieldData field, Class<T> propertyType) {
Resource property = this.resource.getResourceResolver().getResource(this.resource, field.path);
if (property == null) {
return null;
... | Create a Java method that does the following: "Resolves the property typed value from the foreign resource.". |
Of course, here is the Java code you requested:
```java
public Point3D_F64 transform(Point3D_F64 src, @Nullable Point3D_F64 dst ) {
return SePointOps_F64.transform(this,src,dst);
}
```
Hope this helps! | Create a Java method that does the following: "Transform the source point into the destination point.". |
Of course, here is the Java code you requested:
```java
final void bipush(CompletableFuture<?> b, BiCompletion<?,?,?> c) {
if (c != null) {
Object r;
while ((r = result) == null && !tryPushStack(c))
lazySetNext(c, null); // clear on failure
if (b != null && b... | Create a Java method that does the following: "Pushes a result to the stack.". |
Of course, here is the Java code you requested:
```java
@Override
public void clearCache() {
entityCache.clearCache(CommercePriceListImpl.class);
finderCache.clearCache(FINDER_CLASS_NAME_ENTITY);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WIT... | Create a Java method that does the following: "Clears the cache for all commerce price lists.". |
Of course, here is the Java code you requested:
```java
@com.fasterxml.jackson.annotation.JsonProperty("FieldName")
public void setFieldName(String fieldName) {
this.fieldName = fieldName;
}
```
Hope this helps! | Create a Java method that does the following: "Sets the name of the class.". |
Of course, here is the Java code you requested:
```java
void build()
{
_ranks = new int[_units.size()];
_numOnes = 0;
for (int i = 0; i < _units.size(); ++i)
{
_ranks[i] = _numOnes;
_numOnes += popCount(_units.get(i));
}
}
```
Hope this helps! | Create a Java method that does the following: "Build the base class.". |
Of course, here is the Java code you requested:
```java
protected GuacamoleTunnel createConnectedTunnel(UserContext context,
final TunnelRequest.Type type, String id,
GuacamoleClientInformation info, Map<String, String> tokens)
throws GuacamoleException {
// Create connecte... | Create a Java method that does the following: "Creates a connected tunnel from the given parameters.". |
Of course, here is the Java code you requested:
```java
public static String getFormattedCount(Long count) {
final String unit;
final Double dbl;
final DecimalFormat format = new DecimalFormat("#.#");
if (count < 1000) {
return format.format(count);
} else if (count ... | Create a Java method that does the following: "Get formatted count.". |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.