code stringlengths 146 48.7k | prompt stringlengths 55 1.51k |
|---|---|
Of course, here is the Java code you requested:
```java
private AttributesImpl getPseudoAttributesFromPiData(String buf)
throws SAXException {
int state = BEFORE_ATTRIBUTE_NAME;
int returnState = BEFORE_ATTRIBUTE_NAME;
char c = '\u0000';
int pos = -1;
int endPos = b... | Create a Java method that does the following: "Get attributes from the input string.". |
Of course, here is the Java code you requested:
```java
public final IDigest create (final String digestName) {
IDigest digest;
if (digestName.compareTo("None") == 0) {
digest = new NullDigest();
} else if (digestName.compareTo("CRC32C") == 0) {
digest = new CRC32CDiges... | Create a Java method that does the following: "Create a IDigest object.". |
Of course, here is the Java code you requested:
```java
public String readString(HKey hk, String key, String valueName, String charsetName) throws RegistryException {
try {
return ReflectedMethods.readString(hk.root(), hk.hex(), key, valueName, charsetName);
} catch (Exception e) {
throw new RegistryExce... | Create a Java method that does the following: "Reads a string value from the given HKey.". |
Of course, here is the Java code you requested:
```java
@Override
public void saveRDD(T t) {
try {
this.jdbcWriter.save(transformElement(t));
} catch(Exception e) {
throw new DeepGenericException("Error while writing row", e);
}
}
```
Hope this helps! | Create a Java method that does the following: "Saves a single row to the database.". |
Of course, here is the Java code you requested:
```java
@Override
public GetPlaybackConfigurationResult getPlaybackConfiguration(GetPlaybackConfigurationRequest request) {
request = beforeClientExecution(request);
return executeGetPlaybackConfiguration(request);
}
```
Hope this helps! | Create a Java method that does the following: "Retrieves the current playback configuration for a specific language.". |
Of course, here is the Java code you requested:
```java
public MeteoData<TextLocationWeather> fetchContent(double longitude, double latitude, TextLocationLanguage language)
throws MeteoException {
MeteoResponse response = getMeteoClient().fetchContent(
createServiceUriBuilder()
... | Create a Java method that does the following: "Fetch content from Meteo.". |
Of course, here is the Java code you requested:
```java
public static BookmarkablePageLink<String> newBookmarkablePageLink(final String linkId,
final Class<? extends Page> pageClass, final String labelId,
final ResourceBundleKey resourceModelKey, final Component component)
{
final BookmarkablePageLink<Strin... | Create a Java method that does the following: "Create a new bookmarkable page link.". |
Of course, here is the Java code you requested:
```java
public void setImportedNamespace(String newImportedNamespace)
{
String oldImportedNamespace = importedNamespace;
importedNamespace = newImportedNamespace;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XtypePackage.XI... | Create a Java method that does the following: "Sets the value of the importedNamespace property.". |
Of course, here is the Java code you requested:
```java
public Observable<Void> createAsync(String faceListId, CreateFaceListsOptionalParameter createOptionalParameter) {
return createWithServiceResponseAsync(faceListId, createOptionalParameter).map(new Func1<ServiceResponse<Void>, Void>() {
@Overr... | Create a Java method that does the following: "Creates a CDN image in an App Service Environment.". |
Of course, here is the Java code you requested:
```java
public double[] applyRelativeInverse(double[] v) {
if(inv == null) {
updateInverse();
}
return unhomogeneRelativeVector(times(inv, homogeneRelativeVector(v)));
}
```
Hope this helps! | Create a Java method that does the following: "Applies the inverse of the vector v to this vector.". |
Of course, here is the Java code you requested:
```java
public void setTimeStamp(final String timeStamp)
{
String time = timeStamp.replace('T', ' ');
time = time.replace('Z', ' ');
this.timeStamp = Timestamp.valueOf(time);
}
```
Hope this helps! | Create a Java method that does the following: "Sets the timeStamp.". |
Of course, here is the Java code you requested:
```java
protected <T> JsonObjectBase buildListSuccess(List<?> value, int totalCount) {
return JsonObjectUtils.buildListSuccess(value, totalCount, null);
}
```
Hope this helps! | Create a Java method that does the following: "Build a list of objects that are successful.". |
Of course, here is the Java code you requested:
```java
protected int chooseShrinkCapacity(int size, double minLoad, double maxLoad) {
return nextPrime(Math.max(size+1, (int) ((4*size / (minLoad+3*maxLoad)))));
}
```
Hope this helps! | Create a Java method that does the following: "Returns a random capacity that is the largest possible number of elements that can be used to shrink the given size.". |
Of course, here is the Java code you requested:
```java
public static boolean notMatches(String value, String prefix, String middle,
String postfix) {
return !matches(value, prefix, middle, postfix);
}
```
Hope this helps! | Create a Java method that does the following: "Returns true if the value does not match the prefix middle and postfix.". |
Of course, here is the Java code you requested:
```java
public static String generateFastaFromRNAPolymer(List<PolymerNotation> polymers)
throws FastaFormatException, ChemistryException {
StringBuilder fasta = new StringBuilder();
for (PolymerNotation polymer : polymers) {
String header = polymer.getPolym... | Create a Java method that does the following: "method to generate Fasta from RNA PolymerNotation". |
Of course, here is the Java code you requested:
```java
private void log(boolean finalLog, String format, Object... args) {
if (m_condition){
if (format != null ){
m_logger.debug(String.format(format, args));
}
ArrayList<String> timerNames = new ArrayList<String>(m_timers.keySet());
Collections... | Create a Java method that does the following: "Logs the data in the data structure.". |
Of course, here is the Java code you requested:
```java
public Post blogPost(String blogName, Long postId) {
HashMap<String, String> options = new HashMap<String, String>();
options.put("id", postId.toString());
List<Post> posts = this.blogPosts(blogName, options);
return posts.size() >... | Create a Java method that does the following: "Get a post by ID". |
Of course, here is the Java code you requested:
```java
public String wholeText() {
final StringBuilder accum = StringUtil.borrowBuilder();
NodeTraversor.traverse(new NodeVisitor() {
public void head(Node node, int depth) {
if (node instanceof TextNode) {
... | Create a Java method that does the following: "This method returns the whole text of this tag.". |
Of course, here is the Java code you requested:
```java
protected void destroyBean(final BeanData beanData) {
if (destroyableBeans == null) {
return;
}
if (!isBeanDestroyable(beanData)) {
return;
}
if (destroyableBeans.remove(beanData)) {
beanData.callDestroyMethods();
}
}
```
Hope this helps! | Create a Java method that does the following: "Destroy a bean.". |
Of course, here is the Java code you requested:
```java
@Override
public <T extends Serializable> T get(Object key, T defaultValue) {
throw new UnsupportedOperationException("DeltaMap must only be read in bulk.");
}
```
Hope this helps! | Create a Java method that does the following: "Get a value from the delta map.". |
Of course, here is the Java code you requested:
```java
protected Fabric.Transaction.Builder createTransactionBuilder(
Chaincode.ChaincodeSpec.Type ccType,
Fabric.Transaction.Type transactionType,
String name,
List<String> args,
byte[] codePackage,
String txId,
String chaincodePath) throws Crypt... | Create a Java method that does the following: "Create a new transaction builder". |
Of course, here is the Java code you requested:
```java
protected void writeFile(String subdir, String filename, String content) throws IOException {
Path dir = root;
if (subdir != null) {
dir = dir.resolve(subdir);
// If the dir does not exist, we need to create it
... | Create a Java method that does the following: "Write the file.". |
Of course, here is the Java code you requested:
```java
@NonNull protected ActivityMvpDelegate<V, P> getMvpDelegate() {
if (mvpDelegate == null) {
mvpDelegate = new ActivityMvpDelegateImpl(this, this, true);
}
return mvpDelegate;
}
```
Hope this helps! | Create a Java method that does the following: "Get the MVP delegate.". |
Of course, here is the Java code you requested:
```java
public EEnum getIfcFlowInstrumentTypeEnum() {
if (ifcFlowInstrumentTypeEnumEEnum == null) {
ifcFlowInstrumentTypeEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(840);
}
return ifcFlowI... | Create a Java method that does the following: "Get the EEnum object that corresponds to the 87869. 1. 1". |
Of course, here is the Java code you requested:
```java
@Override
protected void uploadTusFiles() throws IOException, ProtocolException {
setState(State.UPLOADING);
while (uploads.size() > 0) {
final TusUploader tusUploader;
// don't recreate uploader if it already exists.
... | Create a Java method that does the following: "Upload the Tus files.". |
Of course, here is the Java code you requested:
```java
int mapPosition(int position) {
int out = position;
for (int delta : positionDeltas.headMap(position, true).values()) {
out += delta;
}
return out;
}
```
Hope this helps! | Create a Java method that does the following: "Returns the position of the map.". |
Of course, here is the Java code you requested:
```java
public int read(byte b[], int off, int len) throws IOException {
if (pos >= this.len) {
// EOF
return -1;
}
int num = (int) Math.min(len - off, this.len - pos);
in.readBytes(b, off, num);
pos += num;... | Create a Java method that does the following: "read a single record from the input stream.". |
Of course, here is the Java code you requested:
```java
PathAddress toPathAddress(final ObjectName name) {
return ObjectNameAddressUtil.toPathAddress(rootObjectInstance.getObjectName(), getRootResourceAndRegistration().getRegistration(), name);
}
```
Hope this helps! | Create a Java method that does the following: "Converts an ObjectName to a PathAddress.". |
Of course, here is the Java code you requested:
```java
public String decrypt(String data) throws UnsupportedEncodingException, NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidAlgorithmParameterException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException {
if... | Create a Java method that does the following: "Decrypt a string.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
@Override
public T read(JsonReader in) throws IOException {
List<Exception> exceptions = new ArrayList<>(subtypes.length);
ReaderSupplier readerSupplier = readForSupplier(in);
for (TypeAdapter<?> typeAdapter : adapte... | Create a Java method that does the following: "Reads a single IDIVCARD from the given JSON reader.". |
Of course, here is the Java code you requested:
```java
public static Stats of(Iterable<? extends Number> values) {
StatsAccumulator accumulator = new StatsAccumulator();
accumulator.addAll(values);
return accumulator.snapshot();
}
```
Hope this helps! | Create a Java method that does the following: "Creates a Stats object from the given Iterable of numbers.". |
Of course, here is the Java code you requested:
```java
@Override
public void setContent(final InputStream content, final String contentType,
final Collection<URI> checksums, final String originalFileName,
final StoragePolicyDecisionPoint storagePolicyDecisionP... | Create a Java method that does the following: "Set the content of the CRA - 2A tag.". |
Of course, here is the Java code you requested:
```java
public static String generateMchPayNativeReplyXML(MchPayNativeReply mchPayNativeReply, String key) {
Map<String, String> map = MapUtil.objectToMap(mchPayNativeReply);
String sign = SignatureUtil.generateSign(map, key);
mchPayNativeReply.setSign(sign);
... | Create a Java method that does the following: "Generate MchPayNativeReply XML string.". |
Of course, here is the Java code you requested:
```java
public void marshall(ListContainersRequest listContainersRequest, ProtocolMarshaller protocolMarshaller) {
if (listContainersRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {... | Create a Java method that does the following: "Creates the marshalling method for the ANSCTYPE service.". |
Of course, here is the Java code you requested:
```java
public WindowedStream<T, KEY, GlobalWindow> countWindow(long size) {
return window(GlobalWindows.create()).trigger(PurgingTrigger.of(CountTrigger.of(size)));
}
```
Hope this helps! | Create a Java method that does the following: "Returns a stream of the given size of windows with purging triggers.". |
Of course, here is the Java code you requested:
```java
private Object parseRelationship(JsonNode relationshipDataNode, Class<?> type)
throws IOException, IllegalAccessException, InstantiationException {
if (ValidationUtils.isRelationshipParsable(relationshipDataNode)) {
String identifier = createIdentifier(re... | Create a Java method that does the following: "Parses a relationship object.". |
Of course, here is the Java code you requested:
```java
public static String[] getResources(final String root) throws URISyntaxException, IOException {
logger.trace("Reading classpath resources from {}", root);
URL dirURL = ResourceList.class.getClassLoader().getResource(root);
if (dirURL != nu... | Create a Java method that does the following: "Get the resources from the classpath.". |
Of course, here is the Java code you requested:
```java
public static Reader getDSLContent(String ruleSource, IResource input) throws CoreException {
String dslFileName = findDSLConfigName( ruleSource, input );
if (dslFileName == null) {
return null;
}
IResource res = findDS... | Create a Java method that does the following: "Get the DSL content.". |
Of course, here is the Java code you requested:
```java
public static String toHexString(byte[] bytes, boolean isHNF) {
StringBuilder sb = new StringBuilder();
for (byte b : bytes) {
String hex =
String.format("%2s", Integer.toHexString(b & 0xFF)).replace(' ', '0');
if (isHNF)
sb.... | Create a Java method that does the following: "Convert a byte array to a hex string". |
Of course, here is the Java code you requested:
```java
private static String[] readArgsFile(String argsFile) throws IOException {
final ArrayList<String> lines = new ArrayList<String>();
final BufferedReader reader = new BufferedReader(
new InputStreamReader(
new FileInputStream(argsFile),... | Create a Java method that does the following: "Read the arguments file.". |
Of course, here is the Java code you requested:
```java
boolean isEmpty(String repoFullName) {
lock.readLock().lock();
try {
verifyRepoRegistered(repoFullName);
return entityListenersByRepo.get(repoFullName).isEmpty();
} finally {
lock.readLock().unlock();
}
}
```
Hope this helps! | Create a Java method that does the following: "Checks if the repository is empty.". |
Of course, here is the Java code you requested:
```java
public PhotoSizes getSizes(String photoId) throws JinxException {
JinxUtils.validateParams(photoId);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.photos.getSizes");
params.put("photo_id", photoId);
return jinx.fli... | Create a Java method that does the following: "Get the sizes for a specific photo.". |
Of course, here is the Java code you requested:
```java
private String getConfigurationType(final CCTask task) {
final String outputType = task.getOuttype();
String targtype = "2"; // Win32 (x86) Dynamic-Link Library";
if ("executable".equals(outputType)) {
targtype = "1"; // "Win32 (x86) Console App... | Create a Java method that does the following: "Get configuration type.". |
Of course, here is the Java code you requested:
```java
public String[] sentDetect(String s) {
int[] starts = sentPosDetect(s);
if (starts.length == 0) {
return new String[] {s};
}
boolean leftover = starts[starts.length - 1] != s.length();
String[] sents = new String[leftover? starts.length + 1 ... | Create a Java method that does the following: "Detect the sentence of a string.". |
Of course, here is the Java code you requested:
```java
public void iterateOverMFileCollection(Visitor visit) throws IOException {
if (debug) System.out.printf(" iterateOverMFileCollection %s ", collectionDir);
int count = 0;
try (DirectoryStream<Path> ds = Files.newDirectoryStream(collectionDir, new MyStr... | Create a Java method that does the following: "Iterate over the MFileCollection.". |
Of course, here is the Java code you requested:
```java
public void generateAPIFiles(List<ApiImplementor> implementors) throws IOException {
for (ApiImplementor implementor : implementors) {
this.generateAPIFiles(implementor);
}
}
```
Hope this helps! | Create a Java method that does the following: "Generate API files for all the API implementors.". |
Of course, here is the Java code you requested:
```java
public String get(String key)
{
String ret = getValueFromOptions(key, StringOption.class);
if (ret == null && options.containsKey(key))
ret = options.get(key).toString();
return ret;
}
```
Hope this helps! | Create a Java method that does the following: "Get the value of the option with the given key.". |
Of course, here is the Java code you requested:
```java
public static <T extends Collection<?>> T notEmpty(final T collection, final String message, final Object... values) {
if (collection == null) {
throw new NullPointerException(StringUtils.simpleFormat(message, values));
}
if (c... | Create a Java method that does the following: "Check if the collection is not empty.". |
Of course, here is the Java code you requested:
```java
public void evaluate(DoubleSolution solution) {
int numberOfVariables = getNumberOfVariables();
int numberOfObjectives = getNumberOfObjectives() ;
double[] f = new double[numberOfObjectives];
double[] x = new double[numberOfVariables] ;
... | Create a Java method that does the following: "Evaluates the Cosine Hessian on the given double solution.". |
Of course, here is the Java code you requested:
```java
public static long getLong(String key, long valueIfNullOrNotParseable) {
String value = System.getProperty(key);
if (Strings.isNullOrEmpty(value)) {
return valueIfNullOrNotParseable;
}
try {
return Long.pars... | Create a Java method that does the following: "Gets the value of a CRA - 03 03". |
Of course, here is the Java code you requested:
```java
public static NlsBundleFactory getBundleFactory() {
if (bundleFactory == null) {
synchronized (NlsAccess.class) {
if (bundleFactory == null) {
NlsBundleFactoryImpl impl = new NlsBundleFactoryImpl();
impl.initialize();
... | Create a Java method that does the following: "Gets the bundle factory.". |
Of course, here is the Java code you requested:
```java
private int parseValues(int startOffset, ByteBuf buf) throws OnRecordErrorException {
int offset = startOffset;
// N Values
// For each Value:
// 1 byte data type code
int numValues = buf.getUnsignedShort(offset); // 4-5
offset += 2;
... | Create a Java method that does the following: "Parse the values in the buffer.". |
Of course, here is the Java code you requested:
```java
@GwtIncompatible("Unnecessary")
private boolean shouldGenerateOutputPerModule(String output) {
return !config.module.isEmpty()
&& output != null && output.contains("%outname%");
}
```
Hope this helps! | Create a Java method that does the following: "Returns true if the output should be generated per module.". |
Of course, here is the Java code you requested:
```java
@Override
void initAnimation() {
if (!mInitialized) {
// mValueType may change due to setter/getter setup; do this before calling super.init(),
// which uses mValueType to set up the default type evaluator.
int numV... | Create a Java method that does the following: "Initialize the animation.". |
Of course, here is the Java code you requested:
```java
@Override
public void clear() {
Supplier<Object> clearStrategy = () -> {
if (size == 0) {
return null;
}
Arrays.fill(ringBuffer, null);
size = 0;
headIndex = 0;
ta... | Create a Java method that does the following: "Clear the cache.". |
Of course, here is the Java code you requested:
```java
public SbbID[] getSbbs() throws ManagementException {
try {
if (logger.isDebugEnabled()) {
logger.debug("getSbbs()");
}
return getSleeContainer().getComponentRepository()
.getSbbIDs().toArray(new SbbID[0]);
} catch (Throwable ex) {
throw ... | Create a Java method that does the following: "Get the SBBs.". |
Of course, here is the Java code you requested:
```java
@Override
public HTTaxinvoiceSearchResult search(String CorpNum, String JobID,
String[] Type, String[] TaxType, String[] PurposeType,
String TaxRegIDYN, String TaxRegIDType, String TaxRegID,
Integer Page, Integer PerPage, String Order) throws PopbillExc... | Create a Java method that does the following: "Search for HTTaxinvoiceSearchResult in the HTTaxinvoice.". |
Of course, here is the Java code you requested:
```java
public void info( String oinfo ) {
//
String methodName = moduleCode + "." + "info";
//
out.format( "%s%n", oinfo );
//
charsCount += oinfo.length();
//
String FOInfo = getFullInfoString( oinfo );
//
if ( !isFileOpen( methodName ) ) return;
... | Create a Java method that does the following: "Write out the info string to the output file.". |
Of course, here is the Java code you requested:
```java
@Nonnull
public String getAsString (@Nonnull final Charset aCharset)
{
return new String (m_aBuffer.array (), m_aBuffer.arrayOffset (), m_aBuffer.position (), aCharset);
}
```
Hope this helps! | Create a Java method that does the following: "Get the content of the buffer as a string.". |
Of course, here is the Java code you requested:
```java
public <I, O> List<O> groupExecute(
final Collection<ShardingExecuteGroup<I>> inputGroups, final ShardingGroupExecuteCallback<I, O> firstCallback, final ShardingGroupExecuteCallback<I, O> callback, final boolean serial)
throws SQLException {
... | Create a Java method that does the following: "Execute a collection of ShardingExecuteGroups.". |
Of course, here is the Java code you requested:
```java
public ApiResponse<List<CharacterMailinglistsResponse>> getCharactersCharacterIdMailListsWithHttpInfo(
Integer characterId, String datasource, String ifNoneMatch, String token) throws ApiException {
com.squareup.okhttp.Call call = getCharacter... | Create a Java method that does the following: "Get CDN Mailinglists. getCharactersCharacterIdMailLists". |
Of course, here is the Java code you requested:
```java
protected void internalCreateDefaultGroups(CmsDbContext dbc, String ouFqn, String ouDescription, boolean webuser)
throws CmsException {
// create roles
String rootAdminRole = CmsRole.ROOT_ADMIN.getGroupName();
boolean isRootOu = CmsOr... | Create a Java method that does the following: "Creates the default groups.". |
Of course, here is the Java code you requested:
```java
boolean lockInterruptibly(final Integer permit, final long timeout, final TimeUnit unit) throws InterruptedException {
if (permit == null) {
throw new IllegalArgumentException();
}
return sync.tryAcquireNanos(permit, unit.toNan... | Create a Java method that does the following: "Acquire a lock on the local cache.". |
Of course, here is the Java code you requested:
```java
public synchronized void reset() {
executing.reset();
rejected.reset();
failed.reset();
succeeded.reset();
counter.reset();
histogram.reset();
lastFailureReason = null;
lastRejectReason = null;
}
```
Hope this helps! | Create a Java method that does the following: "Resets all the data structures.". |
Of course, here is the Java code you requested:
```java
@Override
public Object invoke(final MethodInvocation invocation) throws Throwable {
if (this.logger.isDebugEnabled()) {
this.logger.debug("Executing proxied method in stateful retry: "
+ invocation.getStaticPart() + "("
+ ObjectUtils.getIdentity... | Create a Java method that does the following: "Handle a proxied invocation of a stateful retry.". |
Of course, here is the Java code you requested:
```java
public String setScript(PrivateKeyAccount from, String script, byte chainId, long fee) throws IOException {
return send(Transactions.makeScriptTx(from, compileScript(script), chainId, fee));
}
```
Hope this helps! | Create a Java method that does the following: "Set a script in a private key account.". |
Of course, here is the Java code you requested:
```java
private RRFedNonFedBudgetDocument getRRFedNonFedBudget() {
RRFedNonFedBudgetDocument rrFedNonFedBudgetDocument = RRFedNonFedBudgetDocument.Factory.newInstance();
RRFedNonFedBudgetDocument.RRFedNonFedBudget fedNonFedBudget = RRFedNonFedBudgetDocu... | Create a Java method that does the following: "This method gets the RRFedNonFedBudget object.". |
Of course, here is the Java code you requested:
```java
public AddPermissionRequest withAWSAccountIds(String... aWSAccountIds) {
if (this.aWSAccountIds == null) {
setAWSAccountIds(new com.amazonaws.internal.SdkInternalList<String>(aWSAccountIds.length));
}
for (String ele : aWSAccou... | Create a Java method that does the following: "Sets the value of the AWSAccountIds property.". |
Of course, here is the Java code you requested:
```java
public double ComputeHoeffdingBound(double range, double confidence,
double n) {
return Math.sqrt(((range * range) * Math.log(1.0 / confidence))
/ (2.0 * n));
}
```
Hope this helps! | Create a Java method that does the following: "Compute the Hoeffding Bound.". |
Of course, here is the Java code you requested:
```java
private static NodeAVL child(PersistentStore store, NodeAVL x,
boolean isleft) {
return isleft ? x.getLeft(store)
: x.getRight(store);
}
```
Hope this helps! | Create a Java method that does the following: "Get the child of a node.". |
Of course, here is the Java code you requested:
```java
@InterfaceAudience.Public
public void setAuthenticator(Authenticator authenticator) {
properties.put(ReplicationField.AUTHENTICATOR, authenticator);
replicationInternal.setAuthenticator(authenticator);
}
```
Hope this helps! | Create a Java method that does the following: "Sets the authenticator for this class.". |
Of course, here is the Java code you requested:
```java
@Override
public TopicPublisher createPublisher(Topic topic) throws JMSException
{
externalAccessLock.readLock().lock();
try
{
checkNotClosed();
RemoteTopicPublisher publisher = new RemoteTopicPublisher(this,
... | Create a Java method that does the following: "Creates a publisher for a topic.". |
Of course, here is the Java code you requested:
```java
private InstanceType determineType(List<String> commands) {
LOGGER.entering(commands.toString());
type = InstanceType.SELENIUM_STANDALONE;
if (commands.contains(ROLE_ARG) && commands.contains(InstanceType.SELENIUM_NODE.getFriendlyName())) ... | Create a Java method that does the following: "Determine the type of the instance based on the command line arguments.". |
Of course, here is the Java code you requested:
```java
public void setAceFlags(String aceFlags) {
try {
m_aceFlags = Integer.parseInt(aceFlags);
} catch (Throwable e) {
m_throwable = e;
}
}
```
Hope this helps! | Create a Java method that does the following: "Sets the ACEFlags attribute of the CraigdDSP object.". |
Of course, here is the Java code you requested:
```java
public synchronized String[] getNotIncludedDirectories() {
slowScan();
String[] directories = new String[dirsNotIncluded.size()];
dirsNotIncluded.copyInto(directories);
return directories;
}
```
Hope this helps! | Create a Java method that does the following: "Get the directories that are not included in the current directory.". |
Of course, here is the Java code you requested:
```java
private void processSpecialTags(JsonParser jsonParser) throws IOException {
LOG.info("@odata tags found - start parsing");
String key = jsonParser.getCurrentName();
jsonParser.nextToken();
String value = jsonParser.getText();
... | Create a Java method that does the following: "Process special tags.". |
Of course, here is the Java code you requested:
```java
private boolean kernelNo0s( int[] kernel ) {
for( int i = 0; i < kernel.length; ++i ) {
if (kernel[i] == 0)
return false;
}
return true;
}
```
Hope this helps! | Create a Java method that does the following: "Check if kernel has no 0s.". |
Of course, here is the Java code you requested:
```java
@Override
public Status getStatus(String key) {
if (textNodeMap.containsKey(key)) {
TextNode textNode = textNodeMap.get(key);
return textNode.getStatus();
}
return null;
}
```
Hope this helps! | Create a Java method that does the following: "Get the status of a CRA TextNode.". |
Of course, here is the Java code you requested:
```java
private static void createAdsWithCustomizations(AdWordsServicesInterface adWordsServices,
AdWordsSession session, List<Long> adGroupIds, String feedName) throws RemoteException {
// Get the AdGroupAdService.
AdGroupAdServiceInterface adGroupAdServic... | Create a Java method that does the following: "Creates the ads with customizations.". |
Of course, here is the Java code you requested:
```java
public static void checkMultiMapConfig(MultiMapConfig multiMapConfig,
SplitBrainMergePolicyProvider mergePolicyProvider) {
checkMergePolicy(multiMapConfig, mergePolicyProvider, multiMapConfig.getMergePolicyConfig... | Create a Java method that does the following: "Check the MultiMapConfig for validity.". |
Of course, here is the Java code you requested:
```java
public Matrix4f rotateAroundLocal(Quaternionfc quat, float ox, float oy, float oz, Matrix4f dest) {
float w2 = quat.w() * quat.w();
float x2 = quat.x() * quat.x();
float y2 = quat.y() * quat.y();
float z2 = quat.z() * quat.z();
... | Create a Java method that does the following: "Rotate a matrix around another matrix.". |
Of course, here is the Java code you requested:
```java
public int getElementById(String elementId)
{
Document doc = (m_root.getNodeType() == Node.DOCUMENT_NODE)
? (Document) m_root : m_root.getOwnerDocument();
if(null != doc)
{
Node elem = doc.getElementById(elementId);
if... | Create a Java method that does the following: "Get the handle of the element with the given id.". |
Of course, here is the Java code you requested:
```java
public ServiceFuture<LogsInner> listLogsAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail, final ServiceCallback<LogsInner> serviceCallback) {
return ServiceFuture.fromResponse(listLogsWithServiceResponseAsync(r... | Create a Java method that does the following: "Gets a list of log records for a container.". |
Of course, here is the Java code you requested:
```java
public com.google.protobuf.ByteString
getBackupUriBytes() {
java.lang.Object ref = backupUri_;
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 value of the backupUriBytes property.". |
Of course, here is the Java code you requested:
```java
public SDVariable prod(String name, SDVariable x, int... dimensions) {
return prod(name, x, false, dimensions);
}
```
Hope this helps! | Create a Java method that does the following: "Product operation with specified dimensions". |
Of course, here is the Java code you requested:
```java
public void propagateMouseEventsToParent() {
this.addEventHandler(MouseEvent.ANY, e -> {
e.consume();
this.getParent().fireEvent(e);
});
}
```
Hope this helps! | Create a Java method that does the following: "Propagate mouse events to the parent.". |
Of course, here is the Java code you requested:
```java
public boolean searchForward(KMPMatch match, int maxBytes) throws IOException {
long start = getFilePointer();
long last = (maxBytes < 0) ? length() : Math.min(length(), start + maxBytes);
long needToScan = last - start;
// check what ever i... | Create a Java method that does the following: "Search forward for a single NUL - terminated block of bytes.". |
Of course, here is the Java code you requested:
```java
public void updateUserLocale(HttpServletRequest request, String localeString) {
IUserInstance ui = userInstanceManager.getUserInstance(request);
IUserPreferencesManager upm = ui.getPreferencesManager();
final IUserProfile userProfile = up... | Create a Java method that does the following: "Update the user locale.". |
Of course, here is the Java code you requested:
```java
public static OptionDialog showOptionDialog (Stage stage, String title, String text, OptionDialogType type, OptionDialogListener listener) {
OptionDialog dialog = new OptionDialog(title, text, type, listener);
stage.addActor(dialog.fadeIn());
return dialog;... | Create a Java method that does the following: "Show an option dialog.". |
Of course, here is the Java code you requested:
```java
public static Class getFieldType(FieldNode field) {
// Step 1: Analyze the field's declared type
Class declaredType = getClassForClassNode(field.getType());
if (declaredType != null) {
return declaredType;
}
... | Create a Java method that does the following: "Returns the class for a field node.". |
Of course, here is the Java code you requested:
```java
protected RawData __render(String template, Object... args) {
if (null == template) return new RawData("");
return S.raw(__engine.sandbox().render(template, args));
}
```
Hope this helps! | Create a Java method that does the following: "Render a template.". |
Of course, here is the Java code you requested:
```java
void reinitializeIfNecessary(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
{
if (_servletContext == null) {
reinitialize(request, response, servletContext);
}
}
```
Hope this helps! | Create a Java method that does the following: "Reinitialize the servlet context if necessary.". |
Of course, here is the Java code you requested:
```java
public static <T> VertxCompletableFuture<T> from(Context context, Future<T> future) {
VertxCompletableFuture<T> res = new VertxCompletableFuture<>(Objects.requireNonNull(context));
Objects.requireNonNull(future).setHandler(ar -> {
if (context == Ver... | Create a Java method that does the following: "Create a new CompletableFuture from a context and a Future". |
Of course, here is the Java code you requested:
```java
public PreparedStatement newScrollingSingleRowSelectStatement(DbSession session, String sql) {
int fetchSize = database.getDialect().getScrollSingleRowFetchSize();
return newScrollingSelectStatement(session, sql, fetchSize);
}
```
Hope this helps! | Create a Java method that does the following: "Creates a PreparedStatement that is used for scrolling a single row of data.". |
Of course, here is the Java code you requested:
```java
private void LaunchWebPage(InteractiveObject interactiveObjectFinal, String url) {
if (webPagePlusUISceneObject == null) {
final String urlFinal = url;
final GVRSceneObject gvrSceneObjectAnchor = interactiveObjectFinal.getSensor().... | Create a Java method that does the following: "Launch a web page.". |
Of course, here is the Java code you requested:
```java
public void addProfiles(@NonNull IProfile... profiles) {
if (mAccountHeaderBuilder.mProfiles == null) {
mAccountHeaderBuilder.mProfiles = new ArrayList<>();
}
Collections.addAll(mAccountHeaderBuilder.mProfiles, profiles);
... | Create a Java method that does the following: "Adds a list of profiles to the application.". |
Of course, here is the Java code you requested:
```java
public void initializeNonPersistent(BaseDestinationHandler destinationHandler)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "initializeNonPersistent", destinationHandler);
/**
* Remem... | Create a Java method that does the following: "Initialize the non persistent object". |
Of course, here is the Java code you requested:
```java
public BitsoWithdrawal[] getWithdrawals(String[] withdrawalsIds, String... queryParameters)
throws BitsoAPIException, BitsoPayloadException, BitsoServerException {
String request = "/api/v3/withdrawals";
if ((withdrawalsIds != null) &... | Create a Java method that does the following: "Get withdrawals from a set of withdrawals ids and query parameters.". |
Of course, here is the Java code you requested:
```java
public List<ArchiveRecordHeader> validate(int numRecords)
throws IOException {
List<ArchiveRecordHeader> hdrList = new ArrayList<ArchiveRecordHeader>();
int recordCount = 0;
setStrict(true);
for (Iterator<ArchiveRecord> i = it... | Create a Java method that does the following: "Validate the archive.". |
Of course, here is the Java code you requested:
```java
public DerInputStream subStream(int len, boolean do_skip)
throws IOException {
DerInputBuffer newbuf = buffer.dup();
newbuf.truncate(len);
if (do_skip) {
buffer.skip(len);
}
return new DerInputStream(newbu... | Create a Java method that does the following: "Returns a new DerInputStream of the specified length.". |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.