code stringlengths 146 69.7k | prompt stringlengths 55 1.5k |
|---|---|
Of course, here is the Java code you requested:
```java
public Observable<Page<DetectorDefinitionInner>> listSiteDetectorsSlotNextAsync(final String nextPageLink) {
return listSiteDetectorsSlotNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<DetectorDefinitionInner>>, ... | Create a Java method that does the following: "Gets a list of detectors in a site.". |
Of course, here is the Java code you requested:
```java
public static Date read(String value) {
String pattern = getPattern(value);
Date date=null;
try {
date = ThreadLocalDateFormatter.parse(value, pattern);
} catch (ParseException e) {
e.printStackTrace();
}
return date;
}
```
Hope this helps! | Create a Java method that does the following: "Read a Date from a String value.". |
Of course, here is the Java code you requested:
```java
protected boolean handlePausedFlow(Execution execution) throws InterruptedException {
String branchId = execution.getSystemContext().getBranchId();
PauseReason reason = findPauseReason(execution.getExecutionId(), branchId);
if (reason != n... | Create a Java method that does the following: "Handle a paused flow.". |
Of course, here is the Java code you requested:
```java
public static BufferedWriter getWriter(File file, String charsetName, boolean isAppend) throws IORuntimeException {
return getWriter(file, Charset.forName(charsetName), isAppend);
}
```
Hope this helps! | Create a Java method that does the following: "Get a BufferedWriter for a file with the specified charset.". |
Of course, here is the Java code you requested:
```java
public void marshall(UpdateApplicationRequest updateApplicationRequest, ProtocolMarshaller protocolMarshaller) {
if (updateApplicationRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
... | Create a Java method that does the following: "marshalls the given updateApplicationRequest to the given protocolMarshaller.". |
Of course, here is the Java code you requested:
```java
@Override
protected void writeBuffer(byte[] buffer, int start, int length) throws IOException
{
if (out instanceof ByteArrayOutputStream)
{
if (((ByteArrayOutputStream)out).size() + length > bufferSize)
{
swapBuffer... | Create a Java method that does the following: "Override the writeBuffer method to write the bytes in the buffer.". |
Of course, here is the Java code you requested:
```java
@Override
public EClass getIfcPolyline() {
if (ifcPolylineEClass == null) {
ifcPolylineEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI).getEClassifiers()
.get(437);
}
return ifcPolylineEClass;
}
```
Hope this h... | Create a Java method that does the following: "Get the IfcPolylineEClass attribute of the interface.". |
Of course, here is the Java code you requested:
```java
public List<PresenceState> getShowValues() {
ArrayList<PresenceState> result = new ArrayList<>(5);
for (String state : getFieldValues(SubscribeOptionFields.show_values)) {
result.add(PresenceState.valueOf(state));
}
re... | Create a Java method that does the following: "Gets the show_values field.". |
Of course, here is the Java code you requested:
```java
public static <C extends OWLObject> C read(BinaryOWLInputStream inputStream) throws IOException, BinaryOWLParseException {
byte typeMarker = inputStream.readByte();
checkPositionIndex(0, 84, "Invalid type marker");
OWLObjectBinaryType<C> t... | Create a Java method that does the following: "Reads a single object from an input stream.". |
Of course, here is the Java code you requested:
```java
protected String getPropertyName(FeatureState featureState, String parameterName) {
String propertyName = featureState.getParameter(parameterName);
if (Strings.isNotBlank(propertyName)) {
return propertyName;
}
return ... | Create a Java method that does the following: "Get the property name for a feature.". |
Of course, here is the Java code you requested:
```java
@Deprecated
private String idSuffix(String name, DomainObject to) {
if (useIdSuffixInForeignKey()) {
Attribute idAttribute = getIdAttribute(to);
if (idAttribute != null) {
String idName = idAttribute.getDatabaseColumn().toUpperCase();
Stri... | Create a Java method that does the following: "Override this method to use the ID suffix in foreign keys.". |
Of course, here is the Java code you requested:
```java
@Deprecated
public void writeFlat(Object o, FlatRecordWriter flatRecordWriter) {
HollowTypeMapper typeMapper = getTypeMapper(o.getClass(), null, null);
typeMapper.writeFlat(o, flatRecordWriter);
}
```
Hope this helps! | Create a Java method that does the following: "Write the object to the FlatRecordWriter.". |
Of course, here is the Java code you requested:
```java
public Observable<ServiceResponse<Void>> scaleWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this... | Create a Java method that does the following: "Scales a Streaming Entity Identity System.". |
Of course, here is the Java code you requested:
```java
public static boolean ofType(int specific, int general) {
if (general == specific) {
return true;
}
switch (general) {
case ANY:
return true;
case NOT_EOF:
return speci... | Create a Java method that does the following: "Checks if the given specific is of type.". |
Of course, here is the Java code you requested:
```java
public void registerVersion(Version versionToAdd) {
String versionName = keyHandler.handle(versionToAdd.getName());
versions.put(versionName, versionToAdd);
notifyReportableObservers(versionToAdd);
}
```
Hope this helps! | Create a Java method that does the following: "Registers a version to be reported.". |
Of course, here is the Java code you requested:
```java
@Override
public String getdeploymentDescriptor() {
final String methodName = "getdeploymentDescriptor";
final boolean trace = TraceComponent.isAnyTracingEnabled();
if (trace && tc.isEntryEnabled())
Tr.entry(tc, methodName,... | Create a Java method that does the following: "Get the Deployment Descriptor.". |
Of course, here is the Java code you requested:
```java
private static String getStyleClasses(AbstractNavLink link, boolean isResponsive) {
StringBuilder sb;
sb = new StringBuilder(20); // optimize int
String look = null;
if (link instanceof Link) {
look = ((Link) link).getLook();
} else if (link instanc... | Create a Java method that does the following: "Get the style classes for the given link.". |
Of course, here is the Java code you requested:
```java
public static void sort(float[] floatArray) {
boolean swapped = true;
while(swapped) {
swapped = false;
for(int i = 0; i < (floatArray.length - 1 ); i++) {
if(floatArray[i] > floatArray... | Create a Java method that does the following: "Sort the float array in ascending order.". |
Of course, here is the Java code you requested:
```java
public static void setCurrentPayload(Variables stack, String name, WindupVertexFrame frame)
throws IllegalArgumentException
{
Map<String, Iterable<? extends WindupVertexFrame>> vars = stack.peek();
Iterable<? extends WindupVer... | Create a Java method that does the following: "Sets the current payload of an iteration.". |
Of course, here is the Java code you requested:
```java
protected void deferredClose() {
Thread t = new Thread(getClass().getName() + " DeferredClose") {
@Override
public void run() {
try {
synchronized (BaseFileManager.this) {
... | Create a Java method that does the following: "Deferred close.". |
Of course, here is the Java code you requested:
```java
public byte[] getEntry(String name) {
if (src == null) {
throw new IllegalStateException("Source is not given");
}
return ZipUtil.unpackEntry(src, name);
}
```
Hope this helps! | Create a Java method that does the following: "Get the entry of the entry in the source.". |
Of course, here is the Java code you requested:
```java
@Override
public void process(@Nonnull StepContext context, @Nonnull Element mavenSpyLogsElt) throws IOException, InterruptedException {
TaskListener listener = context.get(TaskListener.class);
if (listener == null) {
LOGGER.warni... | Create a Java method that does the following: "Process the Maven SpyLogs element.". |
Of course, here is the Java code you requested:
```java
public static int randomSegment(String conf) {
String[] tmp = StringUtils.split(conf, ":");
int[] probability = new int[tmp.length];
for (int i = 0; i < probability.length; i++)
probability[i] = Integer.parseInt(tmp[i].trim... | Create a Java method that does the following: "Returns a random segment of the number of times a class is generated.". |
Of course, here is the Java code you requested:
```java
public void pause(Boolean pausePlayback, int position) {
IConnection conn = Red5.getConnectionLocal();
if (conn instanceof IStreamCapableConnection) {
IStreamCapableConnection streamConn = (IStreamCapableConnection) conn;
... | Create a Java method that does the following: "Pause or resume the stream.". |
Of course, here is the Java code you requested:
```java
@Override
protected boolean notHaveAnyExpirableRecord(PartitionContainer partitionContainer) {
boolean notExist = true;
final ConcurrentMap<String, RecordStore> maps = partitionContainer.getMaps();
for (RecordStore store : maps.values(... | Create a Java method that does the following: "Check if any of the recordstores in the partition container are expirable.". |
Of course, here is the Java code you requested:
```java
public OperationFuture<LoadBalancer> update(
LoadBalancer loadBalancer, List<LoadBalancerPoolConfig> configs) {
List<LoadBalancerPoolMetadata> poolsForGroup = find(
new LoadBalancerPoolFilter().loadBalancers(loadBalancer)
);
... | Create a Java method that does the following: "Update load balancer with list of load balancer pool configs". |
Of course, here is the Java code you requested:
```java
private ClassDefinition extractClassDefinition(
Node targetName, Node callNode) {
JSDocInfo classInfo = NodeUtil.getBestJSDocInfo(targetName);
// name = goog.defineClass(superClass, {...}, [modifier, ...])
Node superClass = NodeUtil.getArgumen... | Create a Java method that does the following: "Extract a class definition from a call node.". |
Of course, here is the Java code you requested:
```java
public static void writeCertificate(
OutputStream out,
X509Certificate cert)
throws IOException, CertificateEncodingException {
PEMUtil.writeBase64(out,
"-----BEGIN CERTIFICATE-----",
Bas... | Create a Java method that does the following: "Write a single certificate to an output stream.". |
Of course, here is the Java code you requested:
```java
public boolean isSponsorInHierarchy(DevelopmentProposalContract sponsorable, String sponsorHierarchy,String level1) {
return sponsorHierarchyService.isSponsorInHierarchy(sponsorable.getSponsor().getSponsorCode(), sponsorHierarchy, 1, level1);
}
```
H... | Create a Java method that does the following: "Check if a Sponsor is in the hierarchy". |
Of course, here is the Java code you requested:
```java
public synchronized byte[] allocate(int minSize) {
if (minSize <= MAX_SIZE) {
for (int i = 0; i < SIZES.length; i++) {
if (minSize < SIZES[i]) {
if (!fastBuffers.get(SIZES[i]).isEmpty()) {
... | Create a Java method that does the following: "Allocate a new byte array of size minSize.". |
Of course, here is the Java code you requested:
```java
static List<String> filter(List<String> tokens) {
List<String> result = new ArrayList<>();
Set<String> noise = noiseWords();
for (String token : tokens) {
if (S.blank(token)) {
continue;
}
... | Create a Java method that does the following: "Filter a list of tokens to remove noise words.". |
Of course, here is the Java code you requested:
```java
@Override
public int compareTo(ValueArray<CharValue> o) {
CharValueArray other = (CharValueArray) o;
int min = Math.min(position, other.position);
for (int i = 0; i < min; i++) {
int cmp = Character.compare(data[i], other.data[i]);
if (cmp != 0) {
... | Create a Java method that does the following: "Compare two CharValueArrays.". |
Of course, here is the Java code you requested:
```java
public void removePhysicalPosition(final long iPosition) throws IOException {
final long position = iPosition * RECORD_SIZE;
acquireExclusiveLock();
try {
final long[] pos = fileSegment.getRelativePosition(position);
final OFile f... | Create a Java method that does the following: "Removes the physical position iPosition from the hole segment.". |
Of course, here is the Java code you requested:
```java
public void insertDatum (Object element, int row)
{
_data.add(row, element);
_model.fireTableRowsInserted(row, row);
}
```
Hope this helps! | Create a Java method that does the following: "Insert a new data row into the table.". |
Of course, here is the Java code you requested:
```java
private int mapNSTokens(String pat, int startSubstring, int posOfNSSep,
int posOfScan)
throws javax.xml.transform.TransformerException
{
String prefix = "";
if ((startSubstring >= 0) && (posOfNSSep >= 0))
{
... | Create a Java method that does the following: "Map a string of NSSP tokens to a list of tokens.". |
Of course, here is the Java code you requested:
```java
@Override
public void serializeInstance(SerializationStreamWriter streamWriter, IRI instance) throws SerializationException {
serialize(streamWriter, instance);
}
```
Hope this helps! | Create a Java method that does the following: "Serialize an instance of the CNS ANONVORA class.". |
Of course, here is the Java code you requested:
```java
public void onClearGalleries(List<String> galleries) {
if (galleries != null) {
m_galleryDialog.getGalleriesTab().uncheckGalleries(galleries);
}
}
```
Hope this helps! | Create a Java method that does the following: "Clear the list of galleries.". |
Of course, here is the Java code you requested:
```java
private static Options getOptions () {
Options options = new Options();
options.addOption(Option.builder("h").longOpt("help").desc("print this message").build());
options.addOption(Option.builder()
.longOpt("export").hasArg... | Create a Java method that does the following: "Get the options for the CRUD application.". |
Of course, here is the Java code you requested:
```java
private void resetConfigToDefault() {
isUseWebservice = true;
isUpdateAutomatic = true;
isUseExternalMonomers = false;
isUseExternalNucleotides = false;
setUseExternalAttachments(false);
webserviceMonomersURL = "http://localhost:8080... | Create a Java method that does the following: "Resets the configuration to the default.". |
Of course, here is the Java code you requested:
```java
public MessageDigest getStrongestMessageDigest() {
if (digestExists("SHA-512") && caps.contains(Capability.SHA_512)) {
return getDigest("SHA-512");
} else if (digestExists("SHA-256") && caps.contains(Capability.SHA_256)) {
... | Create a Java method that does the following: "Get the strongest message digest for this application.". |
Of course, here is the Java code you requested:
```java
@Override
public void clear() {
full = false;
start = 0;
end = 0;
Arrays.fill(elements, null);
}
```
Hope this helps! | Create a Java method that does the following: "Clear the array of tokens.". |
Of course, here is the Java code you requested:
```java
public CsrfToken loadToken(HttpServletRequest request) {
CsrfToken token = null;
String ident = getIdentifierFromCookie(request);
if (ident != null) {
String key = ident.concat(parameterName);
if (Config.isCacheEnabled()) {
token = cache.get(Confi... | Create a Java method that does the following: "Load a CSRF token from the cookie.". |
Of course, here is the Java code you requested:
```java
@Override
public ImportTerminologyResult importTerminology(ImportTerminologyRequest request) {
request = beforeClientExecution(request);
return executeImportTerminology(request);
}
```
Hope this helps! | Create a Java method that does the following: "Imports a terminology from an existing app.". |
Of course, here is the Java code you requested:
```java
public static <T> List<List<T>> chop(T[] self, int... chopSizes) {
return chop(Arrays.asList(self), chopSizes);
}
```
Hope this helps! | Create a Java method that does the following: "Chop a list of objects into a list of lists of lists of objects of the specified size.". |
Of course, here is the Java code you requested:
```java
public boolean addPreserveTag(final String tagName) {
Vector<Attribute> attributeList = new Vector<Attribute>(1);
Attribute tagNameAttribute = new Attribute();
tagNameAttribute.setName(tagName.toLowerCase());
attributeList.add(tag... | Create a Java method that does the following: "Add a tag to the resource.". |
Of course, here is the Java code you requested:
```java
public void setFrame(String frame)
{
_tableState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.FRAME, frame);
}
```
Hope this helps! | Create a Java method that does the following: "Sets the value of the frame attribute for the HTML table tag.". |
Of course, here is the Java code you requested:
```java
public PublicIpMetadata getPublicIp(Server serverRef, String publicIp) {
return this.getPublicIp(idByRef(serverRef), publicIp);
}
```
Hope this helps! | Create a Java method that does the following: "Get public IP metadata by serverRef". |
Of course, here is the Java code you requested:
```java
private boolean check_nimbus_priority() throws Exception {
int gap = update_nimbus_detail();
if (gap == 0) {
return true;
}
int left = SLAVE_NIMBUS_WAIT_TIME;
while (left > 0) {
LOG.info("nimbus.dif... | Create a Java method that does the following: "check if nimbus is leader". |
Of course, here is the Java code you requested:
```java
public Plugin stopPlugin(final String pluginName) {
synchronized (pluginMap) {
Plugin plugin = (Plugin) pluginMap.get(pluginName);
if (plugin == null) {
return null;
}
// shutdown the plugi... | Create a Java method that does the following: "Stop a plugin.". |
Of course, here is the Java code you requested:
```java
public void renderView(ServletRequest request, ServletResponse response, ServletContext servletContext)
throws IOException
{
ResponseRenderAppender appender = new ResponseRenderAppender(response);
ScriptTag.State state = new Script... | Create a Java method that does the following: "Render the view.". |
Of course, here is the Java code you requested:
```java
@Override
public void writeClassBody(Definition def, Writer out) throws IOException
{
int indent = 1;
out.write("public interface " + getClassName(def));
writeLeftCurlyBracket(out, 0);
if (def.getMcfDefs().get(getNumOfMcf()).isDefi... | Create a Java method that does the following: "Writes the body of a class.". |
Of course, here is the Java code you requested:
```java
private boolean incrementalDistanceMatrixComputation(int from,int to,Bounds i) {
logger.fine("Propagating (quad) with (#TPs,#cons) = (" + this.MAX_USED + "," + this.theNetwork.getConstraints().length + ") (call num.: " + (++quadPropCount) + ")");
if (dist... | Create a Java method that does the following: "Computes the incremental distance matrix computation.". |
Of course, here is the Java code you requested:
```java
public ConfusionMessage createCNF(int cic) {
ConfusionMessage msg = createCNF();
CircuitIdentificationCode code = this.parameterFactory.createCircuitIdentificationCode();
code.setCIC(cic);
msg.setCircuitIdentificationCode(code);
... | Create a Java method that does the following: "Create a CNF message.". |
Of course, here is the Java code you requested:
```java
public static void write(final String templateFilename, final Map<String, Object> data,
final Writer writer) {
Template tmpl = null;
try {
/*-
* note that we don't need to cache templates by ourselves since get... | Create a Java method that does the following: "Write a single instance of a single instance of a class from a map of key - value pairs to a writer.". |
Of course, here is the Java code you requested:
```java
public void printElement(String elementName, Object value) {
println("<" + elementName + ">" + (value == null ? "" : escape(value.toString())) + "</" + elementName + ">");
}
```
Hope this helps! | Create a Java method that does the following: "Print an element with a value.". |
Of course, here is the Java code you requested:
```java
@Nullable
ExpressionItem readFunctionArgument(@Nonnull final PushbackReader reader, @Nonnull final ExpressionTree tree, @Nonnull final PreprocessorContext context, @Nullable @MustNotContainNull final FilePositionInfo[] callStack, @Nullable final String source) ... | Create a Java method that does the following: "Read a function argument.". |
Of course, here is the Java code you requested:
```java
public T get(String key) {
SoftReference<T> ref = cacheMap.get(key);
if (ref != null) {
if (ref.get() == null) {
logger.debug("Cached item was cleared: " + key);
}
return ref.get(); //maybe still... | Create a Java method that does the following: "Get the object from the cache.". |
Of course, here is the Java code you requested:
```java
@Override
public CacheCluster deleteCacheCluster(DeleteCacheClusterRequest request) {
request = beforeClientExecution(request);
return executeDeleteCacheCluster(request);
}
```
Hope this helps! | Create a Java method that does the following: "Deletes a cache cluster.". |
Of course, here is the Java code you requested:
```java
@Override
public RecordStreamWithMetadata<DO, SO> processStream(RecordStreamWithMetadata<DI, SI> inputStream,
WorkUnitState workUnitState) throws SchemaConversionException {
int maxConcurrentAsyncConversions = workUnitState.getPropAsInt(MAX_CONCURRENT... | Create a Java method that does the following: "Process a RecordStreamWithMetadata.". |
Of course, here is the Java code you requested:
```java
public void register(String name, Command command) {
Preconditions.checkArgument(name != null && !name.isEmpty(), "Parameter 'name' must not be [" + name + "]");
Preconditions.checkArgument(command != null, "Parameter 'command' must not be [" + command + "]")... | Create a Java method that does the following: "Registers a command with the command manager.". |
Of course, here is the Java code you requested:
```java
private boolean hasAccessibleZeroArgConstructor(Class<?> rawType) {
Constructor<?> constructor;
try {
constructor = rawType.getDeclaredConstructor();
} catch (NoSuchMethodException e) {
return rawType.getDeclaredConstructors().length == 0;... | Create a Java method that does the following: "Checks if the rawType has a zero argument constructor.". |
Of course, here is the Java code you requested:
```java
public Result nextForCodePoint(int cp) {
return cp<=0xffff ?
next(cp) :
(next(UTF16.getLeadSurrogate(cp)).hasNext() ?
next(UTF16.getTrailSurrogate(cp)) :
Result.NO_MATCH);
}
```
Hope this helps! | Create a Java method that does the following: "Returns the next code point in the sequence.". |
Of course, here is the Java code you requested:
```java
public static NamespaceContextSelector getCurrentSelector() {
NamespaceContextSelector selector = currentSelector.peek();
if(selector != null) {
return selector;
}
return defaultSelector;
}
```
Hope this helps! | Create a Java method that does the following: "Get the current selector.". |
Of course, here is the Java code you requested:
```java
public final boolean isRemoved(final String key) {
final Property prop = find(key);
if (prop == null) {
return true;
}
return prop.isDeleted();
}
```
Hope this helps! | Create a Java method that does the following: "Returns true if the property with the specified key is removed.". |
Of course, here is the Java code you requested:
```java
@Override
public synchronized void run() {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "run: size=" + ivAllRemoteAsyncResults.size());
if (ivIsCanceled... | Create a Java method that does the following: "This method is called by the application to run the application.". |
Of course, here is the Java code you requested:
```java
public static boolean isEmptyCriteria(final Criteria criteria) {
return isEmpty(criteria.getAliases()) &&
isEmpty(criteria.getDeviceTypes()) &&
isEmpty(criteria.getCategories());
}
```
Hope this helps! | Create a Java method that does the following: "Checks if the Criteria object is empty.". |
Of course, here is the Java code you requested:
```java
public Set getMessagingEngineSet(String busName) {
if (!isInitialized()) {
HashSet s = new HashSet();
return s;
}
return _jsmain.getMessagingEngineSet(busName);
}
```
Hope this helps! | Create a Java method that does the following: "Get the set of messaging engines for the given bus name.". |
Of course, here is the Java code you requested:
```java
public static base_response update(nitro_service client, spilloverpolicy resource) throws Exception {
spilloverpolicy updateresource = new spilloverpolicy();
updateresource.name = resource.name;
updateresource.rule = resource.rule;
updateresource.action =... | Create a Java method that does the following: "Use this API to update spilloverpolicy.". |
Of course, here is the Java code you requested:
```java
private static URL[] pathToURLs(String path) {
java.util.List<URL> urls = new ArrayList<>();
for (String s: path.split(Pattern.quote(File.pathSeparator))) {
if (!s.isEmpty()) {
URL url = fileToURL(Paths.get(s));
... | Create a Java method that does the following: "Get the URL array from a path". |
Of course, here is the Java code you requested:
```java
public void send(Set<OpenTsdbMetric> metrics) {
// we set the patch size because of existing issue in opentsdb where large batch of metrics failed
// see at https://groups.google.com/forum/#!topic/opentsdb/U-0ak_v8qu0
// we recommend batch... | Create a Java method that does the following: "Send a set of OpenTsdbMetrics to the server.". |
Of course, here is the Java code you requested:
```java
public static <C> boolean expect(C target, C... expects) {
if (null == expects) { return null == target; }
for (C expect : expects) { if (expect == target) { return true; } }
return false;
}
```
Hope this helps! | Create a Java method that does the following: "Checks if target is one of the given expects.". |
Of course, here is the Java code you requested:
```java
public ServiceFuture<Void> deleteIterationAsync(UUID projectId, UUID iterationId, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(deleteIterationWithServiceResponseAsync(projectId, iterationId), serviceCallback);
}
```... | Create a Java method that does the following: "Deletes an iteration.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public static <T> T asType(Object obj, Class<T> type) {
if (String.class == type) {
return (T) InvokerHelper.toString(obj);
}
// fall back to cast
try {
return (T) Default... | Create a Java method that does the following: "Casts an object to a type.". |
Of course, here is the Java code you requested:
```java
private static long initMemoryLimit(final ResultOutput resultOutput)
{
// default setting
long memoryLimit = SessionUtil.DEFAULT_CLIENT_MEMORY_LIMIT * 1024 * 1024;
if (resultOutput.parameters.get(CLIENT_MEMORY_LIMIT) != null)
{
// use the ... | Create a Java method that does the following: "Initialize the memory limit.". |
Of course, here is the Java code you requested:
```java
public static AzimuthZenithAngle calculateSolarPosition(final GregorianCalendar date, final double latitude,
final double longitude, final double elevation, final double deltaT) {
return calculat... | Create a Java method that does the following: "Calculate the solar position.". |
Of course, here is the Java code you requested:
```java
public static double[] shiftReactionVertical(IReaction reaction, double[] bounds, double[] last, double gap) {
assert bounds.length == 4;
assert last.length == 4;
final double boundsMinX = bounds[0];
final double boundsMinY = boun... | Create a Java method that does the following: "Shift the reaction vertically.". |
Of course, here is the Java code you requested:
```java
@Override
public User createUser(String username, String password)
throws AuthenticationException {
String user = file_store.getProperty(username);
if (user != null) {
throw new AuthenticationException("User '" + userna... | Create a Java method that does the following: "Create a user in the system.". |
Of course, here is the Java code you requested:
```java
@Nonnull
public static <T1, T2> LObjIntObjPredicate<T1, T2> objIntObjPredicateFrom(Consumer<LObjIntObjPredicateBuilder<T1, T2>> buildingFunction) {
LObjIntObjPredicateBuilder builder = new LObjIntObjPredicateBuilder();
buildingFunction.accept(builder);
ret... | Create a Java method that does the following: "Create an objIntObjPredicate from a consumer.". |
Of course, here is the Java code you requested:
```java
public Evse createEvse(Long chargingStationTypeId, Evse evse) throws ResourceAlreadyExistsException {
ChargingStationType chargingStationType = chargingStationTypeRepository.findOne(chargingStationTypeId);
if (getEvseByIdentifier(chargingStationT... | Create a Java method that does the following: "Creates a new Evse in the charging station type.". |
Of course, here is the Java code you requested:
```java
public Observable<Page<MediaServiceInner>> listByResourceGroupAsync(String resourceGroupName) {
return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1<ServiceResponse<List<MediaServiceInner>>, Page<MediaServiceInner>>() {
... | Create a Java method that does the following: "Gets a list of media services.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("checkstyle:magicnumber")
private void writeDBFDate(Date date) throws IOException {
final SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); //$NON-NLS-1$
writeDBFString(format.format(date), 8, (byte) ' ');
}
```
Hope this helps! | Create a Java method that does the following: "Write the given date to the file in DBF format.". |
Of course, here is the Java code you requested:
```java
public static String getConcreteBeanClassName(EnterpriseBean enterpriseBean)
{
String beanClassName = enterpriseBean.getEjbClassName();
String packageName = packageName(beanClassName);
String beanName = encodeBeanInterfacesName(enterpr... | Create a Java method that does the following: "Get the concrete bean class name.". |
Of course, here is the Java code you requested:
```java
public Map<Long, Map<String, ClientStats>> getCompleteStats() {
Map<Long, Map<String, ClientStats>> retval =
new TreeMap<Long, Map<String, ClientStats>>();
for (Entry<Long, Map<String, ClientStats>> e : m_current.entrySet()) {
... | Create a Java method that does the following: "Get the complete stats of the session.". |
Of course, here is the Java code you requested:
```java
public Observable<RecommendationRuleInner> getRuleDetailsByWebAppAsync(String resourceGroupName, String siteName, String name) {
return getRuleDetailsByWebAppWithServiceResponseAsync(resourceGroupName, siteName, name).map(new Func1<ServiceResponse<Recomme... | Create a Java method that does the following: "Get the details of a CDN Recommendation rule.". |
Of course, here is the Java code you requested:
```java
public final boolean errorsSince(Checkpoint checkpoint) {
Checkpoint impl = checkpoint;
if (impl.owner != this) {
throw new IllegalArgumentException(
"Can only call errorsSince on a Checkpoint instance that was returned from this same "
... | Create a Java method that does the following: "Returns true if the number of errors were returned since the given checkpoint.". |
Of course, here is the Java code you requested:
```java
public com.squareup.okhttp.Call getFleetsFleetIdWingsAsync(Long fleetId, String acceptLanguage, String datasource,
String ifNoneMatch, String language, String token, final ApiCallback<List<FleetWingsResponse>> callback)
throws ApiException... | Create a Java method that does the following: "Get CDN records Get CDN records". |
Of course, here is the Java code you requested:
```java
final int calcLevels(long length) {
// The calculation is essentially a math log operation, but the table
// lookup is faster.
int index = Arrays.binarySearch(mLevelMaxSizes, length);
return (index < 0) ? ~index : index;
}
```
... | Create a Java method that does the following: "Calculate the levels of a given length.". |
Of course, here is the Java code you requested:
```java
public void writePadBlocks(int blockCount) throws IOException {
for (int i = 0; i < blockCount; i++) {
write(ZERO_BLOCK, ZERO_BLOCK.length);
}
}
```
Hope this helps! | Create a Java method that does the following: "Write pad blocks.". |
Of course, here is the Java code you requested:
```java
public static final void getXMLMethodsDenied(boolean[] denyAll,
int type,
String[] methodNames,
Class<?>[][] methodP... | Create a Java method that does the following: "This method is called by the EJB container server to determine if a method is denied by the application.". |
Of course, here is the Java code you requested:
```java
public String rewriteRefresh(String input, String requestUrl, String baseUrl, String visibleBaseUrl) {
// Header has the following format
// Refresh: 5; url=http://www.w3.org/pub/WWW/People.html
int urlPosition = input.indexOf("url=");
... | Create a Java method that does the following: "Rewrite the URL in the input string to include the refresh header.". |
Of course, here is the Java code you requested:
```java
public Response rename(String bucket, String oldFileKey, String newFileKey, boolean force)
throws QiniuException {
return move(bucket, oldFileKey, bucket, newFileKey, force);
}
```
Hope this helps! | Create a Java method that does the following: "Move a file from one bucket to another.". |
Of course, here is the Java code you requested:
```java
public int getPort()
{
if (port != 0) {
return port;
}
else {
final Connector connector = connectorHolder.get();
if (connector != null) {
Preconditions.checkState(connector.getLocalPo... | Create a Java method that does the following: "Gets the port.". |
Of course, here is the Java code you requested:
```java
public void reset() {
targetFile = null;
title = null;
defaultTitle = null;
inTitleElement = false;
termStack.clear();
topicIdStack.clear();
indexTermSpecList.clear();
indexSeeSpecList.clear();
... | Create a Java method that does the following: "Resets the internal state of this object.". |
Of course, here is the Java code you requested:
```java
public static final int getW(Element e) {
int ret = e.getOffsetWidth();
ret -= MiscUtils.getComputedStyleInt(e, "paddingLeft");
ret -= MiscUtils.getComputedStyleInt(e, "paddingRight");
ret -= MiscUtils.getComputedStyleInt(e, "borde... | Create a Java method that does the following: "Get the width of the element.". |
Of course, here is the Java code you requested:
```java
@Override
public int getLastOrderNumber(NodeData parent) throws RepositoryException
{
if (!containerConfig.useSequenceForOrderNumber)
{
return super.getLastOrderNumber(parent);
}
return getLastOrderNumber();
}
```
Hope t... | Create a Java method that does the following: "Get last order number of the node". |
Of course, here is the Java code you requested:
```java
private static String resolvePrincipal(Session session) {
String principalName = session
.getAttribute(FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME);
if (principalName != null) {
return principalName;
}
SecurityContext securityContext... | Create a Java method that does the following: "Resolve the principal name from the session.". |
Of course, here is the Java code you requested:
```java
public static Map<String, String> queryStringToMap(String queryString) {
Map<String, String> result = new HashMap<String, String>();
if ((queryString != null) && (queryString.length() > 0)) {
for (String param : queryString.split(PARA... | Create a Java method that does the following: "Converts a query string to a map of parameters and values.". |
Of course, here is the Java code you requested:
```java
@Override
public final int readArrayB(DeMember member, byte[] typevals, Decodeable componentDecoder) {
if (member == null || componentDecoder == null) return Reader.SIGN_NOLENBUTBYTES;
Type type = componentDecoder.getType();
if (!(... | Create a Java method that does the following: "Reads an array of bytes from an ASCII array.". |
Of course, here is the Java code you requested:
```java
public static <V, T> MutableMap<V, BigInteger> sumByBigInteger(Iterable<T> iterable, Function<T, V> groupBy, Function<? super T, BigInteger> function)
{
if (iterable instanceof List)
{
return ListIterate.sumByBigInteger((List<T>) i... | Create a Java method that does the following: "Returns a map containing the results of applying the specified function to each element of the specified iterable using the specified groupBy function.". |
Of course, here is the Java code you requested:
```java
public List <AddOn> getUpdatedAddOns(AddOnCollection aoc) {
List<AddOn> updatedAddOns = new ArrayList<>();
for (AddOn ao : aoc.getAddOns()) {
for (AddOn addOn : addOns) {
try {
if (ao.isSameAddOn(addOn) && ao.isUpdateTo... | Create a Java method that does the following: "Gets the updated add - ons from the given add - on collection.". |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.