code stringlengths 160 48.7k | prompt stringlengths 55 1.51k |
|---|---|
Of course, here is the Java code you requested:
```java
public float nextRatio ()
{
float u, v, x, xx;
do
{
// u and v are two uniformly-distributed random values
// in [0, 1), and u != 0.
while ((u = GENERATOR.nextFloat ()) == 0)
{
// try again if 0
}
v = GEN... | Create a Java method that does the following: "Returns the next ratio of the point s coordinates.". |
Of course, here is the Java code you requested:
```java
public static void assertXpathsEqual(String controlXpath,
Document controlDocument,
String testXpath,
Document testDocument)
throws ... | Create a Java method that does the following: "Assert that two Xpaths are equal.". |
Of course, here is the Java code you requested:
```java
public static void copy(InputStream is, File file) throws IOException {
Asserts.notNullParameter("is", is);
Asserts.notNullParameter("file", file);
FileOutputStream os = null;
os = new FileOutputStream(file);
copy(is, os);
}
```
Hope this helps! | Create a Java method that does the following: "Copy the contents of the given input stream to the given file.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings ("unchecked")
@Nonnull
public <SBT extends T> TriggerBuilder <SBT> withSchedule (final IScheduleBuilder <SBT> schedBuilder)
{
m_aScheduleBuilder = schedBuilder;
return (TriggerBuilder <SBT>) this;
}
```
Hope this helps! | Create a Java method that does the following: "Set the schedule builder.". |
Of course, here is the Java code you requested:
```java
public static Marshaller marshaller(Class<?> clazz) {
Marshaller m = createMarshallerForClass(clazz);
setPropertySafely(m, JAXB_FORMATTED_OUTPUT, true);
setPropertySafely(m, JAXB_ENCODING, StandardCharsets.UTF_8.toString());
return... | Create a Java method that does the following: "Create a JAXB marshaller for the given class.". |
Of course, here is the Java code you requested:
```java
@Override
public void processReport(File report, final Map<String, CoverageMeasures> coverageData)
throws XMLStreamException {
LOG.debug("Parsing 'Visual Studio' format");
StaxParser parser = new StaxParser((SMHierarchicCursor rootCursor) -> {
... | Create a Java method that does the following: "Process a single XML file containing a DOT file.". |
Of course, here is the Java code you requested:
```java
public static String getInfoServer(
InetSocketAddress namenode, Configuration conf, boolean isAvatar) {
String httpAddressDefault =
NetUtils.getServerAddress(conf, "dfs.info.bindAddress",
"dfs.info.port", "dfs... | Create a Java method that does the following: "Get the HTTP server address from the given InetSocketAddress.". |
Of course, here is the Java code you requested:
```java
public EClass getIfcElectricChargeMeasure() {
if (ifcElectricChargeMeasureEClass == null) {
ifcElectricChargeMeasureEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(670);
}
return ifcElec... | Create a Java method that does the following: "Get the IfcElectricChargeMeasure object for the interface.". |
Of course, here is the Java code you requested:
```java
private SortedMap<String, SortedSet<ITestNGMethod>> sortGroups(Map<String, Collection<ITestNGMethod>> groups)
{
SortedMap<String, SortedSet<ITestNGMethod>> sortedGroups = new TreeMap<String, SortedSet<ITestNGMethod>>();
for (Map.Entry<String, ... | Create a Java method that does the following: "Sort the groups.". |
Of course, here is the Java code you requested:
```java
private void initBase(double[] lowerBound, double[] upperBound, boolean extendBound) {
base = new Base(lowerBound, upperBound, extendBound);
backupBase = base;
baseGrid = new BaseGrid(base);
}
```
Hope this helps! | Create a Java method that does the following: "Initialize the base.". |
Of course, here is the Java code you requested:
```java
private void removeLayoutParamsRule(RelativeLayout.LayoutParams layoutParams) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
layoutParams.removeRule(RelativeLayout.ALIGN_PARENT_RIGHT);
layoutParams.removeRule(... | Create a Java method that does the following: "Remove the rule for RelativeLayout. LayoutParams.". |
Of course, here is the Java code you requested:
```java
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public static boolean hasCameraFeatureAtLeastOne(Context context) {
return hasCameraFeatureAtLeastOne(context.getPackageManager());
}
```
Hope this helps! | Create a Java method that does the following: "Checks if the application has a camera feature at least one.". |
Of course, here is the Java code you requested:
```java
static ResourcePath create(DatabaseRootName databaseName, ImmutableList<String> segments) {
return new AutoValue_ResourcePath(segments, databaseName);
}
```
Hope this helps! | Create a Java method that does the following: "Create a new resource path.". |
Of course, here is the Java code you requested:
```java
public static long ticksWithYearSetTo(long ticks, int year)
{
int oldYear = ticksToYears(ticks);
return ticks - millisToYearStart(oldYear) + millisToYearStart(year);
}
```
Hope this helps! | Create a Java method that does the following: "Gets the ticks with year set to.". |
Of course, here is the Java code you requested:
```java
public void marshall(ExecutionFailedEventDetails executionFailedEventDetails, ProtocolMarshaller protocolMarshaller) {
if (executionFailedEventDetails == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
... | Create a Java method that does the following: "marshalls the ExecutionFailedEventDetails to the JSON object.". |
Of course, here is the Java code you requested:
```java
public void setupKeys()
{
KeyAreaInfo keyArea = null;
keyArea = new KeyAreaInfo(this, Constants.UNIQUE, ID_KEY);
keyArea.addKeyField(ID, Constants.ASCENDING);
keyArea = new KeyAreaInfo(this, Constants.NOT_UNIQUE, START_DATE_TIM... | Create a Java method that does the following: "Setup the key areas.". |
Of course, here is the Java code you requested:
```java
protected String rtrim(String s)
{
if (s == null || s.length() == 0)
{
return s;
}
int pos = s.length();
while (pos > 0 && Character.isWhitespace(s.charAt(pos - 1)))
{
--pos;
}
... | Create a Java method that does the following: "Trims a string of whitespace.". |
Of course, here is the Java code you requested:
```java
public void marshall(ProductionVariantSummary productionVariantSummary, ProtocolMarshaller protocolMarshaller) {
if (productionVariantSummary == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
... | Create a Java method that does the following: "marshalls the given productionVariantSummary to the JSON object.". |
Of course, here is the Java code you requested:
```java
public Stream<Job> getJobsStream(Integer runnerId, JobStatus status) throws GitLabApiException {
return (getJobs(runnerId, status, getDefaultPerPage()).stream());
}
```
Hope this helps! | Create a Java method that does the following: "Get a Stream of Jobs of a runner.". |
Of course, here is the Java code you requested:
```java
public ArrayList<OvhAvailableVersionEnum> serviceName_availableVersions_GET(String serviceName) throws IOException {
String qPath = "/hosting/privateDatabase/{serviceName}/availableVersions";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(q... | Create a Java method that does the following: "Get available versions of the private database". |
Of course, here is the Java code you requested:
```java
public org.osmdroid.views.overlay.Polygon toPolygon(Polygon polygon) {
org.osmdroid.views.overlay.Polygon newPoloygon = new org.osmdroid.views.overlay.Polygon();
List<GeoPoint> pts = new ArrayList<>();
List<List<GeoPoint>> holes = new Arra... | Create a Java method that does the following: "Convert polygon to polygon object.". |
Of course, here is the Java code you requested:
```java
public <TYPE> String write(@NotNull final TYPE obj, @NotNull final JAXBContext jaxbContext) throws MarshalObjectException {
Contract.requireArgNotNull("obj", obj);
Contract.requireArgNotNull("jaxbContext", jaxbContext);
final String... | Create a Java method that does the following: "Serializes a
object into a String.". |
Of course, here is the Java code you requested:
```java
public <T> void contextSet(Class<T> key, T value)
{
synchronized (TypeCheckInfo.class)
{
Stack<T> contextStack = lookupListForType(key);
if (contextStack == null)
{
contextStack = new Stack<T>();
context.put(key, contextStack);
}
conte... | Create a Java method that does the following: "Sets the value of a context for a given type.". |
Of course, here is the Java code you requested:
```java
public final int readUnsignedShort() throws IOException {
int ch2 = in.read();
int ch1 = in.read();
if ((ch1 | ch2) < 0)
throw new EOFException();
return (ch1 << 8) + (ch2 << 0);
}
```
Hope this helps! | Create a Java method that does the following: "read a unsigned short.". |
Of course, here is the Java code you requested:
```java
private static byte[] blobToBytes(Blob blob) {
try (InputStream is = blob.getBinaryStream()) {
byte[] b = new byte[(int) blob.length()];
if (is.read(b) != -1) {
return b;
} else {
return ... | Create a Java method that does the following: "Convert a blob to a byte array.". |
Of course, here is the Java code you requested:
```java
public void setElementAt(int node, int index)
{
if (null == m_map)
{
m_map = new int[m_blocksize];
m_mapSize = m_blocksize;
}
if(index == -1)
addElement(node);
m_map[index] = node;
}
```
Hope this helps! | Create a Java method that does the following: "Set the element at the specified index.". |
Of course, here is the Java code you requested:
```java
private String getTag(final BorderLayoutConstraint constraint) {
switch (constraint) {
case EAST:
return "ui:east";
case NORTH:
return "ui:north";
case SOUTH:
return "ui:south";
case WEST:
return "ui:west";
case CENTER:
defaul... | Create a Java method that does the following: "Gets the tag of the component depending on the BorderLayoutConstraint.". |
Of course, here is the Java code you requested:
```java
private void registerCallbacks(Manager manager) {
if (callbacks != null) {
for (Callback callback : callbacks) {
manager.callback().addCallback(callback);
}
}
}
```
Hope this helps! | Create a Java method that does the following: "Registers the callbacks for the given manager.". |
Of course, here is the Java code you requested:
```java
protected final void finalizeChildValueTypes() {
if (m_left != null) {
m_left.finalizeValueTypes();
updateContentDeterminismMessage(m_left.getContentDeterminismMessage());
}
if (m_right != null) {
m_righ... | Create a Java method that does the following: "Finalize child value types.". |
Of course, here is the Java code you requested:
```java
public void sessionDestroyed(HttpSessionEvent event) {
if (null != eventMulticaster) {
eventMulticaster.multicast(new HttpSessionDestroyedEvent(event.getSession()));
}
}
```
Hope this helps! | Create a Java method that does the following: "SessionDestroyed - Sends a HttpSessionDestroyedEvent to all listeners.". |
Of course, here is the Java code you requested:
```java
public static Reader encodedInputStreamReader(InputStream stream, String encoding) throws IOException {
// InputStreamReader doesn't allow encoding to be null;
if (encoding == null) {
return new InputStreamReader(stream);
} else {
ret... | Create a Java method that does the following: "Returns a Reader for the specified input stream using the specified encoding.". |
Of course, here is the Java code you requested:
```java
private void queueInvocationCommon(AbstractInvocation invocation, ConversationImpl conversation)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "queueInvocationCommon", new Object[] {invocation, conversation});
... | Create a Java method that does the following: "Queue an invocation into the conversation.". |
Of course, here is the Java code you requested:
```java
public EntityRole getPrebuiltEntityRole(UUID appId, String versionId, UUID entityId, UUID roleId) {
return getPrebuiltEntityRoleWithServiceResponseAsync(appId, versionId, entityId, roleId).toBlocking().single().body();
}
```
Hope this helps! | Create a Java method that does the following: "Gets the preferred entity role for an application.". |
Of course, here is the Java code you requested:
```java
public Iterable<DUser> queryByPreferredLanguage(java.lang.String preferredLanguage) {
return queryByField(null, DUserMapper.Field.PREFERREDLANGUAGE.getFieldName(), preferredLanguage);
}
```
Hope this helps! | Create a Java method that does the following: "query - by method for field preferredLanguage". |
Of course, here is the Java code you requested:
```java
public static base_response unset(nitro_service client, nstcpparam resource, String[] args) throws Exception{
nstcpparam unsetresource = new nstcpparam();
return unsetresource.unset_resource(client,args);
}
```
Hope this helps! | Create a Java method that does the following: "Use this API to unset the properties of nstcpparam resource. Properties that need to be unset are specified in args array.". |
Of course, here is the Java code you requested:
```java
public static Object getProperty(Object obj, String name) {
if (obj == null || name == null)
return null;
String[] names = name.split("\\.");
if (names == null || names.length == 0)
return null;
return performGetProperty(obj, names, 0);
}
```
Ho... | Create a Java method that does the following: "Gets the value of the property with the specified name from the specified object.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public <T> T parse(Field field, String text) {
return (T) conversion.convert(text, new TypeDescriptor(field));
}
```
Hope this helps! | Create a Java method that does the following: "Parses the text into a CID .". |
Of course, here is the Java code you requested:
```java
public static String[] parse(String[] args)
throws IOException
{
ListBuffer<String> newArgs = new ListBuffer<String>();
for (int i = 0; i < args.length; i++) {
String arg = args[i];
if (arg.length() > 1 && arg.c... | Create a Java method that does the following: "Parse the command line arguments.". |
Of course, here is the Java code you requested:
```java
public JanbaneryToWorkspace connectUsing(String apiKey) {
DefaultConfiguration conf = new DefaultConfiguration(apiKey);
return connectUsing(conf);
}
```
Hope this helps! | Create a Java method that does the following: "Connect to Janbanery to workspace using the specified API key.". |
Of course, here is the Java code you requested:
```java
public java.util.List<Location> getLocations() {
if (locations == null) {
locations = new com.amazonaws.internal.SdkInternalList<Location>();
}
return locations;
}
```
Hope this helps! | Create a Java method that does the following: "Gets the value of the locations property.". |
Of course, here is the Java code you requested:
```java
@Override
public void removeByCompanyId(long companyId) {
for (CommercePriceEntry commercePriceEntry : findByCompanyId(
companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commercePriceEntry);
}
}
```
Hope this helps! | Create a Java method that does the following: "Removes all commerce price entries of the requested company from the database. Also notifies the appropriate model listeners.". |
Of course, here is the Java code you requested:
```java
public Set<TypedEdge<T>> getEdges(final T type) {
final Set<TypedEdge<T>> s = new HashSet<TypedEdge<T>>();
edges.forEachEntry(new TIntObjectProcedure<Set<T>>() {
public boolean execute(int v, Set<T> types) {
... | Create a Java method that does the following: "Get the edges of the type.". |
Of course, here is the Java code you requested:
```java
public void marshall(Trigger trigger, ProtocolMarshaller protocolMarshaller) {
if (trigger == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(t... | Create a Java method that does the following: "marshalls the given Trigger object to the JSON object.". |
Of course, here is the Java code you requested:
```java
public StringExpression trim() {
if (trim == null) {
trim = Expressions.stringOperation(Ops.TRIM, mixin);
}
return trim;
}
```
Hope this helps! | Create a Java method that does the following: "Returns a trim string expression for this class". |
Of course, here is the Java code you requested:
```java
public static <TResult> Task<TResult> callInBackground(Callable<TResult> callable) {
return call(callable, BACKGROUND_EXECUTOR, null);
}
```
Hope this helps! | Create a Java method that does the following: "A background task that is executed in a background thread.". |
Of course, here is the Java code you requested:
```java
public static String svg(String width, String height, String content) {
return String
.format("<svg width=\"%s\" height=\"%s\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n"
+ "%s" + "</svg>\n", width, height, co... | Create a Java method that does the following: "Create a SVG element with the specified width and height and content.". |
Of course, here is the Java code you requested:
```java
protected void initType() {
try {
this.type = getEnhancedAnnotated().getJavaClass();
} catch (ClassCastException e) {
Type type = Beans.getDeclaredBeanType(getClass());
throw BeanLogger.LOG.producerCastError(get... | Create a Java method that does the following: "Initialize the type of the class.". |
Of course, here is the Java code you requested:
```java
public String createUpdateInStr(Map dbColMap0,Map modelEntryMap){
if(dbColMap0==null){
return null;
}
//add 201902 ning
Map dbColMap=new CaseInsensitiveKeyMap();
if(dbColMap0!=null){
dbColMap.putAll(dbColMap0);
}
List realValu... | Create a Java method that does the following: "Creates a string containing the contents of the specified model entry map.". |
Of course, here is the Java code you requested:
```java
@Override
public Key getParent() {
List<PathElement> ancestors = getAncestors();
if (ancestors.isEmpty()) {
return null;
}
PathElement parent = ancestors.get(ancestors.size() - 1);
Key.Builder keyBuilder;
if (parent.hasName()) {
... | Create a Java method that does the following: "Get the parent of this key.". |
Of course, here is the Java code you requested:
```java
public ColumnModel addColumn(String columnName) {
checkReadOnly();
DialectException.assureNotEmpty(columnName, "columnName can not be empty");
for (ColumnModel columnModel : columns)
if (columnName.equalsIgnoreCase(columnModel.getColumnName()))
throw... | Create a Java method that does the following: "Add a new column to this table.". |
Of course, here is the Java code you requested:
```java
public static <T> T recoveredValue(Class<T> type, String properties) throws ExecutionException {
return recoveredValueASArray(type, properties)[0];
}
```
Hope this helps! | Create a Java method that does the following: "Recovered a value from a class.". |
Of course, here is the Java code you requested:
```java
public ClassSymbol boxedClass(Type t) {
return reader.enterClass(syms.boxedName[t.getTag().ordinal()]);
}
```
Hope this helps! | Create a Java method that does the following: "Get the class symbol for a type.". |
Of course, here is the Java code you requested:
```java
@Override
public void describe(DDParser.Diagnostics diag) {
diag.describeIfSet("class-name", className);
diag.describeIfSet("name", name);
diag.describeIfSet("actions", actions);
}
```
Hope this helps! | Create a Java method that does the following: "Describe the content of the XSD.". |
Of course, here is the Java code you requested:
```java
public ServletContext getCurrentServletContext() {
final ClassLoader cl = getContextClassLoader();
if (cl == null) {
return null;
}
return servletContexts.get(cl);
}
```
Hope this helps! | Create a Java method that does the following: "Gets the ServletContext that is currently used by the current thread.". |
Of course, here is the Java code you requested:
```java
public SVGPath smoothCubicTo(double c2x, double c2y, double x, double y) {
return append(PATH_SMOOTH_CUBIC_TO).append(c2x).append(c2y).append(x).append(y);
}
```
Hope this helps! | Create a Java method that does the following: "Smooth cubic to the given coordinates.". |
Of course, here is the Java code you requested:
```java
public Rectangle getRect() {
verifyPropertyPresence(RECT);
//noinspection unchecked
return mapToRect((Map<String, Object>) getCommandResult().get(RECT));
}
```
Hope this helps! | Create a Java method that does the following: "Gets the result as a Rectangle.". |
Of course, here is the Java code you requested:
```java
public static @Nonnull String getValue(@Nonnull String xpath, @Nonnull File file) throws IOException, SAXException, XPathExpressionException {
return getValue(xpath, file, Charset.defaultCharset().toString());
}
```
Hope this helps! | Create a Java method that does the following: "Get the value of an XPath expression.". |
Of course, here is the Java code you requested:
```java
protected void addWhoData (StringBuilder buf)
{
buf.append(getOid());
if (status != OccupantInfo.ACTIVE) {
buf.append(" ").append(getStatusTranslation());
}
}
```
Hope this helps! | Create a Java method that does the following: "Add who data to the string buffer.". |
Of course, here is the Java code you requested:
```java
private void processInternalListener(Class<?> listenerClass) {
InternalListenerMetadata listenerMetadata = InternalListenerIntrospector
.introspect(listenerClass);
Map<CallbackType, Method> callbacks = listenerMetadata.getCallbacks();
if (call... | Create a Java method that does the following: "Process an internal listener class.". |
Of course, here is the Java code you requested:
```java
public PmiDataInfo[] listMyLevelData(int level) {
ArrayList levelData = new ArrayList();
Iterator allData = perfData.values().iterator();
while (allData.hasNext()) {
PmiDataInfo dataInfo = (PmiDataInfo) allData.next();
... | Create a Java method that does the following: "List the level data.". |
Of course, here is the Java code you requested:
```java
public Collection addMember(Resource first, Resource... rest) {
if (this.members == null) {
this.members = new ArrayList<>();
checkMember(first);
stream(rest).forEach(this::checkMember);
}
this.members.addAll(Lists.asList(first, rest... | Create a Java method that does the following: "Add a member to the group.". |
Of course, here is the Java code you requested:
```java
public void startModelWalking() {
doWhenModelWalkerFinished(ActionType.MODEL_WALKNG, new Runnable() {
@Override
public void run() {
memberLock.lock();
modelWalkingInProgess = true;
me... | Create a Java method that does the following: "Start the model walking process.". |
Of course, here is the Java code you requested:
```java
@Override
public Iterator<String> getChildren() {
// Return empty list if the wrapped file is null, if it isn't an existing
// directory,
// or if we don't have a root. We will not resolve resources (or traverse
// parent/child... | Create a Java method that does the following: "Returns an iterator of all the children of this CRA file.". |
Of course, here is the Java code you requested:
```java
private static void extractIntersectingState(
Collection<KeyedStateHandle> originalSubtaskStateHandles,
KeyGroupRange rangeToExtract,
List<KeyedStateHandle> extractedStateCollector) {
for (KeyedStateHandle keyedStateHandle : originalSubtaskStateHandles) ... | Create a Java method that does the following: "Extract the intersection of the given range to extract into the given list of state handles.". |
Of course, here is the Java code you requested:
```java
public MetaConfig withInstanceCheck(InstanceCheckPolicy policy) {
Ensure.that(policy != null, "policy != null");
return new MetaConfigBuilder(this)
.setInstanceCheckPolicy(policy)
.build();
}
```
Hope this helps! | Create a Java method that does the following: "Create a new MetaConfig with the specified InstanceCheckPolicy.". |
Of course, here is the Java code you requested:
```java
private <T extends DataSource> T applyDataSourceProperties(T dataSource) {
for (Map.Entry<Object, Object> entry : properties.entrySet()) {
String key = entry.getKey().toString();
String value = entry.getValue().toString();
... | Create a Java method that does the following: "Apply DataSource properties to the DataSource". |
Of course, here is the Java code you requested:
```java
public static LinkedHashMap<String, HiveTypeInfo> getColumnNameType(Record metadataRecord) throws HiveStageCheckedException {
LinkedHashMap<String, HiveTypeInfo> columnNameType = new LinkedHashMap<>();
extractInnerMapFromTheList(
metadataRecord,
... | Create a Java method that does the following: "Get the column type of the table.". |
Of course, here is the Java code you requested:
```java
public static boolean propertyExists(Class<?> clazz, String property, ElementType elementType) {
if ( ElementType.FIELD.equals( elementType ) ) {
return getDeclaredField( clazz, property ) != null;
}
else {
String capitalizedPropertyName = capitalize(... | Create a Java method that does the following: "Checks if a property exists in the given class.". |
Of course, here is the Java code you requested:
```java
public Serializer register(Class<?> type, int id, Class<? extends TypeSerializer> serializer) {
registry.register(type, id, serializer);
return this;
}
```
Hope this helps! | Create a Java method that does the following: "Register a serializer for a type.". |
Of course, here is the Java code you requested:
```java
public SparseDoubleVector generateContext(DependencyTreeNode[] tree,
int focusIndex) {
DependencyTreeNode focusNode = tree[focusIndex];
SparseDoubleVector focusMeaning = new CompactSparseVector();
... | Create a Java method that does the following: "Generate the context for a given focus word.". |
Of course, here is the Java code you requested:
```java
public java.util.List<FileSystemDescription> getFileSystems() {
if (fileSystems == null) {
fileSystems = new com.amazonaws.internal.SdkInternalList<FileSystemDescription>();
}
return fileSystems;
}
```
Hope this helps! | Create a Java method that does the following: "Gets the value of the fileSystems property.". |
Of course, here is the Java code you requested:
```java
public static SQLTable get(final UUID _uuid)
throws CacheReloadException
{
final Cache<UUID, SQLTable> cache = InfinispanCache.get().<UUID, SQLTable>getCache(SQLTable.UUIDCACHE);
if (!cache.containsKey(_uuid)) {
SQLTable.ge... | Create a Java method that does the following: "Get the SQL table with the given UUID.". |
Of course, here is the Java code you requested:
```java
public void setActiveSession(HttpSession activeSession) {
if (log.isInfoEnabled()) {
log.info("Setting new active session for site '" + site + "': " + activeSession);
}
if (activeSession == null) {
throw new IllegalArgumentException(
"When settti... | Create a Java method that does the following: "Sets the active session for this site.". |
Of course, here is the Java code you requested:
```java
public static String humanize(final String input) {
if (input == null || input.length() == 0) {
return "";
}
return upperFirst(underscored(input).replaceAll("_", " "));
}
```
Hope this helps! | Create a Java method that does the following: "Humanize a string.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public static EmbeddedServer<?> instantiate(AbstractConfiguration configuration) {
ServiceLoader<EmbeddedServerProvider> serviceProviders = ServiceLoader.load(EmbeddedServerProvider.class);
List<EmbeddedServerProvider> coreSer... | Create a Java method that does the following: "Creates an instance of the EmbeddedServer class using the given configuration.". |
Of course, here is the Java code you requested:
```java
private void extendTail(int count) {
if (terminated || count < 1) {
return;
}
while (--count >= 0) {
// create a copy of the last slot and make it the last one
final Slot inserted = slots.insertSlotAt(s... | Create a Java method that does the following: "Extend the tail of the sequence.". |
Of course, here is the Java code you requested:
```java
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
@CheckReturnValue
public final ParallelFlowable<T> parallel() {
return ParallelFlowable.from(this);
}
```
Hope this helps! | Create a Java method that does the following: "Returns a parallel sequence of tokens from this sequence.". |
Of course, here is the Java code you requested:
```java
public static Version valueOf(final String value) {
final Optional<Instant> time = parse(value);
if (time.isPresent()) {
return new Version(time.get());
}
return null;
}
```
Hope this helps! | Create a Java method that does the following: "Gets the Version object from the string value.". |
Of course, here is the Java code you requested:
```java
public com.google.api.ads.admanager.axis.v201811.DeviceManufacturerTargeting getDeviceManufacturerTargeting() {
return deviceManufacturerTargeting;
}
```
Hope this helps! | Create a Java method that does the following: "Gets the deviceManufacturerTargeting value for this TechnologyTargeting.". |
Of course, here is the Java code you requested:
```java
public void setSubunitMap(Map<Integer, Integer> subunitMap) {
// Check consistency of the map
if (Collections.max(subunitMap.keySet()) > subunits1.size()
| Collections.max(subunitMap.values()) > subunits2.size())
throw new IndexOutOfBoundsException(
... | Create a Java method that does the following: "Sets the subunit map.". |
Of course, here is the Java code you requested:
```java
private void writeJsonKeyValue(String fieldName, String value)
throws JsonGenerationException, IOException {
generator.writeStringField(fieldName, value);
}
```
Hope this helps! | Create a Java method that does the following: "Write a single value to the JSON file.". |
Of course, here is the Java code you requested:
```java
static ContainerLaunchContext createTaskExecutorContext(
org.apache.flink.configuration.Configuration flinkConfig,
YarnConfiguration yarnConfig,
Map<String, String> env,
ContaineredTaskManagerParameters tmParams,
org.apache.flink.configuration.Configura... | Create a Java method that does the following: "Create a new container executor context.". |
Of course, here is the Java code you requested:
```java
protected void registerStartTimeCurrentTime() {
readyStartTimeFieldIfNeeds();
final long millis = System.currentTimeMillis(); // #thinking should be from time-manager? (but basically unused...)
setFieldValue(startTimeField, millis);
... | Create a Java method that does the following: "Registers the start time of the current time of the application.". |
Of course, here is the Java code you requested:
```java
private void updateDeletedObjectsThroughEntityManager(List<String> oids, Long timestamp) {
for (String id : oids) {
EDBObject o = new EDBObject(id);
o.updateTimestamp(timestamp);
o.setDeleted(true);
JPAObjec... | Create a Java method that does the following: "Update deleted objects through entityManager.". |
Of course, here is the Java code you requested:
```java
@Bean
@ConditionalOnMissingBean
DistributionSetTagManagement distributionSetTagManagement(
final DistributionSetTagRepository distributionSetTagRepository,
final DistributionSetRepository distributionSetRepository,
fina... | Create a Java method that does the following: "Create a DistributionSetTagManagement.". |
Of course, here is the Java code you requested:
```java
private void loadHashMap(final Properties props) {
properties.clear();
@SuppressWarnings("rawtypes")
Enumeration e = props.propertyNames();
while (e.hasMoreElements()) {
String key = (String) e.nextElement();
properties.put(key, props... | Create a Java method that does the following: "Load the HashMap from a Properties object.". |
Of course, here is the Java code you requested:
```java
public float getCpuUsagePercent() {
if (nanoBefore == null || cpuBefore == null) {
throw new IllegalStateException("nanoBefore or cpuBefore where null: nanoBefore: " + nanoBefore + ", " +
" cpuBefore: " + cpuBefore);
}
long cpuAfter = processCpuTime... | Create a Java method that does the following: "Get the CPU usage percent.". |
Of course, here is the Java code you requested:
```java
public EClass getIfcProductDefinitionShape() {
if (ifcProductDefinitionShapeEClass == null) {
ifcProductDefinitionShapeEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(387);
}
return ifcP... | Create a Java method that does the following: "Get the IfcProductDefinitionShapeEClass for the ifcProductDefinitionShape feature.". |
Of course, here is the Java code you requested:
```java
public static void markSuccessfulOutputDir(Path path, JobConf conf) throws IOException {
FileSystem fs = FileSystem.get(conf);
// create a file in the folder to mark it
if (fs.exists(path)) {
Path filePath = new Path(path, Vers... | Create a Java method that does the following: "Create a file in the folder that contains the successful output files.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("unused")
private Object readResolve() {
if (StringUtils.isNotEmpty(oldTopic)) {
oldTopicObject = new Topic(oldTopic);
oldTopic = null;
}
if (oldTopicObject != null && StringUtils.isEmpty(oldT... | Create a Java method that does the following: "readResolve Method.". |
Of course, here is the Java code you requested:
```java
@Override
public String cipherSuite()
{
SSLSocket sslSocket = _sslSocket;
if (sslSocket == null) {
return super.cipherSuite();
}
SSLSession sslSession = sslSocket.getSession();
if (sslSession != null) {
return ss... | Create a Java method that does the following: "Returns the cipher suite of this connection.". |
Of course, here is the Java code you requested:
```java
public static InetAddress getLocalAddress()
{
if (localInetAddress == null)
try
{
localInetAddress = DatabaseDescriptor.getListenAddress() == null
? InetAddress.getLocalHost()... | Create a Java method that does the following: "Get the local address of the database.". |
Of course, here is the Java code you requested:
```java
private Object wrappedAction(final Context cx, final Scriptable scope,
final Scriptable thisObj, final Object[] args, final int actionType) {
// take care to set the context's RegExp proxy to the original one as
// this is checked
// (cf net.sourceforge... | Create a Java method that does the following: "Wrap the wrapped regular expression.". |
Of course, here is the Java code you requested:
```java
public void setFirstname(String firstname) {
OpenCms.getValidationHandler().checkFirstname(firstname);
if (firstname != null) {
firstname = firstname.trim();
}
m_firstname = firstname;
}
```
Hope this helps! | Create a Java method that does the following: "Sets the firstname of the class.". |
Of course, here is the Java code you requested:
```java
public void eInit(IJvmTypeProvider context) {
setTypeResolutionContext(context);
if (this.block == null) {
this.block = XbaseFactory.eINSTANCE.createXBlockExpression();
}
}
```
Hope this helps! | Create a Java method that does the following: "Initialize the expression.". |
Of course, here is the Java code you requested:
```java
public static boolean intersectRayCircle(Vector2fc origin, Vector2fc dir, Vector2fc center, float radiusSquared, Vector2f result) {
return intersectRayCircle(origin.x(), origin.y(), dir.x(), dir.y(), center.x(), center.y(), radiusSquared, result);
}
`... | Create a Java method that does the following: "Intersects the ray circle with the given origin and direction.". |
Of course, here is the Java code you requested:
```java
public PooledObject<T> get() {
T data = pool.pollLast();
if (data == null) {
data = function.get();
}
return new PooledObjectImpl<>(data, pool);
}
```
Hope this helps! | Create a Java method that does the following: "Gets a pooled object from the cache.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public S execute(S solution) {
int i = 0;
int best;
evaluations = 0;
numberOfNonComparableSolutions = 0;
int rounds = improvementRounds;
while (i < rounds) {
S mutatedSolution = mutationOperator.exe... | Create a Java method that does the following: "Execute the CDI mutation algorithm.". |
Of course, here is the Java code you requested:
```java
private static void parseFont(Style style, String val)
{
Integer fontWeight = null;
Style.FontStyle fontStyle = null;
String fontVariant = null;
// Start by checking for the fixed size standard system font na... | Create a Java method that does the following: "Parse a fixed size standard system font name.". |
Of course, here is the Java code you requested:
```java
protected Packet createPacket() throws IOException {
synchronized (packets) {
if (packets.size() == 0)
return new Packet();
Packet p = (Packet) packets.elementAt(0);
packets.removeElementAt(0);
return p;
}
}
```
Hope this helps! | Create a Java method that does the following: "Create a Packet object.". |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.