code stringlengths 146 48.7k | prompt stringlengths 55 1.51k |
|---|---|
Of course, here is the Java code you requested:
```java
private double goldenMean(double a, double b) {
if (geometric) {
return a * Math.pow(b / a, GOLDEN_SECTION);
} else {
return a + (b - a) * GOLDEN_SECTION;
}
}
```
Hope this helps! | Create a Java method that does the following: "Golden mean for a and b". |
Of course, here is the Java code you requested:
```java
@Nullable
private ServerHolder assignPrimary(
final DruidCoordinatorRuntimeParams params,
final DataSegment segment
)
{
ServerHolder topCandidate = null;
for (final Object2IntMap.Entry<String> entry : targetReplicants.object2IntEntrySet(... | Create a Java method that does the following: "Assign primary to the segment.". |
Of course, here is the Java code you requested:
```java
@Override
public void register( YogaEntityConfiguration<?>... entityConfigurations )
{
for ( YogaEntityConfiguration<?> entityConfiguration : entityConfigurations )
{
Class<?> type = entityConfiguration.getEntityClass();
... | Create a Java method that does the following: "Register a set of entity configurations.". |
Of course, here is the Java code you requested:
```java
@Override
public Set<byte[]> ssKeys(byte[] key) {
try {
if (isPipelined()) {
pipeline(new JedisResult(pipeline.sskeys(key)));
return null;
}
return this.client.sskeys(key);
}... | Create a Java method that does the following: "Get a set of all the SSS keys for a given key.". |
Of course, here is the Java code you requested:
```java
public void sessionDidActivate(SipSessionEvent event) {
logger.info("Following sip session just activated " + event.getSession().getId() + " cause " + ((SipSessionActivationEvent)event).getCause());
if(((SipSessionActivationEvent)event).getCause() == SessionA... | Create a Java method that does the following: "This method is called when a sip session is activated.". |
Of course, here is the Java code you requested:
```java
@Override public T get() throws IOException, EtcdException, EtcdAuthenticationException, TimeoutException {
waitForPromiseSuccess();
if (response != null) {
return response;
} else {
if (this.exception instanceof EtcdException) {
... | Create a Java method that does the following: "Get the response from the server.". |
Of course, here is the Java code you requested:
```java
private QueryMethodCache generateQueryByPKMethod(Class<?> mapperClass,Class<?> entityClass){
QueryMethodCache methodCache = null;
Field[] fields = entityClass.getDeclaredFields();
//主键key前缀
for (Field field : fields) {
if(field.isAnnotationPresent... | Create a Java method that does the following: "Generate query by PK method cache.". |
Of course, here is the Java code you requested:
```java
public Set<String> getKeyList() throws IOException {
if (!closed) {
close();
}
return new HashSet<>(Arrays.asList(keyList));
}
```
Hope this helps! | Create a Java method that does the following: "Get the key list.". |
Of course, here is the Java code you requested:
```java
public static String getSREsAsXML(IProgressMonitor monitor) throws CoreException {
initializeSREs();
try {
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
final DocumentBuilder builder = factory.newDocumentBuilder();
fina... | Create a Java method that does the following: "Get the SREs as XML.". |
Of course, here is the Java code you requested:
```java
@Override
@Nonnull
public String getLabel() {
ASTVisitor labelFixingVisitor = getCustomLabelVisitor();
if (labelFixingVisitor instanceof CustomLabelVisitor) {
if (customizedLabel == null) {
String labelReplaceme... | Create a Java method that does the following: "Get the label of the class.". |
Of course, here is the Java code you requested:
```java
public void decrypt(KeyParameter aesKey) {
checkNotNull(aesKey);
BasicKeyChain newBasic = basic.toDecrypted(aesKey);
if (chains != null) {
List<DeterministicKeyChain> newChains = new ArrayList<>(chains.size());
for... | Create a Java method that does the following: "Decrypt the message using the specified AES key.". |
Of course, here is the Java code you requested:
```java
public EClass getIfcFlowTreatmentDeviceType() {
if (ifcFlowTreatmentDeviceTypeEClass == null) {
ifcFlowTreatmentDeviceTypeEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(255);
}
return i... | Create a Java method that does the following: "Get the Ifc2x3tc1DeviceType feature from the EPackage. Registry. INSTANCE.". |
Of course, here is the Java code you requested:
```java
public void marshall(GetDomainNamesRequest getDomainNamesRequest, ProtocolMarshaller protocolMarshaller) {
if (getDomainNamesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {... | Create a Java method that does the following: "Creates a protocolMarshaller instance for the given parameter object.". |
Of course, here is the Java code you requested:
```java
public boolean isNotOneOf( Type first,
Type... rest ) {
return isNotOneOf(EnumSet.of(first, rest));
}
```
Hope this helps! | Create a Java method that does the following: "Checks if the type is one of the types in the set.". |
Of course, here is the Java code you requested:
```java
@Nullable
public static <T> T assertNull(@Nullable final T object) {
return assertNull(null, object);
}
```
Hope this helps! | Create a Java method that does the following: "Assert that the given object is null.". |
Of course, here is the Java code you requested:
```java
public BeanComparator<T> orderBy(String propertyName)
throws IllegalArgumentException
{
int dot = propertyName.indexOf('.');
String subName;
if (dot < 0) {
subName = null;
} else {
subName = prop... | Create a Java method that does the following: "Returns a BeanComparator that orders the specified property name using the default order - by algorithm.". |
Of course, here is the Java code you requested:
```java
public static <N> TopLevelDocument<N> TopLevelDocument(final N type,
final URI identity,
final NamedProperties<N> properties) {
return TopLevelDo... | Create a Java method that does the following: "Create a new TopLevelDocument.". |
Of course, here is the Java code you requested:
```java
private void updateState(CmsDbContext dbc, CmsResource resource, boolean resourceState)
throws CmsDataAccessException {
CmsUUID projectId = ((dbc.getProjectId() == null) || dbc.getProjectId().isNullUUID())
? dbc.currentProject().getUuid()
... | Create a Java method that does the following: "Updates the resource state.". |
Of course, here is the Java code you requested:
```java
public FloatBuffer getFloatVec(String attributeName)
{
int size = getAttributeSize(attributeName);
if (size <= 0)
{
return null;
}
size *= 4 * getVertexCount();
ByteBuffer buffer = ByteBuffer.allocat... | Create a Java method that does the following: "Gets a float vector from the attribute.". |
Of course, here is the Java code you requested:
```java
public static base_response update(nitro_service client, lbsipparameters resource) throws Exception {
lbsipparameters updateresource = new lbsipparameters();
updateresource.rnatsrcport = resource.rnatsrcport;
updateresource.rnatdstport = resource.rnatdstpor... | Create a Java method that does the following: "Use this API to update lbsipparameters.". |
Of course, here is the Java code you requested:
```java
public static synchronized void putChannel(WonderPushChannel channel) {
try {
if (_putChannel(channel)) {
save();
}
} catch (Exception ex) {
Log.e(WonderPush.TAG, "Unexpected error while putting ... | Create a Java method that does the following: "Put a WonderPush channel into the cache.". |
Of course, here is the Java code you requested:
```java
public static int getLCM(int... arg) throws Exception {
if (arg == null || arg.length == 0) {
throw new Exception("parameters must more than one.");
}
if (arg.length == 1)
return arg[0];
int tmp = lcm(arg[0... | Create a Java method that does the following: "This method is a utility method that returns the LCM value of the specified integer array.". |
Of course, here is the Java code you requested:
```java
public void capture()
{
// Get the class of the object to build a memento for.
Class cls = ob.getClass();
// Iterate through the classes whole inheritence chain.
while (!cls.equals(Object.class))
{
// Get t... | Create a Java method that does the following: "Capture the object.". |
Of course, here is the Java code you requested:
```java
public void removeBlockMeta(BlockMeta blockMeta) throws BlockDoesNotExistException {
Preconditions.checkNotNull(blockMeta, "blockMeta");
long blockId = blockMeta.getBlockId();
BlockMeta deletedBlockMeta = mBlockIdToBlockMap.remove(blockId);
if (de... | Create a Java method that does the following: "Removes the block meta from the block store.". |
Of course, here is the Java code you requested:
```java
public List<AdministeredObjectType<WebFragmentDescriptor>> getAllAdministeredObject()
{
List<AdministeredObjectType<WebFragmentDescriptor>> list = new ArrayList<AdministeredObjectType<WebFragmentDescriptor>>();
List<Node> nodeList = model.get("admi... | Create a Java method that does the following: "Get all administrated - object.". |
Of course, here is the Java code you requested:
```java
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// storing string resources into Array
String[] pages = getResources().getStringArray(R.array.pages);
// Binding resources Array ... | Create a Java method that does the following: "Override onCreate to create the base activity". |
Of course, here is the Java code you requested:
```java
private long firstDayOfMonth(
int cycle,
int yearOfCycle,
EastAsianMonth month
) {
long newYear = this.newYear(cycle, yearOfCycle);
long approxStartOfMonth = this.newMoonOnOrAfter(newYear + (month.getNumber() - 1) * 29)... | Create a Java method that does the following: "Get the first day of month of the East Asian calendar.". |
Of course, here is the Java code you requested:
```java
public PutNotificationConfigurationRequest withNotificationTypes(String... notificationTypes) {
if (this.notificationTypes == null) {
setNotificationTypes(new com.amazonaws.internal.SdkInternalList<String>(notificationTypes.length));
}... | Create a Java method that does the following: "Sets the notificationTypes value for the application.". |
Of course, here is the Java code you requested:
```java
public JCRPath parseJCRPath(String path) throws RepositoryException
{
if (isAbsPathParseable(path))
{
return parseAbsPath(path);
}
else
{
return parseRelPath(path);
}
}
```
Hope this helps! | Create a Java method that does the following: "Parse JCR path.". |
Of course, here is the Java code you requested:
```java
public void setLeft(Keyword newLeft) {
if (newLeft != left) {
NotificationChain msgs = null;
if (left != null)
msgs = ((InternalEObject)left).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XtextPackage.CHARACTER_RANGE__LEFT, null, msgs);
if (newLeft... | Create a Java method that does the following: "Sets the left keyword.". |
Of course, here is the Java code you requested:
```java
public SignatureRequestList getSignatureRequests() throws HelloSignException {
return new SignatureRequestList(httpClient.withAuth(auth).get(BASE_URI + SIGNATURE_REQUEST_LIST_URI).asJson());
}
```
Hope this helps! | Create a Java method that does the following: "Gets the list of signature requests.". |
Of course, here is the Java code you requested:
```java
private static void parseTarget(ArrayList<Shape> shapes,
JSONObject modelJSON,
Shape current) throws JSONException {
if (modelJSON.has("target")) {
JSONObject targetObject... | Create a Java method that does the following: "Parse the target.". |
Of course, here is the Java code you requested:
```java
@Override
protected void initialize() throws ServletException {
/*
* The servlet defines any number of resource providers, and
* configures itself to use them by calling
* setResourceProviders()
*/
List<IResourceProvider... | Create a Java method that does the following: "Initializes the servlet.". |
Of course, here is the Java code you requested:
```java
private static InputStreamWithMetadata compressStreamWithGZIPNoDigest(
InputStream inputStream) throws SnowflakeSQLException
{
try
{
FileBackedOutputStream tempStream =
new FileBackedOutputStream(MAX_BUFFER_SIZE, true);
Coun... | Create a Java method that does the following: "Compress an input stream with a GZIP no digest stream.". |
Of course, here is the Java code you requested:
```java
public boolean isUserExport(String userName) {
if (CmsStringUtil.isEmptyOrWhitespaceOnly(userName)) {
return false;
}
return m_userExport.equals(userName);
}
```
Hope this helps! | Create a Java method that does the following: "Checks if the user name is the export user name.". |
Of course, here is the Java code you requested:
```java
public Observable<ServiceResponse<Page<SiteInner>>> beginResumeNextWithServiceResponseAsync(final String nextPageLink) {
return beginResumeNextSinglePageAsync(nextPageLink)
.concatMap(new Func1<ServiceResponse<Page<SiteInner>>, Observable<Serv... | Create a Java method that does the following: "A generic operation that starts a resume operation.". |
Of course, here is the Java code you requested:
```java
public static Iterable<Range> getRangesToRollup(Granularity g, final long startMillis,
final long stopMillis) throws GranularityException {
final long snappedStartMillis = g.coarser().snapMillis(startMil... | Create a Java method that does the following: "Gets the ranges to rollup.". |
Of course, here is the Java code you requested:
```java
private void showErrorPage(HttpServletResponse resp, String message) throws IOException {
resp.setStatus(HttpServletResponse.SC_OK);
resp.setContentType(GUIServletStub.CONTENT_TYPE_HTML);
PrintWriter writer = resp.getWriter();
writer
.println(... | Create a Java method that does the following: "Show the error page". |
Of course, here is the Java code you requested:
```java
public List<RowCell> getCells(@Nonnull String family, @Nonnull String qualifier) {
Preconditions.checkNotNull(family, "family");
Preconditions.checkNotNull(qualifier, "qualifier");
return getCells(family, ByteString.copyFromUtf8(qualifier));
}
```
... | Create a Java method that does the following: "Returns a list of cell objects for the specified cell family and qualifier.". |
Of course, here is the Java code you requested:
```java
public GetFolderResult withSubModules(SubModule... subModules) {
if (this.subModules == null) {
setSubModules(new java.util.ArrayList<SubModule>(subModules.length));
}
for (SubModule ele : subModules) {
this.subModu... | Create a Java method that does the following: "A list of sub - modules.". |
Of course, here is the Java code you requested:
```java
public static void main(final String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
final BenchmarkResult res = runBenchs(args);
new TabularSummaryOutput().visitBenchmark(res);
}
```
Hope this helps! | Create a Java method that does the following: "Main method for the test.". |
Of course, here is the Java code you requested:
```java
private void merge(final GeometryFunction callback) {
GeometryOperationService operationService = new GeometryOperationServiceImpl();
UnionInfo unionInfo = new UnionInfo();
unionInfo.setUsePrecisionAsBuffer(true);
unionInfo.setPrecision(precision);
oper... | Create a Java method that does the following: "Merge the geometries into a single Geometry.". |
Of course, here is the Java code you requested:
```java
public static PropertyDescriptor[] getPropertyDescriptors(Class<?> beanClass) {
if (beanClass == null) {
throw new IllegalArgumentException("No bean class specified");
}
// Look up any cached descriptors for this bean class
PropertyDescriptor descrip... | Create a Java method that does the following: "Gets the property descriptors for the specified bean class.". |
Of course, here is the Java code you requested:
```java
public String convertIfcDocumentStatusEnumToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
}
```
Hope this helps! | Create a Java method that does the following: "This method is called to convert an convertIfcDocumentStatus enumeration to a String.". |
Of course, here is the Java code you requested:
```java
public void addPSXObject(PdfPSXObject psobject) {
checkWriter();
PdfName name = writer.addDirectTemplateSimple(psobject, null);
PageResources prs = getPageResources();
name = prs.addXObject(name, psobject.getIndirectReference());
... | Create a Java method that does the following: "Adds a psxobject to the page.". |
Of course, here is the Java code you requested:
```java
public void addScatterPlot(String scatterID, String xAxisLabel, String yAxisLabel) throws ShanksException {
if (!this.timeCharts.containsKey(scatterID)) {
ScatterPlotGenerator scatter = new ScatterPlotGenerator();
scatter.setTit... | Create a Java method that does the following: "Adds a ScatterPlot to the time chart.". |
Of course, here is the Java code you requested:
```java
public long pause(int msgs) throws InterruptedException {
if (msgs == 1) {
return 0;
}
// TODO: this is purely instantaneous rate; maybe we
// should also offer decayed recent history one?
final long targetNS =... | Create a Java method that does the following: "Pause the specified number of messages.". |
Of course, here is the Java code you requested:
```java
@VisibleForTesting
synchronized Bucket<V> getBucket(int bucketedSize) {
// get an existing bucket
Bucket<V> bucket = mBuckets.get(bucketedSize);
if (bucket != null || !mAllowNewBuckets) {
return bucket;
}
// create a new bucket
if... | Create a Java method that does the following: "Get the bucket for the given size.". |
Of course, here is the Java code you requested:
```java
public DateTime toDateTime(DateTimeZone zone) {
Chronology chrono = DateTimeUtils.getChronology(getChronology());
chrono = chrono.withZone(zone);
return new DateTime(getMillis(), chrono);
}
```
Hope this helps! | Create a Java method that does the following: "Converts this object to a DateTime object with the specified time zone.". |
Of course, here is the Java code you requested:
```java
protected boolean isPackableWith(Object value, int choose) {
if (value == null) {
return false;
}
if (choose == CHOOSE_EXTENSION) {
if (value.equals(getDefaultFileExtension())) {
return true;
... | Create a Java method that does the following: "Checks if the given value is packable with the given choose.". |
Of course, here is the Java code you requested:
```java
public <C extends Collection<V>> Map<K, C> groupingTo(Supplier<C> collectionFactory) {
return grouping(Collectors.toCollection(collectionFactory));
}
```
Hope this helps! | Create a Java method that does the following: "Creates a map of the type IDENTITY_TYPE pairs grouped by the key and the value of the first key in the map.". |
Of course, here is the Java code you requested:
```java
public Future startInitialLoad(MapStoreContext mapStoreContext, int partitionId) {
this.partitionId = partitionId;
this.mapNamePartition = partitionService.getPartitionId(toData.apply(mapName));
Role newRole = calculateRole();
rol... | Create a Java method that does the following: "Start the initial load of the map.". |
Of course, here is the Java code you requested:
```java
@Override
public boolean isValid() {
if (!_isValid && com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
//only log this if it is invalid
String s = _isValid + appN... | Create a Java method that does the following: "is the session is valid". |
Of course, here is the Java code you requested:
```java
public final <R> R map(Function3<? super T1, ? super T2, ? super T3, ? extends R> function) {
return function.apply(v1, v2, v3);
}
```
Hope this helps! | Create a Java method that does the following: "Maps this tuple to a single value.". |
Of course, here is the Java code you requested:
```java
@Override
public void doExecute() throws MojoExecutionException, MojoFailureException {
if (!ignoreResultFailures && !scanResultsForFailedRequests) {
getLog().warn(String.format(
"current value of scanResultsForFailedRe... | Create a Java method that does the following: "Execute the C N C N C N N". |
Of course, here is the Java code you requested:
```java
String formatPrimitiveArrayString(String string, String indent) {
StringBuilder sb = new StringBuilder();
indent += INDENT;
// Split the data based on the command white space
String[] data = string.substring(1, string.length() - 2... | Create a Java method that does the following: "Format a string of type array of strings.". |
Of course, here is the Java code you requested:
```java
synchronized void openInfo() throws IOException {
if (src == null && blocks == null) {
throw new IOException("No file provided to open");
}
LocatedBlocks newInfo = src != null ?
getLocatedBlocks(src, 0, prefetchSize... | Create a Java method that does the following: "Open the file info.". |
Of course, here is the Java code you requested:
```java
public Object writeReplace(Object mockitoMock) throws ObjectStreamException {
// reentrant lock for critical section. could it be improved ?
mutex.lock();
try {
// mark started flag // per thread, not per instance
/... | Create a Java method that does the following: "This method is called by the write method to write a single object to the stream.". |
Of course, here is the Java code you requested:
```java
@Override
public LogValue combineBucketsForModification(int pRevisionsToRestore, long pNewBucketKey,
DataBucket[] pBuckets, boolean pFullDump) {
checkArgument(pBuckets.length > 0, "At least one DataBucket must be provided");
// create ... | Create a Java method that does the following: "Combine the buckets for a modification.". |
Of course, here is the Java code you requested:
```java
private static void bindPreferenceSummaryToValue(Preference preference) {
// Set the listener to watch for value changes.
preference.setOnPreferenceChangeListener(sBindPreferenceSummaryToValueListener);
// Trigger the listener immediately... | Create a Java method that does the following: "Binds the given preference s summary value to the corresponding value of the application s session.". |
Of course, here is the Java code you requested:
```java
public List<HelpOption> getOptions() {
final BQRuntime runtime = createRuntime();
final ApplicationMetadata application = runtime.getInstance(ApplicationMetadata.class);
final HelpOptions helpOptions = new HelpOptions();
application.getCommands().forEach... | Create a Java method that does the following: "Returns the help options.". |
Of course, here is the Java code you requested:
```java
@Override
public List<CommerceNotificationAttachment> getCommerceNotificationAttachmentsByUuidAndCompanyId(
String uuid, long companyId) {
return commerceNotificationAttachmentPersistence.findByUuid_C(uuid,
companyId);
}
```
Hope this helps! | Create a Java method that does the following: "Returns the commerce notification attachments matching the UUID and company.". |
Of course, here is the Java code you requested:
```java
@Override
public int putAll(Iterable<? extends KTypeVTypeCursor<? extends KType, ? extends VType>> iterable){
final int count = size();
for (KTypeVTypeCursor<? extends KType, ? extends VType> c : iterable) {
put(c.key, c.value);
}
return s... | Create a Java method that does the following: "Override the putAll method.". |
Of course, here is the Java code you requested:
```java
public String getRefCollectionType(Reference ref) {
String type = ref.getCollectionType();
return (type == null ? "set" : type.toLowerCase());
}
```
Hope this helps! | Create a Java method that does the following: "Get the type of collection.". |
Of course, here is the Java code you requested:
```java
public void init(final Connection connection, final String devname, final String host,
final String port) throws DevFailed {
connection.url = new TangoUrl(buildUrlName(host, port, devname));
connection.devname = connection.url.devname;
connection.setD... | Create a Java method that does the following: "Initialize a connection object.". |
Of course, here is the Java code you requested:
```java
public long getRowCount(final String pTileSourceName, final int pZoom,
final Collection<Rect> pInclude, final Collection<Rect> pExclude) {
return getRowCount(
getWhereClause(pZoom, pInclude, pExclude)
... | Create a Java method that does the following: "Get the number of tiles in the database". |
Of course, here is the Java code you requested:
```java
protected void parseRange(String range) {
String prefix = "bytes=";
if (!range.startsWith(prefix) || StringUtils.containsNone(range, "-")) {
throw new IllegalArgumentException(getUsage(range));
} else {
// Stri... | Create a Java method that does the following: "Parse the given range string and set the start and end values for the
attribute.". |
Of course, here is the Java code you requested:
```java
public Observable<Page<VirtualMachineScaleSetInner>> listNextAsync(final String nextPageLink) {
return listNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<VirtualMachineScaleSetInner>>, Page<VirtualMachineScaleSe... | Create a Java method that does the following: "Gets a list of virtual machine scale sets.". |
Of course, here is the Java code you requested:
```java
public Cursor query(SQLiteDatabase db, String[] projectionIn,
String selection, String[] selectionArgs, String groupBy,
String having, String sortOrder, String limit, CancellationSignal cancellationSignal) {
... | Create a Java method that does the following: "Query for a single entry in the database.". |
Of course, here is the Java code you requested:
```java
private static DateTimeZone fixedOffsetZone(String id, int offset) {
if (offset == 0) {
return DateTimeZone.UTC;
}
return new FixedDateTimeZone(id, null, offset, offset);
}
```
Hope this helps! | Create a Java method that does the following: "FixedOffsetZone This is a convenience method for creating a FixedDateTimeZone.". |
Of course, here is the Java code you requested:
```java
public void marshall(RollbackTrigger rollbackTrigger, ProtocolMarshaller protocolMarshaller) {
if (rollbackTrigger == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
proto... | Create a Java method that does the following: "marshalls the given rollbackTrigger object to the JSON object.". |
Of course, here is the Java code you requested:
```java
public GenericConnectionFactory cloneWith(DataSource datasource)
{
try
{
GenericConnectionFactory factory = (GenericConnectionFactory)this.clone();
factory.dbDataSource = datasource;
return factory;
}
catch (C... | Create a Java method that does the following: "Clone this connection factory with the specified datasource.". |
Of course, here is the Java code you requested:
```java
public static String base64ToString(String base64Value) {
Utils.require(base64Value.length() % 4 == 0,
"Invalid base64 value (must be a multiple of 4 chars): " + base64Value);
byte[] utf8String = DatatypeConverter.parseBas... | Create a Java method that does the following: "Converts a base64 string to a string.". |
Of course, here is the Java code you requested:
```java
public double getTotalDistanceForTrips (Collection<Trip> trips) {
TDoubleList distances = new TDoubleArrayList();
for (Trip trip : trips) {
distances.add(feed.getTripDistance(trip.trip_id, false));
}
return distances.s... | Create a Java method that does the following: "Get the total distance between the trips.". |
Of course, here is the Java code you requested:
```java
private HttpMessage prepareHttpMessage() throws HttpMalformedHeaderException, DatabaseException {
// Build fetch the request message from the database
HttpMessage msg;
try {
msg = reference.getHttpMessage();
// HistoryReference is about to be deleted,... | Create a Java method that does the following: "Prepare the request message.". |
Of course, here is the Java code you requested:
```java
public long getNanos(HazelcastProperty property) {
TimeUnit timeUnit = property.getTimeUnit();
return timeUnit.toNanos(getLong(property));
}
```
Hope this helps! | Create a Java method that does the following: "Gets the nanoseconds of the Hazelcast record.". |
Of course, here is the Java code you requested:
```java
long getValueAtPosition(final int pos) {
if (itemsSeen_ == 0) {
throw new SketchesArgumentException("Requested element from empty reservoir.");
} else if ((pos < 0) || (pos >= getNumSamples())) {
throw new SketchesArgumentException("Requested ... | Create a Java method that does the following: "Gets the value at the specified position.". |
Of course, here is the Java code you requested:
```java
public EClass getIPD() {
if (ipdEClass == null) {
ipdEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(279);
}
return ipdEClass;
}
```
Hope this helps! | Create a Java method that does the following: "Get the IPD.". |
Of course, here is the Java code you requested:
```java
public final String buildAuthority() {
// scheme, [user info], host, [port]
StringBuilder buf = new StringBuilder();
buf.append(Preconditions.checkNotNull(scheme));
buf.append("://");
if (userInfo != null) {
buf.append(CharEscapers.escap... | Create a Java method that does the following: "Build the authority part of the URI.". |
Of course, here is the Java code you requested:
```java
@Override
protected InetAddress isAcceptable(NetworkInterface networkInterface, InetAddress address) throws SocketException {
try {
InetAddress toMatch = getAddress();
// One time only warn against use of wildcard addresses
... | Create a Java method that does the following: "Override to check if an address is acceptable.". |
Of course, here is the Java code you requested:
```java
protected final @Nonnull Result<T> monitorDetailed() throws InterruptedException {
Map<Computer,Future<T>> futures = new HashMap<>();
Set<Computer> skipped = new HashSet<>();
for (Computer c : Jenkins.getInstance().getComputers()) {
... | Create a Java method that does the following: "Monitor the detailed information of all the reports.". |
Of course, here is the Java code you requested:
```java
public boolean createTableIfMissing (Connection conn, String table, List<String> columns,
List<ColumnDefinition> declarations,
List<String> primaryKeyColumns) throws SQLException {
... | Create a Java method that does the following: "Create a table if missing.". |
Of course, here is the Java code you requested:
```java
public void configure(long newWriteLimit, long newReadLimit) {
writeLimit = newWriteLimit;
readLimit = newReadLimit;
if (trafficCounter != null) {
trafficCounter.resetAccounting(TrafficCounter.milliSecondFromNano());
}
... | Create a Java method that does the following: "Sets the write and read limits for this class.". |
Of course, here is the Java code you requested:
```java
@VisibleForTesting
void panic(final Throwable t) {
if (panicMode) {
// Preserve the first panic information
return;
}
panicMode = true;
cancelIdleTimer(/* permanent= */ true);
shutdownNameResolverAndLoadBalancer(false);
final... | Create a Java method that does the following: "Called by the channel manager to handle a fatal exception.". |
Of course, here is the Java code you requested:
```java
protected void initializeBuildPath(IJavaProject javaProject, IProgressMonitor monitor) throws CoreException {
IProgressMonitor theMonitor = monitor;
if (theMonitor == null) {
theMonitor = new NullProgressMonitor();
}
theMonitor.beginTask(NewWizardMessa... | Create a Java method that does the following: "Initialize the build path.". |
Of course, here is the Java code you requested:
```java
public void marshall(ListActionTypesRequest listActionTypesRequest, ProtocolMarshaller protocolMarshaller) {
if (listActionTypesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
tr... | Create a Java method that does the following: "marshalls the given request to the JSON object.". |
Of course, here is the Java code you requested:
```java
<T> T _deserialize(String body, Class<T> clazz) {
if(body == null || body.isEmpty()){
throw new ServiceException(ErrorCode.REMOTE_DIRECTORY_SERVER_ERROR,
ErrorCode.REMOTE_DIRECTORY_SERVER_ERROR.getMessageTemplate(),
... | Create a Java method that does the following: "Deserialize a message from a string.". |
Of course, here is the Java code you requested:
```java
String resolveMember(
ClassFile cf, String startClassName, String findName, String findDesc,
boolean resolveMethod, boolean checkStartClass)
throws ConstantPoolException {
ClassFile startClass;
if (cf.getName()... | Create a Java method that does the following: "Resolves a member of a class.". |
Of course, here is the Java code you requested:
```java
public Object getScalarObject(String memberName) {
StructureMembers.Member m = members.findMember(memberName);
if (m == null)
throw new IllegalArgumentException("illegal member name =" + memberName);
return getScalarObject(m);
}
```
Hope this... | Create a Java method that does the following: "Get the scalar object for the specified member name.". |
Of course, here is the Java code you requested:
```java
public static Map<String, String> readPhoneRegionCodes(final String pphoneCountryCode,
final Locale plocale) {
return CreateClassHelper.readMapFromProperties(
"PhoneRegionCode" + pphoneCountryCode + "Constants", plocale,
"phoneRegionCode... | Create a Java method that does the following: "read phone region codes.". |
Of course, here is the Java code you requested:
```java
void calcFollowPos(RBBINode n) {
if (n == null ||
n.fType == RBBINode.leafChar ||
n.fType == RBBINode.endMark) {
return;
}
calcFollowPos(n.fLeftChild);
calcFollowPos(n.fRigh... | Create a Java method that does the following: "Calculate follow pos of a node.". |
Of course, here is the Java code you requested:
```java
static Iterator<MutableLongTuple> mooreNeighborhoodIterator(
LongTuple center, int radius,
LongTuple min, LongTuple max,
Order order)
{
if (min != null)
{
Utils.checkForEqualSize(center, max);
... | Create a Java method that does the following: "Returns an iterator over the neighborhoods of the given region of data.". |
Of course, here is the Java code you requested:
```java
@Override
public DeleteParameterResult deleteParameter(DeleteParameterRequest request) {
request = beforeClientExecution(request);
return executeDeleteParameter(request);
}
```
Hope this helps! | Create a Java method that does the following: "Deletes an existing CA parameter.". |
Of course, here is the Java code you requested:
```java
private String parseQName() {
String qName = parseNCName(); // can be prefix or localPartName
if (is(TokenType.COLON, false)) {
qName += ":";
qName += parseNCName(); // is localPartName
}
return qName;
... | Create a Java method that does the following: "Parse a QName.". |
Of course, here is the Java code you requested:
```java
public static Long asLong(String expression, Node node)
throws XPathExpressionException {
return asLong(expression, node, xpath());
}
```
Hope this helps! | Create a Java method that does the following: "Returns the Long value of the result set of an XPath expression.". |
Of course, here is the Java code you requested:
```java
public IconProviderBuilder withSide(EnumFacing side, String iconName)
{
return withSide(side, icon(iconName));
}
```
Hope this helps! | Create a Java method that does the following: "Add an icon to the icon provider.". |
Of course, here is the Java code you requested:
```java
public HttpContent getHttpContent() {
HttpContent httpContent = this.blockingEntityCollector.getHttpContent();
this.contentObservable.notifyGetListener(httpContent);
return httpContent;
}
```
Hope this helps! | Create a Java method that does the following: "Get the HttpContent from the blocking entity collector.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public static <OLD, NEW, EV> DataSet<Edge<NEW, EV>> translateEdgeIds(DataSet<Edge<OLD, EV>> edges, TranslateFunction<OLD, NEW> translator, int parallelism) {
Preconditions.checkNotNull(edges);
Preconditions.checkNotNull(transla... | Create a Java method that does the following: "Translate edge IDs.". |
Of course, here is the Java code you requested:
```java
public SQLWarning getWarnings() throws SQLException {
if (warningsCleared || isClosed() || !protocol.hasWarnings()) {
return null;
}
SQLWarning last = null;
SQLWarning first = null;
try (Statement st = this.createStatement()) {
t... | Create a Java method that does the following: "Get the warnings from the database.". |
Of course, here is the Java code you requested:
```java
public synchronized void start(StartContext context) throws StartException {
// FIXME: kakonyii
// if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
// Set the MBeanServer
final MBeanServer mbeanServer = this.mbeanServer.getOp... | Create a Java method that does the following: "Start the application.". |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.