code stringlengths 160 48.7k | prompt stringlengths 55 1.51k |
|---|---|
Of course, here is the Java code you requested:
```java
public void updateProperties(ResourceBundle bundle, Properties props, Charset charset) {
Enumeration<String> keys = bundle.getKeys();
while (keys.hasMoreElements()) {
String key = keys.nextElement();
if (matchesFilter(key)) {
String value = bundl... | Create a Java method that does the following: "Updates the properties from the specified ResourceBundle.". |
Of course, here is the Java code you requested:
```java
public boolean isAux()
{
if (! _isWindows)
return false;
File file = getFile();
String path = getFullPath().toLowerCase(Locale.ENGLISH);
int len = path.length();
int p = path.indexOf("/aux");
int ch;
if (p >= 0 && (len <= p ... | Create a Java method that does the following: "Is this file an aux file?". |
Of course, here is the Java code you requested:
```java
public static MsgPartsAndIds buildMsgPartsAndComputeMsgIdForDualFormat(MsgNode msgNode) {
if (msgNode.isPlrselMsg()) {
MsgPartsAndIds mpai = buildMsgPartsAndComputeMsgIds(msgNode, true);
return new MsgPartsAndIds(mpai.parts, mpai.idUsingBracedPhs... | Create a Java method that does the following: "Build the MsgPartsAndComputeMsgIdForDualFormat method.". |
Of course, here is the Java code you requested:
```java
@Override
public void add(ConstraintReport report) {
checkNotNull(report,"Constraint report cannot be null");
this.lock.writeLock().lock();
try {
ConstraintReportId id = report.id();
this.failureIds.put(id.resourceId(),id.failureId());
this.report... | Create a Java method that does the following: "Adds a constraint report to the constraint report list.". |
Of course, here is the Java code you requested:
```java
protected final int initApplicationDir(){
this.applicationDir = this.optionAppHome.getValue();
if(this.applicationDir==null){
System.err.println(this.getAppName() + ": no application directory set");
return -1;
}
return 0;
}
```
Hope this helps! | Create a Java method that does the following: "Initialize the application directory.". |
Of course, here is the Java code you requested:
```java
public void init(String txn, TransactionConfig btc) {
FilterProcessor fp = null;
if (btc.getFilter() != null) {
fp = new FilterProcessor(txn, btc);
}
synchronized (filterMap) {
// Check if old filter proce... | Create a Java method that does the following: "Initialize the application with the given transaction configuration.". |
Of course, here is the Java code you requested:
```java
protected void placeBecameEmpty ()
{
// let our delegates know what's up
applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) {
@Override
public void apply (PlaceManagerDelegate delegate) {
delega... | Create a Java method that does the following: "Called by the place manager to inform us that the empty place has been empty.". |
Of course, here is the Java code you requested:
```java
@Override
public JavaClass findClass(/*@Nonnull*/ String className) {
// Make sure we handle class names with slashes.
// If we don't, we can get into serious trouble: a previously
// loaded class will appear to be missing (because we'... | Create a Java method that does the following: "Find a class by its name.". |
Of course, here is the Java code you requested:
```java
public synchronized void updateDeployMode(DeployMode mode) {
mDeployMode = mode;
if (mDeployMode == DeployMode.EMBEDDED) {
// Ensure that the journal properties are set correctly.
for (int i = 0; i < mMasters.size(); i++) {
Master mast... | Create a Java method that does the following: "Update the deploy mode.". |
Of course, here is the Java code you requested:
```java
@Override
public void setValue(byte[] val) throws TTException {
BlockDataElement data = (BlockDataElement)mDelegate.getCurrentData();
data.setVal(val);
getPageTransaction().setData(data);
}
```
Hope this helps! | Create a Java method that does the following: "Sets the value of the record in the current page.". |
Of course, here is the Java code you requested:
```java
public void addType(final CIType... _ciType)
throws EFapsException
{
final Set<Type> typesTmp = new HashSet<>();
for (final CIType ciType : _ciType) {
typesTmp.add(ciType.getType());
}
addType(typesTmp.toArr... | Create a Java method that does the following: "Add a type to the result set.". |
Of course, here is the Java code you requested:
```java
public static boolean showDocument(URL url) {
return showDocumentViaDesktop(url)
|| showDocumentViaExec(url)
|| JavaWebStart.showViaWebStart(url);
}
```
Hope this helps! | Create a Java method that does the following: "Show document via desktop exec or webstart.". |
Of course, here is the Java code you requested:
```java
private void updateInstances(List<InstanceContext> instances, final CountingCompletionHandler<Void> counter) {
for (final InstanceContext instance : instances) {
data.put(instance.address(), Contexts.serialize(instance).encode(), new Handler<AsyncResult... | Create a Java method that does the following: "Update instances.". |
Of course, here is the Java code you requested:
```java
public DataOutputStream createDataOutputStream(FSDataOutputStream outputStream) throws IOException {
if (codec != null) {
return new FSDataOutputStream(codec.createOutputStream(outputStream), null);
} else {
return outputSt... | Create a Java method that does the following: "Create a DataOutputStream for the underlying codec.". |
Of course, here is the Java code you requested:
```java
private ArrayList<Property> parseProperties(String contents) {
ArrayList<String> parts = new ArrayList<>();
boolean bInsideString = false,
bInsideURL = false;
int j = 0;
String substr;
for (int i = 0; i < conten... | Create a Java method that does the following: "Parses the properties in the contents string.". |
Of course, here is the Java code you requested:
```java
public <T> T get(final Class<T> entityClass, final Object id) {
return mapper(entityClass).get(id);
}
```
Hope this helps! | Create a Java method that does the following: "Gets an entity from the database.". |
Of course, here is the Java code you requested:
```java
public static Map<String, Integer> offsetMap(Schema sch) {
int pos = 0;
Map<String, Integer> offsetMap = new HashMap<String, Integer>();
for (String fldname : sch.fields()) {
offsetMap.put(fldname, pos);
pos += Page.maxSize(sch.type(fldname));
... | Create a Java method that does the following: "Returns a map of field names to the offset of the object in the specified schema.". |
Of course, here is the Java code you requested:
```java
public Observable<ServiceResponse<Page<CsmUsageQuotaInner>>> listUsagesSinglePageAsync(final String resourceGroupName, final String name, final String filter) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter res... | Create a Java method that does the following: "List usage quota for a specific resource group.". |
Of course, here is the Java code you requested:
```java
public Container getTargetScreen(Container component, Class<?> targetClass, boolean bComponent)
{
Container container = null;
if (bComponent)
if (component == this)
if (m_parent instanceof Container)
{
... | Create a Java method that does the following: "Get the target screen.". |
Of course, here is the Java code you requested:
```java
public void setTitleKey(String titleKey) {
m_titleKey = titleKey;
if (LOG.isDebugEnabled()) {
LOG.debug(Messages.get().getBundle().key(Messages.LOG_SET_TITLE_KEY_1, titleKey));
}
}
```
Hope this helps! | Create a Java method that does the following: "Sets the title key.". |
Of course, here is the Java code you requested:
```java
public String render() throws GitChangelogRepositoryException {
final Writer writer = new StringWriter();
render(writer);
return writer.toString();
}
```
Hope this helps! | Create a Java method that does the following: "Renders the changelog.". |
Of course, here is the Java code you requested:
```java
public static synchronized void verify(Object... objects) {
for (Object mock : objects) {
if (mock instanceof Class<?>) {
verifyClass((Class<?>) mock);
} else {
EasyMockMethodInvocationControl invoca... | Create a Java method that does the following: "Verify that the given objects are a mock object.". |
Of course, here is the Java code you requested:
```java
public String getTcpPortRange() {
String value = null;
value = System.getProperty("GLOBUS_TCP_PORT_RANGE");
if (value != null) {
return value;
}
value = System.getProperty("org.globus.tcp.port.range");
if (value != null) {
return value;
}
return... | Create a Java method that does the following: "Returns the tcp port range.". |
Of course, here is the Java code you requested:
```java
public List<Long> getSitesForPartitions(int[] partitions) {
ArrayList<Long> all_sites = new ArrayList<Long>();
for (int p : partitions) {
List<Long> sites = getSitesForPartition(p);
for (long site : sites)
{
... | Create a Java method that does the following: "Get the sites for the partitions.". |
Of course, here is the Java code you requested:
```java
public static void runUninterruptibly(final Try.Runnable<InterruptedException> cmd) {
N.checkArgNotNull(cmd);
boolean interrupted = false;
try {
while (true) {
try {
cmd.run();
... | Create a Java method that does the following: "Run an uncaught exception in a thread.". |
Of course, here is the Java code you requested:
```java
public void setSrcPath(String in) throws IOException {
srcPath = new Path(in);
srcPath = srcPath.makeQualified(srcPath.getFileSystem(conf));
}
```
Hope this helps! | Create a Java method that does the following: "Sets the src path.". |
Of course, here is the Java code you requested:
```java
public static String applyPrefixSuffix(String uriSource,
Configuration conf) {
if (uriSource == null) return null;
String prefix = conf.get(OUTPUT_URI_PREFIX);
String suffix = conf.get(OUTPUT_URI_SUFFIX);
if (prefix ==... | Create a Java method that does the following: "Apply the prefix and suffix to the URI source.". |
Of course, here is the Java code you requested:
```java
public SafeStyle toSafeStyle() {
Preconditions.checkState(
getContentKind() == ContentKind.CSS,
"toSafeStyle() only valid for SanitizedContent of kind CSS, is: %s",
getContentKind());
// Sanity check: Try to prevent accidental mis... | Create a Java method that does the following: "Converts the SanitizedContent to a SafeStyle.". |
Of course, here is the Java code you requested:
```java
public void displayTitle() throws Exception {
JspWriter out = getJsp().getJspContext().getOut();
out.println(htmlStart());
out.println(bodyStart(null));
out.println(dialogStart());
out.println(dialogContentStart(getParamTi... | Create a Java method that does the following: "Display the title of the page.". |
Of course, here is the Java code you requested:
```java
protected Spliterator<InternalCacheEntry<K, V>> filterExpiredEntries(Spliterator<InternalCacheEntry<K, V>> spliterator) {
// This way we only read the wall clock time at the beginning
long accessTime = timeService.wallClockTime();
return new Fil... | Create a Java method that does the following: "Filter expired entries.". |
Of course, here is the Java code you requested:
```java
public static <T> T writeAtomically(final File file, OutputStreamConsumer<T> f) throws IOException
{
return writeAtomically(file, file.getParentFile(), f);
}
```
Hope this helps! | Create a Java method that does the following: "Write atomically to a file.". |
Of course, here is the Java code you requested:
```java
private String alterPrefix(String word, String oldPrefix, String newPrefix) {
if (word.startsWith(oldPrefix)) {
return word.replaceFirst(oldPrefix, newPrefix);
}
return (newPrefix + word);
}
```
Hope this helps! | Create a Java method that does the following: "Alter the prefix of a word.". |
Of course, here is the Java code you requested:
```java
public void scheduleAfterBackgroundWakeup(Context context, List<ScanResult> scanResults) {
if (scanResults != null) {
mBackgroundScanResultQueue.addAll(scanResults);
}
synchronized (this) {
// We typically get a bun... | Create a Java method that does the following: "Schedule a scan job after a background wake up.". |
Of course, here is the Java code you requested:
```java
public void update(String jobId, String taskId) {
updateWithServiceResponseAsync(jobId, taskId).toBlocking().single().body();
}
```
Hope this helps! | Create a Java method that does the following: "Update an App Service Environment. Update an App Service Environment.". |
Of course, here is the Java code you requested:
```java
public static Polygon buffer(Geometry geometry,
SpatialReference spatialReference, double distance) {
double bufferDistance = distance;
OperatorBuffer op = (OperatorBuffer) factory
.getOperator(Operator.Type.Buffer);
Geometry result = op.execute(geo... | Create a Java method that does the following: "Create a polygon that is a buffer of the geometry.". |
Of course, here is the Java code you requested:
```java
public static DMatrixRMaj singular(int numRows, int numCols,
Random rand, double ...sv)
{
DMatrixRMaj U,V,S;
// speed it up in compact format
if( numRows > numCols ) {
U = RandomMatri... | Create a Java method that does the following: "Get the singular matrix from the specified random number generator". |
Of course, here is the Java code you requested:
```java
public static String generateQuery(final Map<String,Object> params){
final StringBuilder sb = new StringBuilder();
boolean newEntry = false;
sb.append("{");
for(final Entry<String,Object> param: params.entrySet()){
if(newEntry){
sb.append(", ");... | Create a Java method that does the following: "Generate query string.". |
Of course, here is the Java code you requested:
```java
public Variable[] intersect(Scope scope) {
Collection<Variable> intersection = new ArrayList<Variable>();
// A set of variable names that have been moved into the intersection.
Set<String> matchedNames = new HashSet<String>(7);
... | Create a Java method that does the following: "Intersects this and scope with another.". |
Of course, here is the Java code you requested:
```java
@Implementation(minSdk = JELLY_BEAN_MR2)
protected static void beginSection(String sectionName) {
if (Trace.isTagEnabled(TRACE_TAG_APP)) {
if (crashOnIncorrectUsage) {
if (sectionName.length() > MAX_SECTION_NAME_LEN) {
throw new Ille... | Create a Java method that does the following: "Begin a new section.". |
Of course, here is the Java code you requested:
```java
@Override
public void shutdown() throws PluginException {
if (storage != null) {
try {
storage.shutdown();
} catch (PluginException pe) {
log.error("Failed to shutdown storage: {}", pe.getMessage());
throw pe;
}
}
if (indexer != null) ... | Create a Java method that does the following: "Shutdown the object store.". |
Of course, here is the Java code you requested:
```java
@Override
public DocumentTranslationRequestData getDocumentTranslationRequest(
String trId) throws ServiceException {
if (trId == null || trId.isEmpty()) {
throw new IllegalArgumentException("Non-empty trId must be specified.")... | Create a Java method that does the following: "Get the Document Translation Request for the specified ID.". |
Of course, here is the Java code you requested:
```java
public static double cleanProbability(double prob, double epsilon, boolean allowOne) {
if (prob < -epsilon || prob > (1.0 + epsilon)) {
throw new InvalidProbabilityException(prob);
}
if (prob < epsilon) {
prob = epsilon;
} else {
... | Create a Java method that does the following: "Clean the probability.". |
Of course, here is the Java code you requested:
```java
public void marshall(GlobalTableGlobalSecondaryIndexSettingsUpdate globalTableGlobalSecondaryIndexSettingsUpdate, ProtocolMarshaller protocolMarshaller) {
if (globalTableGlobalSecondaryIndexSettingsUpdate == null) {
throw new SdkClientExcepti... | Create a Java method that does the following: "marshalls the given GlobalTableGlobalSecondaryIndexSettingsUpdate object to the JSON file.". |
Of course, here is the Java code you requested:
```java
public static DateTime adjustedStandardGpsTime2DateTime( double adjustedStandardGpsTime ) {
// gps time is adjusted gps time
double standardGpsTimeSeconds = adjustedStandardGpsTime + 1E9;
double standardGpsTimeMillis = standardGpsTimeSecon... | Create a Java method that does the following: "Adjusted standard gps time to datetime.". |
Of course, here is the Java code you requested:
```java
public static void elementDiv( DMatrix2 a , DMatrix2 b) {
a.a1 /= b.a1;
a.a2 /= b.a2;
}
```
Hope this helps! | Create a Java method that does the following: "Divide two matrices.". |
Of course, here is the Java code you requested:
```java
public void initialize(Language language, DocumentType typeToProcess, OutputType outputType, String configPath) {
initialize(language, typeToProcess, outputType, configPath, POSTagger.TREETAGGER);
}
```
Hope this helps! | Create a Java method that does the following: "Initializes the entity with the given language and configuration.". |
Of course, here is the Java code you requested:
```java
public static DateTimeFormatter getDateFormatter(String format, String lang, String country) {
if (StringUtils.isNotBlank(format)) {
DateTimeFormatter dateFormat = DateTimeFormat.forPattern(format);
if (StringUtils.isNotBlank(la... | Create a Java method that does the following: "Gets the date formatter.". |
Of course, here is the Java code you requested:
```java
public boolean hasPermissionsById(String id, String... permissions) {
List<Permission> resolvedPermissions = Lists.newArrayListWithCapacity(permissions.length);
for (String permission : permissions) {
resolvedPermissions.add(getPermiss... | Create a Java method that does the following: "Check if a set of permissions exists for a specific ID.". |
Of course, here is the Java code you requested:
```java
@NullSafe
@SafeVarargs
public static <T> Iterable<T> asIterable(T... array) {
return () -> asIterator(array);
}
```
Hope this helps! | Create a Java method that does the following: "Returns an iterable that iterates over the elements of the array.". |
Of course, here is the Java code you requested:
```java
public final void print() {
System.out.println("=========");
print_impl(-99,NO_KEY,_val_1);
_chm.print();
System.out.println("=========");
}
```
Hope this helps! | Create a Java method that does the following: "Print the content of this object.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings({ "cast", "unchecked" })
public static <O extends SpatialComparable> KNNQuery<O> getKNNQuery(AbstractRStarTree<?, ?, ?> tree, SpatialDistanceQuery<O> distanceQuery, Object... hints) {
// Can we support this distance function - spatial dist... | Create a Java method that does the following: "Get a KNNQuery for a given distance query using the given hints.". |
Of course, here is the Java code you requested:
```java
@Override
public SendMessageResult sendMessage(SendMessageRequest request) {
request = beforeClientExecution(request);
return executeSendMessage(request);
}
```
Hope this helps! | Create a Java method that does the following: "Sends a message to a single language.". |
Of course, here is the Java code you requested:
```java
private void remArc(int from, int to) throws ContradictionException {
if (from != to) {
for (int i : g.getMandSuccOrNeighOf(from)) {
if (g.removeArc(i, to, this)) {
arcRemoved(i, to);
}
}
for (int i : g.getMandPredOrNeighOf(to)) {
if (... | Create a Java method that does the following: "remArc removes the arc from the given range.". |
Of course, here is the Java code you requested:
```java
public static int replaceAccentedChars(StringBuilder buffer) {
// save the size before we strip out the accents
int sizeBefore = buffer.length();
// each accented char will be converted into 2 chars -- the ascii version
// followed... | Create a Java method that does the following: "Replace accented chars in the buffer with nothing.". |
Of course, here is the Java code you requested:
```java
public com.google.api.Distribution.Range getRange() {
return range_ == null ? com.google.api.Distribution.Range.getDefaultInstance() : range_;
}
```
Hope this helps! | Create a Java method that does the following: "Gets the value of the range property.". |
Of course, here is the Java code you requested:
```java
public void finer(String message) throws NullPointerException,
FacilityException {
sendNotification(TraceLevel.FINER, message, null);
logger.debug(message);
}
```
Hope this helps! | Create a Java method that does the following: "Sends a trace message to the application that was created by the application.". |
Of course, here is the Java code you requested:
```java
public LocalTime plusHours(long hoursToAdd) {
if (hoursToAdd == 0) {
return this;
}
int newHour = ((int) (hoursToAdd % HOURS_PER_DAY) + hour + HOURS_PER_DAY) % HOURS_PER_DAY;
return create(newHour, minute, second, nano)... | Create a Java method that does the following: "Add hours to this time time.". |
Of course, here is the Java code you requested:
```java
private Table buildHistoryTable(CmsHistoryResourceCollection historyList) {
final CmsObject cms = A_CmsUI.getCmsObject();
try {
CmsBeanTableBuilder<CmsHistoryRow> builder = CmsBeanTableBuilder.newInstance(
CmsHistoryRo... | Create a Java method that does the following: "Build the table for the CRA - 203 history.". |
Of course, here is the Java code you requested:
```java
public String getTextContent(String url) throws IOException {
if (debug) System.out.println(" URL.getTextContent=" + url);
baseURL = new URL(url);
InputStream in = baseURL.openStream();
InputStreamReader r = new InputStreamReader(filterTag(in), C... | Create a Java method that does the following: "Get the text content of the specified URL.". |
Of course, here is the Java code you requested:
```java
protected OperationResponse internalExecute(final Operation operation, final ManagementRequestContext<?> context, final OperationMessageHandler messageHandler, final ModelController.OperationTransactionControl control) {
// Execute the operation
r... | Create a Java method that does the following: "Execute the operation.". |
Of course, here is the Java code you requested:
```java
public static <E> E parse(String jsonString, ParameterizedType<E> jsonObjectType) throws IOException {
return mapperFor(jsonObjectType).parse(jsonString);
}
```
Hope this helps! | Create a Java method that does the following: "Parse a JSON string.". |
Of course, here is the Java code you requested:
```java
public void setOnClick(String onclick)
{
_state.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, ONCLICK, setNonEmptyValueAttribute(onclick));
// Jira 299
//_state.onClick = setNonEmptyValueAttribute(onclick);
}
```
Hope this ... | Create a Java method that does the following: "Sets the onclick javascript event.". |
Of course, here is the Java code you requested:
```java
private String selectTerm(String iri, List<String> containers, String typeLanguage,
List<String> preferredValues) {
final Map<String, Object> inv = getInverse();
// 1)
final Map<String, Object> containerMap = (Map<String, Objec... | Create a Java method that does the following: "Select term from the list of terms.". |
Of course, here is the Java code you requested:
```java
@Override
protected void searchDisposed() {
// release thread pool
pool.shutdown();
// dispose contained searches
searches.forEach(s -> s.dispose());
// dispose super
super.searchDisposed();
}
```
H... | Create a Java method that does the following: "Dispose of the base class.". |
Of course, here is the Java code you requested:
```java
@DoesServiceRequest
public ServiceStats getServiceStats(TableRequestOptions options, OperationContext opContext)
throws StorageException {
if (opContext == null) {
opContext = new OperationContext();
}
opContex... | Create a Java method that does the following: "Get the service stats for a single language language.". |
Of course, here is the Java code you requested:
```java
private InterceptorProxy[] getAroundInterceptorProxies(InterceptorMethodKind kind, Method m)
throws EJBConfigurationException
{
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnab... | Create a Java method that does the following: "This method is called to get the InterceptorProxy array for invoking around invoke interceptors for the business method specified by the caller.". |
Of course, here is the Java code you requested:
```java
@GET
@Produces(MediaType.APPLICATION_JSON)
@Description("Returns all alerts.")
public List<AlertDto> getAlerts(@Context HttpServletRequest req, @QueryParam("alertname") String alertName,
@QueryParam("ownername") String ownerName,
@QueryParam(... | Create a Java method that does the following: "Retrieve a list of all alerts owned by the authenticated user.". |
Of course, here is the Java code you requested:
```java
public void pingReceived(Ping pong) {
long now = System.currentTimeMillis();
long previousPingTime = lastPingSentOn.get();
int previousPingValue = (int) (previousPingTime & 0xffffffffL);
int pongValue = pong.getValue2().intValu... | Create a Java method that does the following: "Handles a pong message received from the session.". |
Of course, here is the Java code you requested:
```java
public static <E> Iterator<List<E>> unchain(int channelSize, Iterable<E> iterable) {
dbc.precondition(iterable != null, "cannot unchain a null iterable");
final Supplier<List<E>> channelFactory = Compositions.compose(new Vary<ArrayList<E>, List<E>... | Create a Java method that does the following: "Unchain an iterable into a new iterator.". |
Of course, here is the Java code you requested:
```java
VoltXMLElement voltGetConstraintXML()
{
// Skip "MAIN" constraints, as they are a side effect of foreign key constraints and add no new info.
if (this.constType == MAIN) {
return null;
}
VoltXMLElement constraint =... | Create a Java method that does the following: "VoltXMLElement to get the XML for the constraint.". |
Of course, here is the Java code you requested:
```java
protected ResponseEntity<String> createResponseEntityForTicket(final HttpServletRequest request,
final TicketGrantingTicket tgtId) throws Exception {
return this.ticketGrantingTicketResour... | Create a Java method that does the following: "Create response entity for ticket.". |
Of course, here is the Java code you requested:
```java
public static appqoepolicy[] get(nitro_service service) throws Exception{
appqoepolicy obj = new appqoepolicy();
appqoepolicy[] response = (appqoepolicy[])obj.get_resources(service);
return response;
}
```
Hope this helps! | Create a Java method that does the following: "Use this API to fetch all the appqoepolicy resources that are configured on netscaler.". |
Of course, here is the Java code you requested:
```java
public void execute()
throws EFapsException
{
AccessCache.registerUpdate(getInstance());
final boolean hasAccess = this.instance.getType().hasAccess(this.instance,
A... | Create a Java method that does the following: "Execute the EFapsException.". |
Of course, here is the Java code you requested:
```java
public static <T> String toXml(final String jsonString, final Class<T> clazz)
throws JsonParseException, JsonMappingException, IOException
{
final T object = JsonToObjectExtensions.toObject(jsonString, clazz);
final String xmlString = ObjectToXmlExtensions... | Create a Java method that does the following: "Converts a JSON string to an XML string.". |
Of course, here is the Java code you requested:
```java
public WebhookResources webhookResources() {
if (webhooks.get() == null) {
webhooks.compareAndSet(null, new WebhookResourcesImpl(this));
}
return webhooks.get();
}
```
Hope this helps! | Create a Java method that does the following: "Gets the WebhookResources instance.". |
Of course, here is the Java code you requested:
```java
void lowerActiveGetCount( H2ONode h2o ) {
assert _key.home(); // Only the HOME node for a key tracks replicas
assert h2o != H2O.SELF;// Do not track self as a replica
while( true ) { // Repeat, in case racing GETs are bumping the counter
... | Create a Java method that does the following: "Lower the active GET count of a node.". |
Of course, here is the Java code you requested:
```java
@RequestMapping(value = "actions/{entityType}/{id}", method = RequestMethod.GET)
public Resources<Action> getActions(@PathVariable ProjectEntityType entityType, @PathVariable ID id) {
return Resources.of(
extensionManager.getExtensions... | Create a Java method that does the following: "Gets the list of actions for a given entity type and id". |
Of course, here is the Java code you requested:
```java
public void removeAnchor(String a) {
if(anchors == null) {
anchors = new HashMap<String, Node>();
}
anchors.put(a, null);
}
```
Hope this helps! | Create a Java method that does the following: "Removes an anchor from the set of anchors.". |
Of course, here is the Java code you requested:
```java
public static File createDirectory(File parent, String name) {
File created = new File(parent, name);
checkDirectory(created);
return created;
}
```
Hope this helps! | Create a Java method that does the following: "Create a directory with the specified name.". |
Of course, here is the Java code you requested:
```java
public static int getPropertyValueEnum(int property, CharSequence valueAlias) {
int propEnum = UPropertyAliases.INSTANCE.getPropertyValueEnum(property, valueAlias);
if (propEnum == UProperty.UNDEFINED) {
throw new IllegalIcuArgumentExc... | Create a Java method that does the following: "Get the value enum for the specified property.". |
Of course, here is the Java code you requested:
```java
public static NetcdfFile openInMemory(String filename) throws IOException {
File file = new File(filename);
ByteArrayOutputStream bos = new ByteArrayOutputStream((int) file.length());
try (InputStream in = new BufferedInputStream(new FileInputStream(f... | Create a Java method that does the following: "Open in memory NetcdfFile". |
Of course, here is the Java code you requested:
```java
List<Node>
getSubnodes(Node parent)
{
List<Node> subs = new ArrayList<>();
NodeList nodes = parent.getChildNodes();
for(int i = 0; i < nodes.getLength(); i++) {
Node n = nodes.item(i);
if(n.getNodeType() == ... | Create a Java method that does the following: "Get the subnodes of a node". |
Of course, here is the Java code you requested:
```java
public void with(Properties source) {
Assert.notNull(source, "Source properties cannot be null");
String propertyName = getPropertyName();
getProperties().setProperty(propertyName, source.getProperty(propertyName));
}
```
Hope this helps! | Create a Java method that does the following: "Sets the properties of this node with the given properties.". |
Of course, here is the Java code you requested:
```java
static LedgerHandle create(BookKeeper bookKeeper, BookKeeperConfig config) throws DurableDataLogException {
try {
return Exceptions.handleInterruptedCall(() ->
bookKeeper.createLedger(
config.get... | Create a Java method that does the following: "Creates a new LedgerHandle.". |
Of course, here is the Java code you requested:
```java
public void setCommerceAccountOrganizationRelService(
com.liferay.commerce.account.service.CommerceAccountOrganizationRelService commerceAccountOrganizationRelService) {
this.commerceAccountOrganizationRelService = commerceAccountOrganizationRelService;
}
``... | Create a Java method that does the following: "Sets the commerce account organization rel remote service.". |
Of course, here is the Java code you requested:
```java
@Override
public boolean setUARTType(String type, boolean test)
throws UnsupportedCommOperationException {
logger.fine("RXTXPort:setUARTType()");
return nativeSetUartType(type, test);
}
```
Hope this helps! | Create a Java method that does the following: "Set the type of the uart.". |
Of course, here is the Java code you requested:
```java
public BitVector readCoils(int unitId, int ref, int count) throws ModbusException {
checkTransaction();
if (readCoilsRequest == null) {
readCoilsRequest = new ReadCoilsRequest();
}
readCoilsRequest.setUnitID(unitId);
... | Create a Java method that does the following: "This method is used to read a set of coils from the slave.". |
Of course, here is the Java code you requested:
```java
static double routeDistanceRemaining(double legDistanceRemaining, int legIndex,
DirectionsRoute directionsRoute) {
if (directionsRoute.legs().size() < 2) {
return legDistanceRemaining;
}
for (int i = legIn... | Create a Java method that does the following: "Calculate the distance remaining for a route.". |
Of course, here is the Java code you requested:
```java
@Override
public V remove(final Object key) {
OMVRBTreeEntry<K, V> p = getEntry(key, PartialSearchMode.NONE);
setLastSearchNode(null, null);
if (p == null)
return null;
V oldValue = p.getValue();
deleteEntry(p);
return ol... | Create a Java method that does the following: "Removes the specified object from this OMVRBTreeEntry.". |
Of course, here is the Java code you requested:
```java
public static boolean matchValue(Object expectedType, Object actualValue) {
if (expectedType == null)
return true;
if (actualValue == null)
throw new NullPointerException("Actual value cannot be null");
return matchType(expectedType, actualValue.getC... | Create a Java method that does the following: "Checks if the expected value is of the expected type and actual value.". |
Of course, here is the Java code you requested:
```java
protected Endpoint createEndpoint() {
return endpointFactory.create(hostname, bucket, username, password, port, ctx);
}
```
Hope this helps! | Create a Java method that does the following: "Create an endpoint.". |
Of course, here is the Java code you requested:
```java
@Override
public Location translate() {
if (this.location == null) {
// In OCPP 1.5, OUTLET is the default value.
return Location.OUTLET;
}
switch (this.location) {
case INLET:
retur... | Create a Java method that does the following: "Translate the value of the Location property.". |
Of course, here is the Java code you requested:
```java
public void startSetup(@NotNull final OnIabSetupFinishedListener listener) {
if (options != null) {
Logger.d("startSetup() options = ", options);
}
//noinspection ConstantConditions
if (listener == null) {
t... | Create a Java method that does the following: "Start the setup process.". |
Of course, here is the Java code you requested:
```java
public static final Function<Float,Float> roundFloat(final int scale, final RoundingMode roundingMode) {
return new RoundFloat(scale, roundingMode);
}
```
Hope this helps! | Create a Java method that does the following: "Create a function that rounds a float value.". |
Of course, here is the Java code you requested:
```java
public static void markConvexPolyArea(Context ctx, float[] verts, float hmin, float hmax, AreaModification areaMod,
CompactHeightfield chf) {
ctx.startTimer("MARK_CONVEXPOLY_AREA");
float bmin[] = new float[3], bmax[] = new float[3];
... | Create a Java method that does the following: "Mark convex poles area.". |
Of course, here is the Java code you requested:
```java
public void applyConfig(final ConfigSettings config)
{
map.get(PanelKeys.PANEL_VALUES).applyConfig(config);
map.get(PanelKeys.PANEL_EXTERNALS).applyConfig(config);
map.get(PanelKeys.PANEL_INPUT).applyConfig(config);
map.get(PanelKeys.PANEL_OUTPUT).apply... | Create a Java method that does the following: "Apply configuration settings to the configuration panel.". |
Of course, here is the Java code you requested:
```java
public void marshall(TagResourceRequest tagResourceRequest, ProtocolMarshaller protocolMarshaller) {
if (tagResourceRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
... | Create a Java method that does the following: "marshalls the given tag resource request to the JSON object.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("Duplicates")
protected static void printToConsole(ImmoXmlDocument doc) throws JAXBException {
LOGGER.info("> process document in version "
+ doc.getDocumentVersion());
Immoxml immoxml = doc.toObject();
... | Create a Java method that does the following: "Print the content of the document to the console.". |
Of course, here is the Java code you requested:
```java
public void marshall(SplunkDestinationConfiguration splunkDestinationConfiguration, ProtocolMarshaller protocolMarshaller) {
if (splunkDestinationConfiguration == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)"... | Create a Java method that does the following: "marshalls the given splunkDestinationConfiguration to the JSON object.". |
Of course, here is the Java code you requested:
```java
public void process(String baseDirPath, String tmpDirPath,
String destDirPath, boolean generateCdnFiles) throws Exception {
process(baseDirPath, tmpDirPath, destDirPath, generateCdnFiles,
DEFAULT_SERVLET_API_VERSION_2_3);
}
```
Hope this helps! | Create a Java method that does the following: "Process the base directory and target directory.". |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.