code stringlengths 160 48.7k | prompt stringlengths 55 1.51k |
|---|---|
Of course, here is the Java code you requested:
```java
public static RuntimeEnvironmentBuilder getDefault(String groupId, String artifactId, String version, String kbaseName, String ksessionName) {
KieServices ks = KieServices.Factory.get();
return getDefault(ks.newReleaseId(groupId, artifactId, version), k... | Create a Java method that does the following: "Get the default runtime environment builder.". |
Of course, here is the Java code you requested:
```java
public void setColor(final Color COLOR) {
if (null == color) {
_color = COLOR;
} else {
color.set(COLOR);
}
}
```
Hope this helps! | Create a Java method that does the following: "Sets the color of the exception.". |
Of course, here is the Java code you requested:
```java
public static Response post(String url, File file, String username, String password) throws URISyntaxException, HttpException {
return postMultiPart(new HttpPost(url), new FileBody(file), new UsernamePasswordCredentials(username, password), null);
}
`... | Create a Java method that does the following: "Perform a POST request to the specified URL with the specified file and username and password.". |
Of course, here is the Java code you requested:
```java
public void resetLink(String linkName)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "resetLink", linkName);
try
{
DestinationHandler link = linkIndex.findByName(linkName, n... | Create a Java method that does the following: "Resets the link with the specified name.". |
Of course, here is the Java code you requested:
```java
@Override
public IRingSet getRings(IAtom atom) {
IRingSet rings = new RingSet();
IRing ring;
for (int i = 0; i < getAtomContainerCount(); i++) {
ring = (Ring) getAtomContainer(i);
if (ring.contains(atom)) {
... | Create a Java method that does the following: "Get the rings of the given atom.". |
Of course, here is the Java code you requested:
```java
protected boolean sendProcessedTemplate(
Request.In event, IOSubchannel channel, String path) {
try {
// Get template (no need to continue if this fails).
Template tpl = freemarkerConfig().getTemplate(path);
... | Create a Java method that does the following: "Send processed template.". |
Of course, here is the Java code you requested:
```java
public ServiceFuture<ConnectionMonitorResultInner> beginCreateOrUpdateAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters, final ServiceCallback<ConnectionMonitorResultInner> serviceCallback) ... | Create a Java method that does the following: "Creates or updates a connection monitor.". |
Of course, here is the Java code you requested:
```java
public void setFormat(int formatElementIndex, Format newFormat) {
int formatNumber = 0;
for (int partIndex = 0; (partIndex = nextTopLevelArgStart(partIndex)) >= 0;) {
if (formatNumber == formatElementIndex) {
setCustomA... | Create a Java method that does the following: "Sets the format of the specified tag element.". |
Of course, here is the Java code you requested:
```java
@Beta
public static <T> T checkIsInstance(Class<T> class_, Object reference,
@Nullable String errorMessage) {
return checkIsInstance(class_, reference, errorMessage, EMPTY_ERROR_MESSAGE_ARGS);
}
```
Hope th... | Create a Java method that does the following: "Check if a class is an instance of the base class.". |
Of course, here is the Java code you requested:
```java
private void work() {
if (next.equals(END)) {
end();
} else {
Map<String, Object> params = processParams();
LOG.info("[RuleController] params = " + params);
SingleRxXian
.call(nex... | Create a Java method that does the following: "Work method.". |
Of course, here is the Java code you requested:
```java
public javax.slee.resource.ResourceAdaptorDescriptor getSpecsDescriptor() {
if (specsDescriptor == null) {
final LibraryID[] libraryIDs = descriptor.getLibraryRefs().toArray(new LibraryID[descriptor.getLibraryRefs().size()]);
final ResourceAdaptorTypeI... | Create a Java method that does the following: "Gets the SpecsDescriptor field from the ResourceAdaptorDescriptor.". |
Of course, here is the Java code you requested:
```java
@Override
public boolean doIsEquals(NormalAnnotationExpr first, NormalAnnotationExpr second) {
boolean equals = true;
if (!first.getName().equals(second.getName())) equals = false;
if (equals == true) {
if (first.getPairs() == null) return... | Create a Java method that does the following: "Override this method to check if two normal annotation expressions are equals.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public UsingRuleBuilder<T, U> using(String... factNames) {
Rule<T, U> rule = _name.map(name -> (Rule<T, U>)new AuditableRule<T, U>(newRule(), name)).orElse(newRule());
if (rule == null) {
throw new IllegalStateExcept... | Create a Java method that does the following: "Creates a new using rule builder.". |
Of course, here is the Java code you requested:
```java
public String getReadMethod() {
if ( getterName != null ) {
return getterName;
}
String prefix;
if ( "boolean".equals( this.type ) ) {
prefix = "is";
} else {
prefix = "get";
}
return... | Create a Java method that does the following: "Get the read method name.". |
Of course, here is the Java code you requested:
```java
private void pushInitialEventsAsync() {
postAsyncSafely("CleverTapAPI#pushInitialEventsAsync", new Runnable() {
@Override
public void run() {
try {
getConfigLogger().verbose(getAccountId(), "Queu... | Create a Java method that does the following: "Push initial events asynchronously". |
Of course, here is the Java code you requested:
```java
public static Runnable buildRunnableWithLogging(String runnableName,
Runnable runnable, Object... params) {
return () -> {
JMLog.debug(log, runnableName, System.currentTimeMillis(), params);
runnable.run();
};
... | Create a Java method that does the following: "Build runnable with logging.". |
Of course, here is the Java code you requested:
```java
public static cuComplex cuCmul (cuComplex x, cuComplex y)
{
cuComplex prod;
prod = cuCmplx ((cuCreal(x) * cuCreal(y)) - (cuCimag(x) * cuCimag(y)),
(cuCreal(x) * cuCimag(y)) + (cuCimag(x) * cuCreal(y)));
ret... | Create a Java method that does the following: "Returns the product of two complex numbers.". |
Of course, here is the Java code you requested:
```java
private void initDirectoryService(final File workDir) throws Exception {
// Initialize the LDAP service
Log.info(c, "initDirectoryService", "init");
this.service = new DefaultDirectoryService();
Log.info(c, "initDirectoryService", ... | Create a Java method that does the following: "Initialize the Directory Service.". |
Of course, here is the Java code you requested:
```java
public int getNrSelectedFeatures() {
int count = 0;
for (VectorLayer layer : getVectorLayers()) {
count += layer.getSelectedFeatures().size();
}
return count;
}
```
Hope this helps! | Create a Java method that does the following: "Get the number of selected features in the layer.". |
Of course, here is the Java code you requested:
```java
public void addMediaListener(JingleMediaListener li) {
for (ContentNegotiator contentNegotiator : contentNegotiators) {
if (contentNegotiator.getMediaNegotiator() != null) {
contentNegotiator.getMediaNegotiator().addListener(li... | Create a Java method that does the following: "Add a JingleMediaListener to all the content negotiators.". |
Of course, here is the Java code you requested:
```java
public static double evaluate( double x , double y , EllipseRotated_F64 ellipse ) {
double cphi = Math.cos(ellipse.phi);
double sphi = Math.sin(ellipse.phi);
x -= ellipse.center.x;
y -= ellipse.center.y;
double left = (x*cphi + y*sphi);
double righ... | Create a Java method that does the following: "Evaluates the rotation of the ellipse". |
Of course, here is the Java code you requested:
```java
@JsonProperty(value = "links")
public void setLinks(List<PageRequestLinkDto> links) {
if (links == null) {
this.links = new ArrayList<>();
} else {
this.links = links;
}
}
```
Hope this helps! | Create a Java method that does the following: "Sets the list of links for the application.". |
Of course, here is the Java code you requested:
```java
private boolean containsBlackPoint(int a, int b, int fixed, boolean horizontal) {
if (horizontal) {
for (int x = a; x <= b; x++) {
if (image.get(x, fixed)) {
return true;
}
}
} else {
for (int y = a; y <= b; y+... | Create a Java method that does the following: "Checks if the black points are contained in the image.". |
Of course, here is the Java code you requested:
```java
protected void decorateMenuEntry(CmsContextMenuEntry entry, String name, boolean checked) {
CmsContextMenuEntryBean bean = new CmsContextMenuEntryBean();
bean.setLabel(name);
bean.setActive(true);
bean.setVisible(true);
I_... | Create a Java method that does the following: "Decorate the context menu entry.". |
Of course, here is the Java code you requested:
```java
@Beta
public static <R, C, V> RowSortedTable<R, C, V> unmodifiableRowSortedTable(
RowSortedTable<R, ? extends C, ? extends V> table) {
/*
* It's not ? extends R, because it's technically not covariant in R. Specifically,
* table.rowMap().com... | Create a Java method that does the following: "Returns an unmodifiable RowSortedTable.". |
Of course, here is the Java code you requested:
```java
public void map(DocumentID key, DocumentAndOp value,
OutputCollector<DocumentID, DocumentAndOp> output, Reporter reporter)
throws IOException {
output.collect(key, value);
}
```
Hope this helps! | Create a Java method that does the following: "Map a
object to a single outputCollector.". |
Of course, here is the Java code you requested:
```java
private <T> T getAnnotationValue(String attribute, Class<T> type) {
Query annotation = method.getAnnotation(Query.class);
Object value = annotation == null ? AnnotationUtils.getDefaultValue(Query.class, attribute) : AnnotationUtils
.getValue(annotation, ... | Create a Java method that does the following: "Get the value of an annotation attribute.". |
Of course, here is the Java code you requested:
```java
static List<RequestObjectResolver> toRequestObjectResolvers(
List<RequestConverterFunction> converters) {
final ImmutableList.Builder<RequestObjectResolver> builder = ImmutableList.builder();
// Wrap every converters received from a us... | Create a Java method that does the following: "Converts a list of request object resolvers to a list of request object resolvers.". |
Of course, here is the Java code you requested:
```java
static public String makeValidCdmObjectName(String name) {
name = name.trim();
// common case no change
boolean ok = true;
for (int i = 0; i < name.length(); i++) {
int c = name.charAt(i);
if (c < 0x20) ok = false;
if (c =... | Create a Java method that does the following: "Make sure that the name is a valid CDM object name.". |
Of course, here is the Java code you requested:
```java
public void addUrlCopyListener(UrlCopyListener listener) {
if (listeners == null) listeners = new LinkedList();
listeners.add(listener);
}
```
Hope this helps! | Create a Java method that does the following: "Add a URL Copy Listener.". |
Of course, here is the Java code you requested:
```java
@Override
public CPDefinition findByUuid_Last(String uuid,
OrderByComparator<CPDefinition> orderByComparator)
throws NoSuchCPDefinitionException {
CPDefinition cpDefinition = fetchByUuid_Last(uuid, orderByComparator);
if (cpDefinition != null) {
retu... | Create a Java method that does the following: "Returns the last cp definition in the ordered set where uuid = ? ;.". |
Of course, here is the Java code you requested:
```java
public void markUsedElements(CodeReferenceMap publicRootSet) {
if (publicRootSet == null) {
markUsedElements();
return;
}
//Add all public methods in publicRootClasses to root set
for (String clazz : publicRootSet.getReferencedClasses(... | Create a Java method that does the following: "Mark all elements that are used by the code reference map.". |
Of course, here is the Java code you requested:
```java
@Override
public void initialize(InputSplit split) throws IOException, InterruptedException {
if (dataSource == null) {
throw new IllegalStateException("Cannot initialize : no datasource");
}
initializeJdbc();
}
```
Ho... | Create a Java method that does the following: "Initialize the database.". |
Of course, here is the Java code you requested:
```java
void expectAnyObject(Node n, JSType type, String msg) {
JSType anyObjectType = getNativeType(NO_OBJECT_TYPE);
if (!anyObjectType.isSubtypeOf(type) && !type.isEmptyType()) {
mismatch(n, msg, type, anyObjectType);
}
}
```
Hope this helps! | Create a Java method that does the following: "Expect type to be an object.". |
Of course, here is the Java code you requested:
```java
public String[] getNextPID(Context context, int numPIDs, String namespace)
throws ServerException {
return worker.getNextPID(context, numPIDs, namespace);
}
```
Hope this helps! | Create a Java method that does the following: "Get the next PID in the sequence.". |
Of course, here is the Java code you requested:
```java
public ThinPhysicalDatabaseParent getPDatabaseParent(Map<String,Object> properties, boolean bCreateIfNew)
{
return this.getEnvironment().getPDatabaseParent(properties, bCreateIfNew);
}
```
Hope this helps! | Create a Java method that does the following: "Get the physical database parent.". |
Of course, here is the Java code you requested:
```java
public Mail findMail(int id) {
if (items == null) {
return null;
}
for (Mail m : items) {
if (m.getId() == id) {
return m;
}
}
return null;
}
```
Hope this helps! | Create a Java method that does the following: "Find a mail by its id.". |
Of course, here is the Java code you requested:
```java
public String format(String json) {
String result = null;
if (json != null){
if (json.startsWith("{")) {
result = new JSONObject(json).toString(4);
} else if (json.startsWith("[")) {
JSONObje... | Create a Java method that does the following: "Format a json string.". |
Of course, here is the Java code you requested:
```java
public void actionPerformed(ActionEvent evt)
{
Component component = (Component)evt.getSource();
String strMessage = component.getName();
if (strMessage == null)
{
strMessage = evt.getActionCommand();
Ac... | Create a Java method that does the following: "The actionPerformed method is called to handle the action event.". |
Of course, here is the Java code you requested:
```java
public final void fatalError(String message, Throwable throwable)
{
if (isFatalErrorEnabled())
{
out.print( "[ maven embedder FATAL ERROR] " );
out.println( message );
if (null != throwable)
{
... | Create a Java method that does the following: "Print fatal error message and throwable.". |
Of course, here is the Java code you requested:
```java
public static byte[] zip(Map<String, List<String>> namesMap, Map<String, List<byte[]>> contentsMap) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
// Create the ZIP file
ZipOutputStream out = new ZipOutputS... | Create a Java method that does the following: "Zip the given map of files to byte array.". |
Of course, here is the Java code you requested:
```java
public String replaceFileTemplate(String filespec, int ensIndex) {
return filespec.replaceAll(ENS_TEMPLATE_ID,
getEnsembleNames().get(ensIndex));
}
```
Hope this helps! | Create a Java method that does the following: "Replaces the file template with the name of the specified ensemble.". |
Of course, here is the Java code you requested:
```java
private GeometryCollection asGeomCollection(CrsId crsId) throws IOException {
try {
String subJson = getSubJson("geometries", "A geometrycollection requires a geometries parameter")
.replaceAll(" ", "");
String ... | Create a Java method that does the following: "Returns a geometrycollection object from the json file.". |
Of course, here is the Java code you requested:
```java
public void setOnPremisesInstanceTagFilters(java.util.Collection<TagFilter> onPremisesInstanceTagFilters) {
if (onPremisesInstanceTagFilters == null) {
this.onPremisesInstanceTagFilters = null;
return;
}
this.onPre... | Create a Java method that does the following: "Sets the value of the onPremisesInstanceTagFilters property.". |
Of course, here is the Java code you requested:
```java
protected AstNode parseCreateProcedureStatement( DdlTokenStream tokens,
AstNode parentNode ) throws ParsingException {
assert tokens != null;
assert parentNode != null;
markStartOfState... | Create a Java method that does the following: "Parse a CREATE PROCEDURE statement.". |
Of course, here is the Java code you requested:
```java
protected final PrcUsedMaterialLineSave<RS> lazyGetPrcUsedMaterialLineSave(
final Map<String, Object> pAddParam) throws Exception {
@SuppressWarnings("unchecked")
PrcUsedMaterialLineSave<RS> proc = (PrcUsedMaterialLineSave<RS>)
this.processorsMa... | Create a Java method that does the following: "Get a PrcUsedMaterialLineSave object from the database.". |
Of course, here is the Java code you requested:
```java
private void handleNewStreamID(AbstractMessage aMessage, MessageItem msgItem) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "handleNewStreamID", new Object[] { aMessage, msgItem });
... | Create a Java method that does the following: "Handle a new stream ID.". |
Of course, here is the Java code you requested:
```java
public CreateTableRequest withGlobalSecondaryIndexes(GlobalSecondaryIndex... globalSecondaryIndexes) {
if (this.globalSecondaryIndexes == null) {
setGlobalSecondaryIndexes(new java.util.ArrayList<GlobalSecondaryIndex>(globalSecondaryIndexes.le... | Create a Java method that does the following: "A list of global secondary indexes to use for this table.". |
Of course, here is the Java code you requested:
```java
@Override
public CrawlSession call() {
setMaximumCrawlTimeIfNeeded();
plugins.runPreCrawlingPlugins(config);
CrawlTaskConsumer firstConsumer = consumerFactory.get();
StateVertex firstState = firstConsumer.crawlIndex();
crawlSessionProvider.setup(firstS... | Create a Java method that does the following: "Call the CrawlSessionProvider.". |
Of course, here is the Java code you requested:
```java
public void cancelDiscovery() {
mHandler.removeCallbacks(scanTimeoutCallback);
if (mScanning) {
Log.i(TAG, "Cancelling discovery process");
BluetoothAdapter.getDefaultAdapter().stopLeScan(mCallback);
mScanning ... | Create a Java method that does the following: "Cancel discovery process.". |
Of course, here is the Java code you requested:
```java
@NonNull
public static Expression negated(@NonNull Expression expression) {
if (expression == null) {
throw new IllegalArgumentException("expression cannot be null.");
}
return new CompoundExpression(Arrays.asList(expressio... | Create a Java method that does the following: "Creates a negated expression from the given expression.". |
Of course, here is the Java code you requested:
```java
public void setMinProgress(final float minProgress) {
if (composition == null) {
lazyCompositionTasks.add(new LazyCompositionTask() {
@Override
public void run(LottieComposition composition) {
setMinProgress(minProgress);
... | Create a Java method that does the following: "Sets the minimum progress of the generated code.". |
Of course, here is the Java code you requested:
```java
static Subject createSubject(final SubjectFactory subjectFactory, final String domain)
{
if (System.getSecurityManager() == null)
return subjectFactory.createSubject(domain);
return AccessController.doPrivileged(new PrivilegedAction<Subje... | Create a Java method that does the following: "Create a Subject from a domain name.". |
Of course, here is the Java code you requested:
```java
public boolean finish() {
// make topDataset if needed
//if (topDataset == null) {
if (datasets.size() == 1) { // already only one; make it top
topDataset = (InvDatasetImpl) datasets.get(0);
} else { // create one
topDataset = new I... | Create a Java method that does the following: "Finish the catalog by adding all the datasets to the internal hash table.". |
Of course, here is the Java code you requested:
```java
@Override
public String hash(String input, Hash hashType) {
Preconditions.checkNotNull(input);
Preconditions.checkNotNull(hashType);
try {
MessageDigest m = MessageDigest.getInstance(hashType.toString());
byte[]... | Create a Java method that does the following: "Implementation of the hash method.". |
Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final <B> Observable<Observable<T>> window(Callable<? extends ObservableSource<B>> boundary, int bufferSize) {
ObjectHelper.requireNonNull(boundary, "boundary is null");
Obj... | Create a Java method that does the following: "Creates an observable that is windowed using the specified boundary function.". |
Of course, here is the Java code you requested:
```java
public com.google.protobuf.ByteString
getOperationBytes() {
java.lang.Object ref = operation_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(jav... | Create a Java method that does the following: "Gets the operation bytes.". |
Of course, here is the Java code you requested:
```java
Map<String, List<String>> getBlackListedTrackers() {
Map<String, List<String>> blackListedTrackers
= new HashMap<String, List<String>>();
for (Map.Entry<String,List<String>> e : trackerToFailuresMap.entrySet()) {
if (e.getValue().size() >... | Create a Java method that does the following: "Get black listed trackers". |
Of course, here is the Java code you requested:
```java
public final boolean roll(final LoggingEvent loggingEvent) {
boolean rolled = false;
this.takeTimeSample(loggingEvent);
final long nextRolloverTime = this.getNextRolloverTimeMillis();
if (this.isRolloverDue(nextRolloverTime)) {
super.roll(th... | Create a Java method that does the following: "Roll the logging event to the next roll time.". |
Of course, here is the Java code you requested:
```java
public void marshall(BatchGetRepositoriesRequest batchGetRepositoriesRequest, ProtocolMarshaller protocolMarshaller) {
if (batchGetRepositoriesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
... | Create a Java method that does the following: "Creates the given parameter object.". |
Of course, here is the Java code you requested:
```java
public Object invoke(Object proxy,Method method,Object[] arguments) throws Throwable
{
//invoke interceptors
this.invokeInterceptors(FaxClientSpiProxyEventType.PRE_EVENT_TYPE,method,arguments,null,null);
Object output=null;
... | Create a Java method that does the following: "This method is called to invoke the method in the fax client SPI.". |
Of course, here is the Java code you requested:
```java
@Override
public void processArguments(String[] args) throws IOException {
List<File> classFiles = new ArrayList<File>();
List<File> jarFiles = new ArrayList<File>();
String[] fileArgs = null;
for (int i = 0; i < args.length; ... | Create a Java method that does the following: "Process command line arguments.". |
Of course, here is the Java code you requested:
```java
public void setExcludeFromContextRegexs(List<String> excludeRegexs) {
validateRegexs(excludeRegexs);
// Check if theyve been changed
if (excludeFromRegexs.size() == excludeRegexs.size()) {
boolean changed = false;
for (int i = 0; i < excludeFromR... | Create a Java method that does the following: "Sets the list of exclude patterns that should be excluded from the source file.". |
Of course, here is the Java code you requested:
```java
public static Bundle of(String key, long value) {
Bundle b = new Bundle(1);
b.putLong(key, value);
return b;
}
```
Hope this helps! | Create a Java method that does the following: "Create a Bundle with a String key and long value.". |
Of course, here is the Java code you requested:
```java
public static boolean isNonWhitespaceControlCharacter(@NonNull byte[] b) {
ByteBuffer head = ByteBuffer.allocate(DEFAULT_PROBE_SIZE);
int toCopy = Math.min(head.remaining(), b.length);
if (toCopy == 0) {
throw new IllegalStateE... | Create a Java method that does the following: "Checks if a byte array is a non - whitespace control character.". |
Of course, here is the Java code you requested:
```java
private void defineReadBridgeMethod()
{
classDefinition.addMethod(
new MethodDefinition(a(PUBLIC, BRIDGE, SYNTHETIC), "read", type(Object.class), arg("protocol", TProtocol.class))
.addException(Exception.class)
... | Create a Java method that does the following: "Define the read bridge method.". |
Of course, here is the Java code you requested:
```java
public SpanData toSpanData() {
synchronized (this) {
SpanData.Attributes attributesSpanData =
attributes == null
? SpanData.Attributes.create(Collections.<String, AttributeValue>emptyMap(), 0)
: SpanData.Attributes.... | Create a Java method that does the following: "Converts this Span to a SpanData object.". |
Of course, here is the Java code you requested:
```java
private void setReadTimeout(javax.ws.rs.client.Client client)
{
// The timeout value.
int timeout = mSettings.getReadTimeout();
synchronized (mReadTimeoutLock)
{
if (mCurrentReadTimeout == timeout)
{
... | Create a Java method that does the following: "Sets the read timeout value for the CXF resource.". |
Of course, here is the Java code you requested:
```java
public Result<String> extractRawText(InputStream stream) throws IOException {
return new InternalDocumentConverter(options).extractRawText(stream).toResult();
}
```
Hope this helps! | Create a Java method that does the following: "Extract raw text from an input stream.". |
Of course, here is the Java code you requested:
```java
@Override
public <T extends Serializable, S extends Individual<T,S>> T firstIndividual(final Class<? extends S> clazz) {
Property property=getProperty();
if(property==null) {
return null;
}
IndividualExtractor<T,S> extractor=IndividualExtractor.newIns... | Create a Java method that does the following: "Returns the first individual of this object.". |
Of course, here is the Java code you requested:
```java
static void configure(final JewelCliLoggingOptions opts) {
// Use logback config file to setup logging if specified, discarding any other logging options.
if (!opts.logFileName().isEmpty()) {
configure(new File(opts.logFileName()), opts.ident());
... | Create a Java method that does the following: "Configure the logging system.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
private static <T> T getCachedReference(Project project, String key, Supplier<T> supplier) {
if (project == null) {
throw new IllegalArgumentException("Gradle project reference cannot be null.");
}
... | Create a Java method that does the following: "Get a cached reference from the project.". |
Of course, here is the Java code you requested:
```java
public final String getStartFormattedMedium() {
Granularity startGran = this.interval.getStartGranularity();
return formatStart(startGran != null ? startGran.getMediumFormat()
: null);
}
```
Hope this helps! | Create a Java method that does the following: "Get the start formatted medium.". |
Of course, here is the Java code you requested:
```java
public ExpressRouteConnectionInner beginCreateOrUpdate(String resourceGroupName, String expressRouteGatewayName, String connectionName, ExpressRouteConnectionInner putExpressRouteConnectionParameters) {
return beginCreateOrUpdateWithServiceResponseAsync(r... | Create a Java method that does the following: "Creates or updates an ExpressRouteConnection.". |
Of course, here is the Java code you requested:
```java
private Optional<Long> getLongValue(String path) {
String stringValue = getStringValue(path);
if (stringValue == null) {
return Optional.absent();
} else {
try {
return Optional.<Long> of(Long.value... | Create a Java method that does the following: "Gets the Long value from the path.". |
Of course, here is the Java code you requested:
```java
public Object get(String key) {
return PER_THREAD_CONTEXTS.getUnchecked(Thread.currentThread()).get(key);
}
```
Hope this helps! | Create a Java method that does the following: "Get the value of the specified key from the cache.". |
Of course, here is the Java code you requested:
```java
@Override
public void unsafe_set(int row, int col, double value) {
int index = nz_index(row,col);
if( index < 0 )
addItem( row,col,value);
else {
nz_value.data[index] = value;
}
}
```
Hope this help... | Create a Java method that does the following: "Set the value of a single attribute.". |
Of course, here is the Java code you requested:
```java
@Override
public Object[] findIdsByColumn(String schemaName, String tableName, String pKeyName, String columnName,
Object columnValue, Class entityClazz)
{
return getColumnsById(schemaName, tableName, columnName, pKeyName, columnValue,... | Create a Java method that does the following: "Find ids by column.". |
Of course, here is the Java code you requested:
```java
public static int getNumericType(Object value)
{
if (value != null) {
Class c = value.getClass();
if (c == Integer.class) return INT;
if (c == Double.class) return DOUBLE;
if (c == Boolean.class) return ... | Create a Java method that does the following: "Get the numeric type of the object.". |
Of course, here is the Java code you requested:
```java
public static CharSequence getHelp(final long _cmdId)
{
CharSequence ret;
try {
final Class<?> clazz = Class.forName(Configuration.getAttribute(Configuration.ConfigAttribute.HELPSNIPPROV),
false, EFapsCl... | Create a Java method that does the following: "Get the help for a command.". |
Of course, here is the Java code you requested:
```java
public WebElementFinder noLogging(final boolean theNoLogging) {
Fields fields = new Fields(this);
fields.noLogging = theNoLogging;
return new WebElementFinder(fields);
}
```
Hope this helps! | Create a Java method that does the following: "Create a WebElementFinder object that will not log messages to the console.". |
Of course, here is the Java code you requested:
```java
public static <T> T toBean(Reader jsonReader, Class<T> clazz) {
if (clazz == null || jsonReader == null)
return null;
return toBean(new MyJsonParser(jsonReader), clazz);
}
```
Hope this helps! | Create a Java method that does the following: "Convert a JSON reader to a Java Bean.". |
Of course, here is the Java code you requested:
```java
public CmsLockFilter filterNotLockableByUser(CmsUser user) {
CmsLockFilter filter = (CmsLockFilter)clone();
filter.m_notLockableByUser = user;
return filter;
}
```
Hope this helps! | Create a Java method that does the following: "Returns a filter that only accepts locks owned by the given user.". |
Of course, here is the Java code you requested:
```java
public String addOffering(Offering offering) {
this.offeringsCollection.insertOne(offering.toDBObject());
this.offeringNames.add(offering.getName());
return offering.getName();
}
```
Hope this helps! | Create a Java method that does the following: "Add an offering to the application.". |
Of course, here is the Java code you requested:
```java
private String getIndex() {
try {
return parseMandatoryStringValue(XML_ELEMENT_INDEX);
} catch (final Exception e) {
LOG.info(Messages.get().getBundle().key(Messages.LOG_NO_INDEX_SPECIFIED_0), e);
return null;
... | Create a Java method that does the following: "Gets the index.". |
Of course, here is the Java code you requested:
```java
@Override
public <V> V execute(Tenant tenant, Supplier<V> supplier) {
return TenantContextDataHolder.execute(tenant, supplier);
}
```
Hope this helps! | Create a Java method that does the following: "Override this method to execute the sequence of code.". |
Of course, here is the Java code you requested:
```java
public boolean hasItemData(NodeData parentData, QPathEntry name, ItemType itemType) throws RepositoryException,
IllegalStateException
{
Statistics s = ALL_STATISTICS.get(HAS_ITEM_DATA_DESCR);
try
{
s.begin();
return wc... | Create a Java method that does the following: "Check if item data exists in parent node.". |
Of course, here is the Java code you requested:
```java
static void unescapePrintf(StringBuilder out, String message, int start, int end) {
int pos = start;
while (pos < end) {
if (message.charAt(pos++) != '%') {
continue;
}
if (pos == end) {
// Ignore unexpected trailing '%'.... | Create a Java method that does the following: "Unescapes a single - escaped printf from the given message.". |
Of course, here is the Java code you requested:
```java
private static SyntacticItem substitute(SyntacticItem item, SyntacticItem from, SyntacticItem to,
Map<SyntacticItem, SyntacticItem> mapping) {
SyntacticItem sItem = mapping.get(item);
if (sItem != null) {
// We've previously substituted this item alread... | Create a Java method that does the following: "Substitute the given item in the given mapping.". |
Of course, here is the Java code you requested:
```java
@Override
public void removeByUuid(String uuid) {
for (CommerceVirtualOrderItem commerceVirtualOrderItem : findByUuid(
uuid, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceVirtualOrderItem);
}
}
```
Hope this helps! | Create a Java method that does the following: "Removes the commerce virtual order items with the matching UUID.". |
Of course, here is the Java code you requested:
```java
public static CompilerResults run(CompilerOptions options, List<String> objectNames, Collection<File> tplFiles) {
return (new Compiler(options, objectNames, tplFiles)).process();
}
```
Hope this helps! | Create a Java method that does the following: "Run the compiler.". |
Of course, here is the Java code you requested:
```java
public static <T extends Throwable> WaitStrategy exceptionWait(@Nonnull Class<T> exceptionClass,
@Nonnull Function<T, Long> function) {
Preconditions.checkNotNull(exceptionClass, "exceptio... | Create a Java method that does the following: "Create a wait strategy that waits for an exception of the specified type.". |
Of course, here is the Java code you requested:
```java
private void validateRelationType(RelationType relationType) {
ValidateGlobalRules.validateHasMinimumRoles(relationType).ifPresent(errorsFound::add);
errorsFound.addAll(ValidateGlobalRules.validateRelationTypesToRolesSchema(relationType));
}
`... | Create a Java method that does the following: "Validate relation type.". |
Of course, here is the Java code you requested:
```java
private Diagram loadDiagram(InputStream in, boolean offset)
throws SlickException {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory
.newInstance();
factory.setValidating(false);
factory.setNamespaceAware(true);
Documen... | Create a Java method that does the following: "Creates a Diagram object from an input stream.". |
Of course, here is the Java code you requested:
```java
public static <E> Multiset<E> intersection(
final Multiset<E> multiset1, final Multiset<?> multiset2) {
checkNotNull(multiset1);
checkNotNull(multiset2);
return new AbstractMultiset<E>() {
@Override
public int count(Object element) ... | Create a Java method that does the following: "Get the intersection of two Multiset objects.". |
Of course, here is the Java code you requested:
```java
public boolean moveTargetPosition(float[] npos, NavMeshQuery navquery, QueryFilter filter) {
// Move along navmesh and update new position.
Result<MoveAlongSurfaceResult> masResult = navquery.moveAlongSurface(m_path.get(m_path.size() - 1), m_targe... | Create a Java method that does the following: "Move the target position of the Corridor.". |
Of course, here is the Java code you requested:
```java
private void recursiveDump(Node n, int level, PrintWriter p)
{
//Opening tag
if (n.getNodeType() == Node.ELEMENT_NODE)
{
String tag = "";
Element el = (Element) n;
//do not dump original styl... | Create a Java method that does the following: "Recursive dump method.". |
Of course, here is the Java code you requested:
```java
@Nonnull
public static EChange setResponseCompressionEnabled (final boolean bResponseCompressionEnabled)
{
return s_aRWLock.writeLocked ( () -> {
if (s_bResponseCompressionEnabled == bResponseCompressionEnabled)
return EChange.UNCHANGED;
... | Create a Java method that does the following: "Set the response compression enabled.". |
Of course, here is the Java code you requested:
```java
private String _get_date(S sequence) {
Date sysdate = Calendar.getInstance().getTime();
// String default_date =
// sysdate.get(Calendar.DAY_OF_MONTH)+"-"+sysdate.get(Calendar.MONTH)+"-"+sysdate.get(Calendar.YEAR);
String default_date = new SimpleDateFor... | Create a Java method that does the following: "Get the date of the sequence.". |
Of course, here is the Java code you requested:
```java
@Exported
public int getProgress() {
long d = executableEstimatedDuration;
if (d <= 0) {
return DEFAULT_ESTIMATED_DURATION;
}
int num = (int) (getElapsedTime() * 100 / d);
if (num >= 100) {
num ... | Create a Java method that does the following: "Get the progress of the exception.". |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.