code stringlengths 160 48.7k | prompt stringlengths 55 1.51k |
|---|---|
Of course, here is the Java code you requested:
```java
public Review getReview(String reviewId) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, reviewId);
URL url = new ApiUrl(apiKey, MethodBase.REVIEW).buildUrl(parameters);
String ... | Create a Java method that does the following: "Get the Review for a specific review id.". |
Of course, here is the Java code you requested:
```java
public void writeExternal(final ObjectOutput out) throws IOException {
ObjectOutput droolsStream;
boolean isDrools = out instanceof DroolsObjectOutputStream;
ByteArrayOutputStream bytes;
out.writeBoolean( isDrools );
if (i... | Create a Java method that does the following: "Write the internal data to the given output stream.". |
Of course, here is the Java code you requested:
```java
@Override
public int checkBounds (long logicalBlockAddress, int transferLengthInBlocks) {
// Checking if the logical block address is out of bounds
if (logicalBlockAddress < 0 || logicalBlockAddress >= getSizeInBlocks()) {
return 1... | Create a Java method that does the following: "Check if the logical block address and transfer length are within the device bounds.". |
Of course, here is the Java code you requested:
```java
@Help(
help = "Create the PhysicalNetworkFunctionRecord of a NetworkServiceRecord with specific id"
)
public PhysicalNetworkFunctionRecord postPhysicalNetworkFunctionRecord(
final String idNsr, final PhysicalNetworkFunctionRecord physicalNetworkFunc... | Create a Java method that does the following: "Create a new PhysicalNetworkFunctionRecord in a NetworkServiceRecord.". |
Of course, here is the Java code you requested:
```java
@Override
public StartFleetActionsResult startFleetActions(StartFleetActionsRequest request) {
request = beforeClientExecution(request);
return executeStartFleetActions(request);
}
```
Hope this helps! | Create a Java method that does the following: "Start the managed fleets.". |
Of course, here is the Java code you requested:
```java
@PUT
@Consumes({
MediaType.TEXT_XML, MediaType.APPLICATION_XML
})
public Response putResource(@PathParam(JaxRxConstants.SYSTEM) final String system,
@PathParam(JaxRxConstants.RESOURCE) final String resource, @Context final HttpHeaders ... | Create a Java method that does the following: "PUT a single resource.". |
Of course, here is the Java code you requested:
```java
public static Requirement buildNPM(String requirement) {
if (requirement.isEmpty()) {
requirement = "*";
}
return buildWithTokenizer(requirement, Semver.SemverType.NPM);
}
```
Hope this helps! | Create a Java method that does the following: "Build a NPM requirement from a string.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public static <T extends Example> T[] asArray( T example )
{
List<Example> examples = asList( example );
T[] array = (T[]) Array.newInstance( example.getClass(), examples.size() );
return examples.toA... | Create a Java method that does the following: "Returns an array of examples from the given example.". |
Of course, here is the Java code you requested:
```java
public static void main(String[] args) throws Exception {
// Determine system-wide directory
String systemDir = determineSystemRoot();
// Determine user-wide directory
String globalDir = determineGlobalRoot();
// Determine project directory
String loc... | Create a Java method that does the following: "Main method to execute WyMain.". |
Of course, here is the Java code you requested:
```java
static void normalizedBoundaries(long d64, DiyFp m_minus, DiyFp m_plus) {
DiyFp v = asDiyFp(d64);
boolean significand_is_zero = (v.f() == kHiddenBit);
m_plus.setF((v.f() << 1) + 1);
m_plus.setE(v.e() - 1);
m_plus.normalize(... | Create a Java method that does the following: "Normalizes the boundaries of a log2 message.". |
Of course, here is the Java code you requested:
```java
public final void smoothScrollBy(int dx, int dy) {
if (getChildCount() == 0) {
// Nothing to do.
return;
}
long duration = AnimationUtils.currentAnimationTimeMillis() - mLastScroll;
if (duration > ANIMATED_SCROLL_GAP) {
final int height = getHeig... | Create a Java method that does the following: "Smoothly smooth the scroll by the specified amount of time.". |
Of course, here is the Java code you requested:
```java
@Deprecated
public C expectAtLeast(int allowedStatements, Threads threadMatcher) {
return expect(SqlQueries.minQueries(allowedStatements).threads(threadMatcher));
}
```
Hope this helps! | Create a Java method that does the following: "Expect a sequence of SQL statements to be at least the given number of threads.". |
Of course, here is the Java code you requested:
```java
@Override
public Object remove(Object key) {
int scope = context.getAttributesScope((String) key);
if (scope > -1)
return context.removeAttribute((String) key, scope);
return null;
}
```
Hope this helps! | Create a Java method that does the following: "Removes an attribute from the context.". |
Of course, here is the Java code you requested:
```java
public static base_responses add(nitro_service client, filterhtmlinjectionvariable resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
filterhtmlinjectionvariable addresources[] = new filterhtmlinj... | Create a Java method that does the following: "Use this API to add filterhtmlinjectionvariable resources.". |
Of course, here is the Java code you requested:
```java
public void validate(ComponentDescriptor<?> descriptor, Object component) {
InitializeCallback callback = new InitializeCallback(true, false, _includeNonDistributedTasks);
callback.onEvent(component, descriptor);
}
```
Hope this helps! | Create a Java method that does the following: "Validate the component.". |
Of course, here is the Java code you requested:
```java
public ListPipelineExecutionsResult withPipelineExecutionSummaries(PipelineExecutionSummary... pipelineExecutionSummaries) {
if (this.pipelineExecutionSummaries == null) {
setPipelineExecutionSummaries(new java.util.ArrayList<PipelineExecution... | Create a Java method that does the following: "A list of summary information about the pipeline executions.". |
Of course, here is the Java code you requested:
```java
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case AfplibPackage.DESCRIPTOR_POSITION__DES_POS_ID:
setDesPosID((Integer)newValue);
return;
}
super.eSet(featureID, newValue);
}
```
Hope this helps! | Create a Java method that does the following: "Override the eSet method for the AfplibPackage. DESCRIPTOR_POSITION featureID". |
Of course, here is the Java code you requested:
```java
private ParseTree parseThrowStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.THROW);
ParseTree value = null;
if (peekImplicitSemiColon()) {
reportError("semicolon/newline not allowed after 'throw'");
} else {
... | Create a Java method that does the following: "12. 4 Throw Statement". |
Of course, here is the Java code you requested:
```java
@Override
public void fatal(Object object) {
if (toSTDOUT) {
printToStderr("FATAL", object.toString());
} else {
log4jLogger.fatal("" + object.toString());
}
}
```
Hope this helps! | Create a Java method that does the following: "Print a fatal message to STDERR.". |
Of course, here is the Java code you requested:
```java
public SyntaxException getSyntaxError(int index) {
SyntaxException exception = null;
Message message = getError(index);
if (message != null && message instanceof SyntaxErrorMessage) {
exception = ((SyntaxErrorMessage) message)... | Create a Java method that does the following: "Gets the SyntaxException associated with the specified index.". |
Of course, here is the Java code you requested:
```java
private static String getNextLineSkippingBlankLines(final BufferedReader reader) throws IOException {
String tString = null;
do {
tString = reader.readLine();
} while (tString != null && tString.length() == 0);
return ... | Create a Java method that does the following: "Get the next line of text skipping blank lines.". |
Of course, here is the Java code you requested:
```java
public final void setElevation(StringBuilder contentBuffer) {
ptValues[GpxMetadata.PTELE] = Double.parseDouble(contentBuffer.toString());
}
```
Hope this helps! | Create a Java method that does the following: "Set the elevation of the image.". |
Of course, here is the Java code you requested:
```java
public MetricValue[] getAll(int startInclusive, int endExclusive) {
return IntStream.range(startInclusive, endExclusive)
.mapToObj(this::getOrNull)
.toArray(MetricValue[]::new);
}
```
Hope this helps! | Create a Java method that does the following: "Gets all the metric values in the cache.". |
Of course, here is the Java code you requested:
```java
public void write(WriteRequest writeRequest) {
if (!tryAcquireSemaphore()) {
return;
}
mSerializingExecutor.execute(() -> {
try {
if (mContext == null) {
LOG.debug("Received write request {}.", writeRequest);
mC... | Create a Java method that does the following: "Writes a single write request.". |
Of course, here is the Java code you requested:
```java
public void printHelp(String cmdLineSyntax, String header, Options options, String footer)
{
printHelp(cmdLineSyntax, header, options, footer, false);
}
```
Hope this helps! | Create a Java method that does the following: "Print the help for the CRAsCTYPE.". |
Of course, here is the Java code you requested:
```java
protected void clearCaches(CmsEvent event) {
// synchronization of this method is not required as the individual maps are all synchronized maps anyway,
// and setExportnames() is doing it's own synchronization
// flush all caches
... | Create a Java method that does the following: "Clear all caches for the given event.". |
Of course, here is the Java code you requested:
```java
public static <T> Flux<T> mergeSequential(Publisher<? extends Publisher<? extends T>> sources) {
return mergeSequential(sources, false, Queues.SMALL_BUFFER_SIZE,
Queues.XS_BUFFER_SIZE);
}
```
Hope this helps! | Create a Java method that does the following: "Merge the given Publisher into a single Flux.". |
Of course, here is the Java code you requested:
```java
public static String serialize(StreamSchema schema) {
StringBuilder builder = new StringBuilder();
int fieldCount = 1;
for (GDATField field : schema.getFields()) {
builder.append(field.getType().getTypeName()).append(" ").append(field.getName())... | Create a Java method that does the following: "Serialize a StreamSchema to a String". |
Of course, here is the Java code you requested:
```java
private Set<String> findClassLabelsInHasContainers() {
Set<String> classLabels = new HashSet<>();
HasContainer container = this.hasContainers.stream().filter(hasContainer -> isLabelKey(hasContainer.getKey())).findFirst()
.orElseGet(() -> {
... | Create a Java method that does the following: "Find the class labels in the HasContainers". |
Of course, here is the Java code you requested:
```java
public void setAsText(final String text)
{
if (PropertyEditors.isNull(text, false, false))
{
setValue(null);
return;
}
Object newValue = text.getBytes();
setValue(newValue);
}
```
Hope this helps! | Create a Java method that does the following: "Sets the value of the index field as a text value.". |
Of course, here is the Java code you requested:
```java
boolean isEqualTypeName(final Type argumentType, final Class paramType) {
String s = argumentType.getClassName();
if (s.endsWith(ARRAY)) { // arrays detected
String prefix = s.substring(0, s.length() - 2);
String bytecodeSymbol = primitives.get(prefix)... | Create a Java method that does the following: "Checks if the type name is equal to the type name of the parameter.". |
Of course, here is the Java code you requested:
```java
@Override
public void updateCache(Dictionary<String, Object> properties, Set<ConfigID> references, Set<String> newUniques) throws IOException {
lock.lock();
try {
removeReferences();
setProperties(properties);
... | Create a Java method that does the following: "Update the cache.". |
Of course, here is the Java code you requested:
```java
Type checkSpeculative(DiagnosticPosition pos, Type t, ResultInfo resultInfo) {
if (t.hasTag(DEFERRED)) {
return ((DeferredType)t).check(resultInfo);
} else {
return resultInfo.check(pos, t);
}
}
```
Hope this h... | Create a Java method that does the following: "Check a speculative type.". |
Of course, here is the Java code you requested:
```java
public Quaterniond sub(double x, double y, double z, double w) {
return new Quaterniond(this.x - x, this.y - y, this.z - z, this.w - w);
}
```
Hope this helps! | Create a Java method that does the following: "Subtracts the given values from this quaternion.". |
Of course, here is the Java code you requested:
```java
public PostRemove<EntityListener<T>> getOrCreatePostRemove()
{
Node node = childNode.getOrCreate("post-remove");
PostRemove<EntityListener<T>> postRemove = new PostRemoveImpl<EntityListener<T>>(this, "post-remove", childNode, node);
return po... | Create a Java method that does the following: "Get or create a PostRemove object.". |
Of course, here is the Java code you requested:
```java
public String getInitializationHeader() {
// if mode is "listview", all file in the set collector will be shown
boolean listView = VIEW_LIST.equals(getSettings().getExplorerMode());
String currentResourceName = getSettings().getExplorerR... | Create a Java method that does the following: "Returns the initialization header for the XML file.". |
Of course, here is the Java code you requested:
```java
@Pure
@Inline(value = "EndianNumbers.parseLELong(Double.doubleToLongBits($1))",
imported = {EndianNumbers.class})
public static byte[] parseLEDouble(double value) {
return parseLELong(Double.doubleToLongBits(value));
}
```
Hope this helps! | Create a Java method that does the following: "Parse a double value as a Little Endian byte array.". |
Of course, here is the Java code you requested:
```java
public void abort(CheckpointFailureReason reason, Throwable cause) {
try {
CheckpointException exception = new CheckpointException(reason, cause);
onCompletionPromise.completeExceptionally(exception);
reportFailedCheckpoint(exception);
assertAbortSu... | Create a Java method that does the following: "Aborts the checkpoint with the given reason and cause.". |
Of course, here is the Java code you requested:
```java
private Dictionary<String,String> getConfiguration() {
Dictionary<String,String> config = new Hashtable<String,String>();
for (ConfigKey key : ConfigKey.values()) {
String value = getConfiguration(key);
if (value != null) {... | Create a Java method that does the following: "Get the configuration for the current agent.". |
Of course, here is the Java code you requested:
```java
public void critical(Throwable error, String description) {
log(error, null, description, Level.CRITICAL);
}
```
Hope this helps! | Create a Java method that does the following: "Log a critical error with description.". |
Of course, here is the Java code you requested:
```java
private void parseCollectionInitializerList( IType type )
{
CollectionInitializerExpression lie = new CollectionInitializerExpression();
IType componentType;
if( type.isDynamic() )
{
componentType = type.getComponentType();
}
else... | Create a Java method that does the following: "Parse a list of CollectionInitializerExpression.". |
Of course, here is the Java code you requested:
```java
ConnectionWrapper obtainConnection() {
synchronized (allConnections) {
//fails if connection pool not started
if (!availableConnections.isEmpty()) {
//retrieve and remove first connection from list
// since released connections are added to the b... | Create a Java method that does the following: "Obtain a connection from the connection pool.". |
Of course, here is the Java code you requested:
```java
public void verify(ServerStoreConfiguration serverConfiguration, ServerStoreConfiguration clientConfiguration)
throws InvalidServerStoreConfigurationException {
StringBuilder sb = new StringBuilder("Existing ServerStore configuration is not compatible w... | Create a Java method that does the following: "Verify that the existing configuration is compatible with the desired configuration.". |
Of course, here is the Java code you requested:
```java
public DirContextOperations searchForSingleEntry(final String base,
final String filter, final Object[] params) {
return (DirContextOperations) executeReadOnly(new ContextExecutor() {
public Object executeWithContext(DirContext ctx) throws NamingExceptio... | Create a Java method that does the following: "Search for a single entry in the directory.". |
Of course, here is the Java code you requested:
```java
public String cardinal(long n) {
if (n == 0) {
return "zero";
}
StringBuilder buffer = new StringBuilder(20);
if (n < 0) {
buffer.append("negative ");
n = -n;
}
n = cardinalGro... | Create a Java method that does the following: "Get the cardinal string for a long.". |
Of course, here is the Java code you requested:
```java
public void marshall(CaptionDescription captionDescription, ProtocolMarshaller protocolMarshaller) {
if (captionDescription == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
... | Create a Java method that does the following: "marshalls the given CaptionDescription to the given protocolMarshaller.". |
Of course, here is the Java code you requested:
```java
@Nonnull
public Person addPerson(@Nonnull String name, @Nullable String description) {
return addPerson(Location.Unspecified, name, description);
}
```
Hope this helps! | Create a Java method that does the following: "Add a Person to the CID SECTYPE.". |
Of course, here is the Java code you requested:
```java
public void addXmlPreprocessingDigesterRules(Digester digester) {
digester.addCallMethod(CmsImportExportManager.N_EXPORT + "/" + N_FILES + "/" + N_FILE, "increaseTotalFiles");
digester.addCallMethod(
CmsImportExportManager.N_EXPORT
... | Create a Java method that does the following: "Adds the XML preprocessing digester rules.". |
Of course, here is the Java code you requested:
```java
public void initState(List<PKIXCertPathChecker> certPathCheckers)
throws CertPathValidatorException
{
subjectNamesTraversed = new HashSet<GeneralNameInterface>();
traversedCACerts = 0;
/*
* Populate forwardCheckers wi... | Create a Java method that does the following: "Initialize the state of the CACertStore.". |
Of course, here is the Java code you requested:
```java
private List<AbstractItem> getRawItems() {
if (rawItems == null) {
rawItems = new ArrayList<>();
for (int i = 0; i < items.size(); i++) {
AbstractItem item = items.get(i);
if (item instanceof Divid... | Create a Java method that does the following: "Gets the raw items.". |
Of course, here is the Java code you requested:
```java
protected void wrapBuffer() throws IOException
{
if (size()==0)
return;
if (_buf!=_packet.getBuffer())
{
_packet=new AJP13ResponsePacket(_buf);
_packet.prepare();
}
prewrite(_buf,0,... | Create a Java method that does the following: "Wrap the buffer in a AJP13ResponsePacket.". |
Of course, here is the Java code you requested:
```java
public <T> BeanDefinition<T> registerPetiteBean(
final Class<T> type, String name,
Class<? extends Scope> scopeType,
WiringMode wiringMode,
final boolean define,
final Consumer<T> consumer
) {
if (name == null) {
name = resolveBeanName(type);
}... | Create a Java method that does the following: "Register a petite bean.". |
Of course, here is the Java code you requested:
```java
public static void main(String[] args) throws ParseException,
ExceptionState, IOException {
/* options for the program */
Options options = new Options();
/* add helm string */
options.addOption("inputHELM", true, "HELM1 or HELM2 string... | Create a Java method that does the following: "Main method to run the
banner command.". |
Of course, here is the Java code you requested:
```java
protected <T extends DavidBoxResponse> T execute(DavidBoxOperation operation, Class<T> responseTargetClass) throws TheDavidBoxClientException{
//Build the additional http arguments for the operation if there is additioanl http parameters
LinkedHashMap<Strin... | Create a Java method that does the following: "Executes the
operation.". |
Of course, here is the Java code you requested:
```java
public XNElement add(XNElement child) {
child.parent = this;
children.add(child);
return child;
}
```
Hope this helps! | Create a Java method that does the following: "Add a new child element to this element.". |
Of course, here is the Java code you requested:
```java
public BigDecimal getTotal() {
BigDecimal total = BigDecimal.ZERO;
for ( LineItem item : lineItems ) {
total = total.add( item.getTotal() );
}
return total;
}
```
Hope this helps! | Create a Java method that does the following: "Gets the total of the line items.". |
Of course, here is the Java code you requested:
```java
public static CPRuleAssetCategoryRel[] findByAssetCategoryId_PrevAndNext(
long CPRuleAssetCategoryRelId, long assetCategoryId,
OrderByComparator<CPRuleAssetCategoryRel> orderByComparator)
throws com.liferay.commerce.product.exception.NoSuchCPRuleAssetCatego... | Create a Java method that does the following: "Returns the cp rule asset category rels before and after the current cp rule asset category rel in the ordered set.". |
Of course, here is the Java code you requested:
```java
public static Namespace convert(
final org.openbel.framework.common.model.Namespace ns) {
Namespace ws = OBJECT_FACTORY.createNamespace();
ws.setPrefix(ns.getPrefix());
ws.setResourceLocation(ns.getResourceLocation());
... | Create a Java method that does the following: "Converts a CRA to a CRA Namespace.". |
Of course, here is the Java code you requested:
```java
public boolean rename(Path src, Path dst) throws IOException {
return dfs.rename(getPathName(src), getPathName(dst));
}
```
Hope this helps! | Create a Java method that does the following: "Rename src to dst.". |
Of course, here is the Java code you requested:
```java
public ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry authorizeRequests()
throws Exception {
ApplicationContext context = getContext();
return getOrApply(new ExpressionUrlAuthorizationConfigurer<>(context))
.getRegist... | Create a Java method that does the following: "Get the registry that will be used to authorize requests.". |
Of course, here is the Java code you requested:
```java
public static boolean isUrl(String value) {
String check =
"^((https?|ftp):\\/\\/)?(((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:)*@)?(((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0... | Create a Java method that does the following: "Checks if the given value is a URL.". |
Of course, here is the Java code you requested:
```java
Map<String, Object> getExtendedProcessParameters() throws CoreException {
Serializable processParameters = getProcessParameters();
requireNonNull(processParameters);
Map<String, Object> actualParameters = new HashMap<>();
try {
... | Create a Java method that does the following: "Get the extended process parameters.". |
Of course, here is the Java code you requested:
```java
public static <T> T quantile(List<? extends T> data, Comparator<? super T> comparator, double quant) {
return quantile(data, comparator, 0, data.size(), quant);
}
```
Hope this helps! | Create a Java method that does the following: "Quantile method.". |
Of course, here is the Java code you requested:
```java
public static Bitmap getVideoThumbnail(String videoPath){
MediaMetadataRetriever mmr = new MediaMetadataRetriever();
mmr.setDataSource(videoPath);
return mmr.getFrameAtTime();
}
```
Hope this helps! | Create a Java method that does the following: "Get the thumbnail bitmap for a video file". |
Of course, here is the Java code you requested:
```java
private void loadParameters(String[] args)
{
for (int i = 0; (i < args.length) && args[i].startsWith("-"); i++)
{
String parameterName = args[i];
if (parameterName.equalsIgnoreCase("-key"))
privateKeyFil... | Create a Java method that does the following: "Load parameters from command line.". |
Of course, here is the Java code you requested:
```java
public Collection<String> getLogicTableNames(final String actualTableName) {
Collection<String> result = new LinkedList<>();
for (TableRule each : tableRules) {
if (each.isExisted(actualTableName)) {
result.add(each.get... | Create a Java method that does the following: "Gets the logic table names.". |
Of course, here is the Java code you requested:
```java
public static String ucumToUdunits(String ucum) {
if (ucum == null) {
return null;
}
StringBuilder udunits = new StringBuilder();
int ucLength = ucum.length();
if (ucLength == 0) {
return "";
... | Create a Java method that does the following: "Convert a ucum string to a UDUNITS string.". |
Of course, here is the Java code you requested:
```java
public static void endStringConversion(Builder methodBuilder, TypeName typeMirror) {
SQLTransform transform = SQLTransformer.lookup(typeMirror);
switch (transform.getColumnType()) {
case TEXT:
return;
case BLOB:
methodBuilder.addCode(",$T.UTF_8)", ... | Create a Java method that does the following: "End string conversion.". |
Of course, here is the Java code you requested:
```java
private void measureFloater() {
int specWidth = View.MeasureSpec.makeMeasureSpec(screenSize.x, View.MeasureSpec.EXACTLY);
int specHeight = View.MeasureSpec.makeMeasureSpec(screenSize.y, View.MeasureSpec.AT_MOST);
mPopupView.measure(specWid... | Create a Java method that does the following: "Measure the screen size of the popup view.". |
Of course, here is the Java code you requested:
```java
@Nonnull
@ReturnsMutableCopy
public static ICommonsList <Key> getAllKeys (@Nonnull final ColumnSet aColumnSet)
{
final ICommonsList <Key> ret = new CommonsArrayList<> ();
getAllKeys (aColumnSet, ret);
return ret;
}
```
Hope this helps! | Create a Java method that does the following: "Get all keys from the passed column set.". |
Of course, here is the Java code you requested:
```java
public Reference addOrder() { //3
Reference t = new Reference();
if (this.order == null)
this.order = new ArrayList<Reference>();
this.order.add(t);
return t;
}
```
Hope this helps! | Create a Java method that does the following: "Add this reference to the order list.". |
Of course, here is the Java code you requested:
```java
@Nullable
public String getAuthorizationUrl() throws UnsupportedEncodingException {
String authorizationCodeRequestUrl =
authorizationCodeFlow.newAuthorizationUrl().setScopes(scopes).build();
if (redirectUri != null) {
... | Create a Java method that does the following: "Get the authorization url.". |
Of course, here is the Java code you requested:
```java
public static void executeHelp(String[] args, PrintStream stream) throws IOException {
String subCmd = (args.length > 0) ? args[0] : "";
if(subCmd.equals("list")) {
SubCommandAsyncJobList.printHelp(stream);
} else if(subCmd.equ... | Create a Java method that does the following: "Execute the help command.". |
Of course, here is the Java code you requested:
```java
public static Scriptable getFunctionPrototype(Scriptable scope) {
return TopLevel.getBuiltinPrototype(getTopLevelScope(scope),
TopLevel.Builtins.Function);
}
```
Hope this helps! | Create a Java method that does the following: "Get the function prototype.". |
Of course, here is the Java code you requested:
```java
public final Map<String, Set<String>> getExtensionMimeMap() throws OSException {
initializeMimeExtensionArrays();
return Collections.unmodifiableMap(extensionMime);
}
```
Hope this helps! | Create a Java method that does the following: "Returns a map of mime types to the set of MIME types.". |
Of course, here is the Java code you requested:
```java
public static int shuffle(ByteBuffer input, BitShuffleType type, ByteBuffer shuffled) throws IOException {
if (!input.isDirect()) {
throw new SnappyError(SnappyErrorCode.NOT_A_DIRECT_BUFFER, "input is not a direct buffer");
}
i... | Create a Java method that does the following: "Shuffle the input buffer into the output buffer.". |
Of course, here is the Java code you requested:
```java
public void processPosition(float x, float y, float z) {
GVRScene scene = context.getMainScene();
if (scene != null) {
float depth = z * MAX_DEPTH;
float frustumWidth, frustumHeight;
// calculate the frustum usi... | Create a Java method that does the following: "Process position.". |
Of course, here is the Java code you requested:
```java
public WeeklyAutoScalingSchedule withSunday(java.util.Map<String, String> sunday) {
setSunday(sunday);
return this;
}
```
Hope this helps! | Create a Java method that does the following: "Sets the Sunday properties for the class file.". |
Of course, here is the Java code you requested:
```java
@Override
public boolean encrypt(InputStream publicKeyOfRecipient, InputStream privateKeyOfSender, String userIdOfSender, String passwordOfSendersPrivateKey, String inputDataName, InputStream plainInputData, OutputStream target) {
LOGGER.trace("encrypt(Inpu... | Create a Java method that does the following: "This method will encrypt the given input stream with the given output stream.". |
Of course, here is the Java code you requested:
```java
public IfcPipeFittingTypeEnum createIfcPipeFittingTypeEnumFromString(EDataType eDataType, String initialValue) {
IfcPipeFittingTypeEnum result = IfcPipeFittingTypeEnum.get(initialValue);
if (result == null)
throw new IllegalArgumentException(
"The... | Create a Java method that does the following: "Gets the IfcPipeFittingTypeEnum from the given String.". |
Of course, here is the Java code you requested:
```java
public int valueForXPosition(int xPos) {
int value;
int minValue = slider.getMinimum();
int maxValue = slider.getMaximum();
int trackLeft = trackRect.x + thumbRect.width / 2 + trackBorder;
int trackRight = trackRect.x + tra... | Create a Java method that does the following: "Get the value for the X position.". |
Of course, here is the Java code you requested:
```java
public final void ruleRuleID() throws RecognitionException {
int stackSize = keepStackSize();
try {
// InternalXtext.g:808:2: ( ( ( rule__RuleID__Group__0 ) ) )
// InternalXtext.g:809:2: ( ( rule__RuleID__Group... | Create a Java method that does the following: "Generates the code of ruleRuleID". |
Of course, here is the Java code you requested:
```java
static void setTraceSpec(TraceSpecification spec) {
if (spec == null)
return;
// We must have the lock to proceed
allTraceComponentsLock.lock();
try {
// Since we have the lock, we must process any new trac... | Create a Java method that does the following: "Sets the trace specification.". |
Of course, here is the Java code you requested:
```java
private void initialize(ComponentContext context,
Map<String, Object> properties, ConfigurationAdmin configAdmin)
throws InvalidFileStoreConfigurationException {
if (TraceComponent.isAnyTracingEnabled() && ... | Create a Java method that does the following: "Initialize the neccessary data structures for the neccessary data structures.". |
Of course, here is the Java code you requested:
```java
public static final <T extends Calendar> Function<T[], Interval> calendarFieldArrayToInterval(DateTimeZone dateTimeZone) {
return FnInterval.calendarFieldArrayToInterval(dateTimeZone);
}
```
Hope this helps! | Create a Java method that does the following: "Convert an array of calendar fields to an interval.". |
Of course, here is the Java code you requested:
```java
public final void setHasOptionsMenu(boolean hasOptionsMenu) {
boolean invalidate = attached && !optionsMenuHidden && this.hasOptionsMenu != hasOptionsMenu;
this.hasOptionsMenu = hasOptionsMenu;
if (invalidate) {
router.invali... | Create a Java method that does the following: "Sets whether the options menu should be displayed.". |
Of course, here is the Java code you requested:
```java
public static <T> Comparator<T> safeComparator(Comparator<? super T> baseComp, NullOrdering nullOrd) {
return nullOrd.toComparator(baseComp);
}
```
Hope this helps! | Create a Java method that does the following: "Returns a comparator that is safe to compare the given comparator.". |
Of course, here is the Java code you requested:
```java
protected String findPattern(String strPattern, String text, int grp) {
Pattern pattern = Pattern.compile(strPattern, Pattern.MULTILINE);
Matcher matcher = pattern.matcher(text);
if (matcher.find(0))
return matcher.group(grp);
return null... | Create a Java method that does the following: "Find a pattern in text.". |
Of course, here is the Java code you requested:
```java
private void refreshMetadataCache(final Queue<WindupMetadataSystem> metadataSystemCache, final DecompilerSettings settings)
{
metadataSystemCache.clear();
for (int i = 0; i < this.getNumberOfThreads(); i++)
{
metadataSystem... | Create a Java method that does the following: "Refresh the metadata cache.". |
Of course, here is the Java code you requested:
```java
public static String getClassType(Class expectedType) {
String classType = expectedType.getName();
if (expectedType.isPrimitive()) {
if (expectedType.equals(Boolean.TYPE)) {
classType = Boolean.class.getName();
... | Create a Java method that does the following: "Gets the class type from the expected type.". |
Of course, here is the Java code you requested:
```java
public void setVariable(String variableName, Object value, boolean fetchAllVariables) {
setVariable(variableName, value, getSourceActivityExecution(), fetchAllVariables);
}
```
Hope this helps! | Create a Java method that does the following: "Sets a variable in the activity execution.". |
Of course, here is the Java code you requested:
```java
private static Object _convertOrCoerceValue(FacesContext facesContext,
UIComponent uiComponent, Object value, SelectItem selectItem,
Converter converter)
{
Object itemValue = selectItem.getValue();
if (converter != null... | Create a Java method that does the following: "This method is used to convert the value of a select item to a value of a CDI type.". |
Of course, here is the Java code you requested:
```java
public Context getContext() {
if (context == null) {
context = Model.getSingleton().getSession().getContext(this.contextId);
}
return context;
}
```
Hope this helps! | Create a Java method that does the following: "Get the context.". |
Of course, here is the Java code you requested:
```java
@Override
public boolean contains(final String path) throws IllegalArgumentException {
Validate.notNull(path, "Path must be specified");
return this.contains(ArchivePaths.create(path));
}
```
Hope this helps! | Create a Java method that does the following: "Check if a resource contains a resource in the cache.". |
Of course, here is the Java code you requested:
```java
private Map<String, String> buildQueryParams(String queryFieldName, String queryFieldValue) {
checkNotNullAndEmpty(queryFieldValue, queryFieldName);
Map<String, String> queryParams = new TreeMap<>();
buildConfigParams(queryParams);
... | Create a Java method that does the following: "Build query params.". |
Of course, here is the Java code you requested:
```java
private boolean appendList(StringBuilder builder, Object value)
{
boolean isPresent = false;
if (value instanceof Collection)
{
Collection collection = ((Collection) value);
isPresent = true;
builder... | Create a Java method that does the following: "Append a list of CRAs to a StringBuilder.". |
Of course, here is the Java code you requested:
```java
public DbEntityColumnDescriptor findByColumnName(final String columnName) {
if (columnName == null) {
return null;
}
init();
for (DbEntityColumnDescriptor columnDescriptor : columnDescriptors) {
if (columnDescriptor.columnName.equalsIgnoreCase(colum... | Create a Java method that does the following: "Find by column name.". |
Of course, here is the Java code you requested:
```java
public static <T, C> RingBufferBuilder<T, C> withMultipleProducers( Executor executor,
ConsumerAdapter<T, C> adapter ) {
return new RingBufferBuilder<>(executor, adapter).multipleProd... | Create a Java method that does the following: "Create a RingBufferBuilder with multiple producers.". |
Of course, here is the Java code you requested:
```java
public ElasticsearchDomainStatus withEndpoints(java.util.Map<String, String> endpoints) {
setEndpoints(endpoints);
return this;
}
```
Hope this helps! | Create a Java method that does the following: "A map of endpoints to be used in the Elasticsearch domain.". |
Of course, here is the Java code you requested:
```java
public JSONObject updateActivity(String company, String team, String code, HashMap<String, String> params) throws JSONException {
return oClient.put("/otask/v1/tasks/companies/" + company + "/teams/" + team + "/tasks/" + code, params);
}
```
Hope thi... | Create a Java method that does the following: "Update activity". |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.