code stringlengths 160 48.7k | prompt stringlengths 55 1.51k |
|---|---|
Of course, here is the Java code you requested:
```java
public byte []
toWire(int section) {
DNSOutput out = new DNSOutput();
toWire(out, section, null);
return out.toByteArray();
}
```
Hope this helps! | Create a Java method that does the following: "Converts a CID to a byte array.". |
Of course, here is the Java code you requested:
```java
@Override
public synchronized void init(PlayerConfig config) {
super.init(config);
String dictFileName = config.get(DICTIONARY_FILE_NAME_KEY);
if (dictFileName == null || "".equals(dictFileName.trim())) {
throw new IllegalArgumentException(thi... | Create a Java method that does the following: "Override the init method to read the dictionary file from the specified config and add it to the dictionary.". |
Of course, here is the Java code you requested:
```java
protected void writeArray(FSTClazzInfo.FSTFieldInfo referencee, Object array) throws IOException {
if ( array == null ) {
getCodec().writeClass(Object.class);
getCodec().writeFInt(-1);
return;
}
final in... | Create a Java method that does the following: "Write array.". |
Of course, here is the Java code you requested:
```java
public Serializable requestPut(final String id, final Serializable object) throws SDKException {
CloseableHttpResponse response = null;
HttpPut httpPut = null;
checkToken();
try {
log.trace("Object is: " + object);
String fileJSONNode... | Create a Java method that does the following: "Request an object from the server.". |
Of course, here is the Java code you requested:
```java
public ListenableFuture<Connection> getAsyncConnection(){
return this.asyncExecutor.submit(new Callable<Connection>() {
public Connection call() throws Exception {
return getConnection();
}});
}
```
Hope this helps! | Create a Java method that does the following: "Get a future of a connection". |
Of course, here is the Java code you requested:
```java
private static int adjustedClassModifiersForClassWriting(ClassNode classNode) {
int modifiers = classNode.getModifiers();
boolean needsSuper = !classNode.isInterface();
modifiers = needsSuper ? modifiers | ACC_SUPER : modifiers & ~ACC_SUPE... | Create a Java method that does the following: "Adjusts the class modifiers for writing.". |
Of course, here is the Java code you requested:
```java
private int findValueIndicesIndexForSubColumn()
{
final DimensionSelector keySelector = getKeySelector();
final DimensionSelector valueSelector = getValueSelector();
final IndexedInts keyIndices = keySelector.getRow();
final IndexedInts valueIn... | Create a Java method that does the following: "Find value indices index for sub column.". |
Of course, here is the Java code you requested:
```java
public ClientNetworkConfig setAddresses(List<String> addresses) {
isNotNull(addresses, "addresses");
addressList.clear();
addressList.addAll(addresses);
return this;
}
```
Hope this helps! | Create a Java method that does the following: "Sets the addresses.". |
Of course, here is the Java code you requested:
```java
@Override
public boolean contains(ChronoElement<?> element) {
if (element == null) {
return false;
}
Object[] keys = this.keys;
if (keys == null) {
if (element == PlainDate.YEAR) {
ret... | Create a Java method that does the following: "Checks if the specified element is contained in this calendar.". |
Of course, here is the Java code you requested:
```java
public static String getElementGetter(Element element) {
// TODO 型(boolean)による絞り込みをするべき
String getterName1 = "get" + element.getSimpleName().toString();
String getterName2 = "is" + element.getSimpleName().toString();
String getterName3 = element.getSimple... | Create a Java method that does the following: "Gets the getter name of an element.". |
Of course, here is the Java code you requested:
```java
protected FieldDescriptor resolvePayloadField(Message message) {
for (FieldDescriptor field : message.getDescriptorForType().getFields()) {
if (message.hasField(field)) {
return field;
}
}
throw new... | Create a Java method that does the following: "Resolves the payload field of the message.". |
Of course, here is the Java code you requested:
```java
protected void writeClassMapping (int code, Class<?> sclass)
throws IOException
{
writeShort(code);
String cname = sclass.getName();
if (_translations != null) {
String tname = _translations.get(cname);
... | Create a Java method that does the following: "Write a class mapping.". |
Of course, here is the Java code you requested:
```java
public UUID readUuid() throws IOException {
String temp = this.readField(false /* isQuotedString */);
if (Utility.isNullOrEmpty(temp)) {
return null;
}
else {
return UUID.fromString(temp);
}
}
`... | Create a Java method that does the following: "Reads a UUID from the stream.". |
Of course, here is the Java code you requested:
```java
public void marshall(BatchCreateIndex batchCreateIndex, ProtocolMarshaller protocolMarshaller) {
if (batchCreateIndex == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
pr... | Create a Java method that does the following: "marshalls the given BatchCreateIndex object to the JSON file.". |
Of course, here is the Java code you requested:
```java
public synchronized Sha256Hash hashForWitnessSignature(
int inputIndex,
Script scriptCode,
Coin prevValue,
SigHash type,
boolean anyoneCanPay) {
return hashForWitnessSignature(inputIndex, scriptC... | Create a Java method that does the following: "This method is used to compute the hash for a witness signature.". |
Of course, here is the Java code you requested:
```java
@Nullable
public static String toArraySignature(String typeName) {
String sig = classToSignature(typeName);
if ((sig == null) || (sig.length() == 0)) {
return sig;
}
return Values.SIG_ARRAY_PREFIX + sig;
}
```
... | Create a Java method that does the following: "Returns the array signature for the given type name.". |
Of course, here is the Java code you requested:
```java
public void save(HttpServletRequest req, HttpServletResponse res, AuthenticationResult authResult) {
save(req, res, authResult, false);
}
```
Hope this helps! | Create a Java method that does the following: "Save the authentication result to the database.". |
Of course, here is the Java code you requested:
```java
protected boolean usesDOTable() throws Exception {
Connection conn = getConnection();
DatabaseMetaData dmd = conn.getMetaData();
// check if we need to update old table
ResultSet rs = dmd.getTables(null, null, "do%", null);
... | Create a Java method that does the following: "Checks if the database uses the DO table.". |
Of course, here is the Java code you requested:
```java
@Override
public R visitArrayAccess(ArrayAccessTree node, P p) {
R r = scan(node.getExpression(), p);
r = scanAndReduce(node.getIndex(), p, r);
return r;
}
```
Hope this helps! | Create a Java method that does the following: "Scans the expression and index of an array access.". |
Of course, here is the Java code you requested:
```java
public BatchGetTriggersResult withTriggersNotFound(String... triggersNotFound) {
if (this.triggersNotFound == null) {
setTriggersNotFound(new java.util.ArrayList<String>(triggersNotFound.length));
}
for (String ele : triggersNo... | Create a Java method that does the following: "A list of unique ID strings that you want to retrieve from the database.". |
Of course, here is the Java code you requested:
```java
@Override
public boolean deleteObject(GcsFilename filename, long timeoutMillis) throws IOException {
HTTPRequest req = makeRequest(filename, null, DELETE, timeoutMillis);
HTTPResponse resp;
try {
resp = urlfetch.fetch(req);
} catch (IOExce... | Create a Java method that does the following: "Delete a single object from the specified filename.". |
Of course, here is the Java code you requested:
```java
public EClass getIfcAxis2Placement3D() {
if (ifcAxis2Placement3DEClass == null) {
ifcAxis2Placement3DEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(35);
}
return ifcAxis2Placement3DECla... | Create a Java method that does the following: "Get the Ifc2x3tc1Placement3D class from the EPackage.". |
Of course, here is the Java code you requested:
```java
public void setColor(int color) {
mAngle = colorToAngle(color);
mPointerColor.setColor(calculateColor(mAngle));
// check of the instance isn't null
if (mOpacityBar != null) {
// set the value of the opacity
mOpacityBar.setColor(mColor);
mOpacity... | Create a Java method that does the following: "Sets the color of the pointer.". |
Of course, here is the Java code you requested:
```java
public GroupZipper replace(Group group) {
if (parent == null) {
node = group;
} else {
parent.getNode().getGroups().set(index, group);
}
return this;
}
```
Hope this helps! | Create a Java method that does the following: "Replaces the specified group with the specified one.". |
Of course, here is the Java code you requested:
```java
public int[] getTrace (String base) throws CompoundNotFoundException {
if (base.equals("A")) {
return A;
} else if (base.equals("C")) {
return C;
} else if (base.equals("G")) {
return G;
} else if (base.equals("T")) {
return T;
} else {
t... | Create a Java method that does the following: "Get the trace of the given base.". |
Of course, here is the Java code you requested:
```java
public final ForkJoinTask<V> fork() {
Thread t;
if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread)
((ForkJoinWorkerThread) t).workQueue.push(this);
else
ForkJoinPool.common.externalPush(this);
return this;
}
```
Hope ... | Create a Java method that does the following: "Fork this task.". |
Of course, here is the Java code you requested:
```java
@Nullable
private Comparable<?> getCallingObject() {
String sig = getSigConstantOperand();
if (Values.SIG_VOID.equals(SignatureUtils.getReturnSignature(sig))) {
return null;
}
int numParameters = SignatureUtils.get... | Create a Java method that does the following: "Gets the value of the calling object.". |
Of course, here is the Java code you requested:
```java
@Beta
public static void copy(File from, OutputStream to) throws IOException {
asByteSource(from).copyTo(to);
}
```
Hope this helps! | Create a Java method that does the following: "Copy a file to an output stream.". |
Of course, here is the Java code you requested:
```java
private void parseWriteTimeout(Map<Object, Object> props) {
Object value = props.get(HttpConfigConstants.PROPNAME_WRITE_TIMEOUT);
if (null != value) {
try {
this.writeTimeout = TIMEOUT_MODIFIER * minLimit(convertInteger... | Create a Java method that does the following: "Parse the write timeout property.". |
Of course, here is the Java code you requested:
```java
@Override
public <T> T executeObject(String name, T object) throws CpoException {
return processExecuteGroup(name, object, object);
}
```
Hope this helps! | Create a Java method that does the following: "Execute an object in the CpoCrawling object.". |
Of course, here is the Java code you requested:
```java
public void notifyStateChangeToUnavailable() {
final List<ConsumerStateListener> onAvailable = consumerConfig.getOnAvailable();
if (onAvailable != null) {
AsyncRuntime.getAsyncThreadPool().execute(new Runnable() {
@Over... | Create a Java method that does the following: "Notify state change to unavailable". |
Of course, here is the Java code you requested:
```java
private void renderMask(SVG.Mask mask, SvgElement obj, Box originalObjBBox)
{
debug("Mask render");
boolean maskUnitsAreUser = (mask.maskUnitsAreUser != null && mask.maskUnitsAreUser);
float w, h;
if (maskUnitsAreU... | Create a Java method that does the following: "Render the mask.". |
Of course, here is the Java code you requested:
```java
private static String formatPathToDir(Path path) {
return path.toString().endsWith(Path.SEPARATOR) ? path.toString() : path.toString() + Path.SEPARATOR;
}
```
Hope this helps! | Create a Java method that does the following: "Format path to dir.". |
Of course, here is the Java code you requested:
```java
public static String prependUri(String baseUri, String uri) {
if (!uri.startsWith("/")) {
uri = "/" + uri;
}
if (uri.length() == 1 && uri.charAt(0) == '/') {
uri = "";
}
uri = baseUri + uri;
... | Create a Java method that does the following: "Prepends the uri to the baseUri.". |
Of course, here is the Java code you requested:
```java
public void showRightPane(JComponent component)
{
showRightBar();
frame.getContentPane().add(component, DesktopAppLayout.RIGHT_PANE);
frame.pack();
rightComponent = component;
}
```
Hope this helps! | Create a Java method that does the following: "Show the right pane of the application.". |
Of course, here is the Java code you requested:
```java
public static ServiceAdapter<ExecutorService> forExecutorService() {
return new SimpleServiceAdapter<ExecutorService>(false, true) {
@Override
protected void start(ExecutorService instance) {
}
@Override
protected void stop(ExecutorService insta... | Create a Java method that does the following: "Creates a service adapter for the ExecutorService.". |
Of course, here is the Java code you requested:
```java
public List<DBaseFileRecord> readRestOfDBFRecords() throws IOException {
if (this.finished) {
throw new EOFDBaseFileException();
}
if (this.recordCount == -1) {
throw new MustCallReadHeaderFunctionException();
}
final Vector<DBaseFileRecord> reco... | Create a Java method that does the following: "Read the rest of the records in the DBF file.". |
Of course, here is the Java code you requested:
```java
public String convertGSPSLCIDToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
}
```
Hope this helps! | Create a Java method that does the following: "Convert a GSPSLCID to a String.". |
Of course, here is the Java code you requested:
```java
public long getEncodedLength(final byte[] pArray) {
// Calculate non-chunked size - rounded up to allow for padding
// cast to long is needed to avoid possibility of overflow
long len = ((pArray.length + unencodedBlockSize-1) / unencodedB... | Create a Java method that does the following: "Get the length of the byte array.". |
Of course, here is the Java code you requested:
```java
public static List<UIComponent> resolveComponents(FacesContext context, UIComponent source, String expressions, int hints) {
ArrayList<UIComponent> components = new ArrayList<>();
if (!LangUtils.isValueBlank(expressions)) {
String[] ... | Create a Java method that does the following: "Resolves the components of the given expressions.". |
Of course, here is the Java code you requested:
```java
protected Boolean _generate(XCastedExpression expression, XExpression parentExpression, XtendExecutable feature,
InlineAnnotationTreeAppendable output) {
final InlineAnnotationTreeAppendable child = newAppendable(output.getImportManager());
boolean bool = ... | Create a Java method that does the following: "Append the inline annotation for the given XCastedExpression.". |
Of course, here is the Java code you requested:
```java
public static service get(nitro_service service, String name) throws Exception{
service obj = new service();
obj.set_name(name);
service response = (service) obj.get_resource(service);
return response;
}
```
Hope this helps! | Create a Java method that does the following: "Use this API to fetch service resource of given name.". |
Of course, here is the Java code you requested:
```java
private void setStatusBarColor() {
// Changing status bar color is a post-21 feature
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
int statusBarDefaultColor = ApptentiveInternal.getInstance().getDefaultStatusBarColor();
int overlayColor =... | Create a Java method that does the following: "Set the status bar color.". |
Of course, here is the Java code you requested:
```java
public <T> void cancel(final Class<T> clazz, final Object requestCacheKey) {
final SpiceRequest<T> request = new SpiceRequest<T>(clazz) {
@Override
public T loadDataFromNetwork() throws Exception {
return null;
... | Create a Java method that does the following: "Cancel a single instance of the specified class.". |
Of course, here is the Java code you requested:
```java
private final void trackBack() {
logger.trace("No valid action available. Perform back tracking...");
BacktrackLocation backtrackLocation = backtrackStack.peek();
streamPosition = backtrackLocation.getStreamPosition();
stepCounter = backtrackLocation.getStepC... | Create a Java method that does the following: "Perform back tracking.". |
Of course, here is the Java code you requested:
```java
public void marshall(DeleteBackupVaultNotificationsRequest deleteBackupVaultNotificationsRequest, ProtocolMarshaller protocolMarshaller) {
if (deleteBackupVaultNotificationsRequest == null) {
throw new SdkClientException("Invalid argument pas... | Create a Java method that does the following: "marshalls the given DeleteBackupVaultNotificationsRequest to the JSON object.". |
Of course, here is the Java code you requested:
```java
private boolean isImmediatelySendable(final AbstractBody msg) {
assertLocked();
if (cmParams == null) {
// block if we're waiting for a response to our first request
return exchanges.isEmpty();
}
AttrReque... | Create a Java method that does the following: "Check if the message is immediately sendable.". |
Of course, here is the Java code you requested:
```java
public static CPOption findByUUID_G(String uuid, long groupId)
throws com.liferay.commerce.product.exception.NoSuchCPOptionException {
return getPersistence().findByUUID_G(uuid, groupId);
}
```
Hope this helps! | Create a Java method that does the following: "Returns the cp option with the UUID and groupId.". |
Of course, here is the Java code you requested:
```java
private void buttonRedrawMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_buttonRedrawMouseClicked
if (visualizer != null)
visualizer.redraw();
}
```
Hope this helps! | Create a Java method that does the following: "buttonRedrawMouseClicked This method is called when the user clicks on the button of the image.". |
Of course, here is the Java code you requested:
```java
public Vector setAngle (double angle) {
double l = length();
return set(l * Math.cos(angle), l * Math.sin(angle));
}
```
Hope this helps! | Create a Java method that does the following: "Sets the angle of the coding vector.". |
Of course, here is the Java code you requested:
```java
public XMLEvent processEvent() throws XMLStreamException, SNAXUserException {
checkState(xmlReader != null, "startParsing() was never called");
checkState(isIncremental, "startParsing() was never called");
return processEvent(xmlReader.... | Create a Java method that does the following: "This method is called by the XMLParser to process an XML Event. It is called by the XMLReader when the XMLReader is not null.". |
Of course, here is the Java code you requested:
```java
private static double computePerimeter(Geometry geometry) {
double sum = 0;
for (int i = 0; i < geometry.getNumGeometries(); i++) {
Geometry subGeom = geometry.getGeometryN(i);
if (subGeom instanceof Polygon) {
... | Create a Java method that does the following: "Compute the perimeter of a geometry.". |
Of course, here is the Java code you requested:
```java
public DoubleRange getMzRange() {
if (isolationWindowMzLo != null && isolationWindowMzHi != null) {
return new DoubleRange(isolationWindowMzLo, isolationWindowMzHi);
}
return null;
}
```
Hope this helps! | Create a Java method that does the following: "Get the MZ range.". |
Of course, here is the Java code you requested:
```java
public B condition(String conditionText) {
Condition condition = createInstance(Condition.class);
condition.setTextContent(conditionText);
element.setCondition(condition);
return myself;
}
```
Hope this helps! | Create a Java method that does the following: "Sets the condition of the element.". |
Of course, here is the Java code you requested:
```java
@Override
public SendInvitationResult sendInvitation(SendInvitationRequest request) {
request = beforeClientExecution(request);
return executeSendInvitation(request);
}
```
Hope this helps! | Create a Java method that does the following: "Sends an invitation to an existing CA.". |
Of course, here is the Java code you requested:
```java
protected TaskBase endOfProcessDetected(ProcessInstance processInstance, Audit currentAudit) {
TaskBase ret = null;
TaskBase currentTask = getCurrentTask(processInstance);
ProcessInstanceUtils.clearQueue(processInstance, TaskStatus.DONE);
currentAudit.set... | Create a Java method that does the following: "This method is called when the end of the process detected.". |
Of course, here is the Java code you requested:
```java
public static void set(
MutableLongArrayND a0, LongSupplier s)
{
a0.coordinates().parallel().forEach(t ->
{
a0.set(t, s.getAsLong());
});
}
```
Hope this helps! | Create a Java method that does the following: "Sets all the tuples in a0 to the given value.". |
Of course, here is the Java code you requested:
```java
synchronized boolean update() {
int elected = this.elected;
int oldelected = this.oldelected;
int lbfactor = this.lbfactor;
if (lbfactor > 0) {
this.lbstatus = ((elected - oldelected) * 1000) / lbfactor;
}
... | Create a Java method that does the following: "Update the status of the record.". |
Of course, here is the Java code you requested:
```java
@Deprecated
public static int cuGLCtxCreate( CUcontext pCtx, int Flags, CUdevice device )
{
return checkResult(cuGLCtxCreateNative(pCtx, Flags, device));
}
```
Hope this helps! | Create a Java method that does the following: "Creates a CUDA context.". |
Of course, here is the Java code you requested:
```java
@Override
public boolean isConnected() {
if (log.isTraceEnabled()) {
log.trace("Connected: {}", (ioSession != null && ioSession.isConnected()));
}
// XXX Paul: not sure isClosing is actually working as we expect here
... | Create a Java method that does the following: "Is the session connected?". |
Of course, here is the Java code you requested:
```java
public static OptionalHeader newInstance(byte[] headerbytes, long offset)
throws IOException {
OptionalHeader header = new OptionalHeader(headerbytes, offset);
header.read();
return header;
}
```
Hope this helps! | Create a Java method that does the following: "Creates an instance of the optional header.". |
Of course, here is the Java code you requested:
```java
public com.squareup.okhttp.Call deleteFleetsFleetIdSquadsSquadIdAsync(Long fleetId, Long squadId,
String datasource, String token, final ApiCallback<Void> callback) throws ApiException {
com.squareup.okhttp.Call call = deleteFleetsFleetIdSqua... | Create a Java method that does the following: "Delete CDN SQUADs asynchronous Method for deleteFleetsFleetIdSquadsSquadId". |
Of course, here is the Java code you requested:
```java
public static <T> List<Class<?>> getPublicConcreteSubTypesOf(final Class<T> type) {
return ClassGraphFacade.getPublicConcreteSubTypesOf(type);
}
```
Hope this helps! | Create a Java method that does the following: "Get the public concrete subtypes of a class.". |
Of course, here is the Java code you requested:
```java
private static List<FeedItem> getFeedItems(AdWordsServicesInterface adWordsServices,
AdWordsSession session, Feed feed) throws RemoteException {
// Get the FeedItemService.
FeedItemServiceInterface feedItemService =
adWordsServices.get(sessi... | Create a Java method that does the following: "Gets the list of the NCSA SEGMENTS.". |
Of course, here is the Java code you requested:
```java
@Override
public String url(Object string)
{
// TODO: Introduce a xwiki-commons-url module and move this code in it so that we can share it with
// platform's XWikiServletURLFactory and functional test TestUtils class.
String encod... | Create a Java method that does the following: "URL - encodes the given string.". |
Of course, here is the Java code you requested:
```java
public static ByteRange parse(String rangeHeader) {
if(rangeHeader == null || rangeHeader.length() < 7) {
return null;
}
if(!rangeHeader.startsWith("bytes=")) {
return null;
}
List<Range> ranges = ne... | Create a Java method that does the following: "Parses the range header.". |
Of course, here is the Java code you requested:
```java
public XGBoostAutoBuffer putStr(String s ) {
ab.put4(s.length());
byte[] a = StringUtils.bytesOf(s);
ab.putA1(a, a.length);
return this;
}
```
Hope this helps! | Create a Java method that does the following: "Puts a string into the auto buffer.". |
Of course, here is the Java code you requested:
```java
public boolean isMatched(String value)
{
if (value == null)
return false;
if ((_match != null)) {
for (int i = 0; i < _match.length; i++) {
if (value.equals(_match[i]))
return true;
... | Create a Java method that does the following: "Is the value matched by the Crazil language.". |
Of course, here is the Java code you requested:
```java
static void exportModel() throws Exception {
HttpClient client = new HttpClient();
GetMethod get = new GetMethod(URL + "/2/ExportModel.json?model=MyInitialNeuralNet");
int status = client.executeMethod(get);
if( status != 200 )
throw new Exc... | Create a Java method that does the following: "Export the model to a JSON file". |
Of course, here is the Java code you requested:
```java
public void setDBClusterOptionGroupMemberships(java.util.Collection<DBClusterOptionGroupStatus> dBClusterOptionGroupMemberships) {
if (dBClusterOptionGroupMemberships == null) {
this.dBClusterOptionGroupMemberships = null;
return;
... | Create a Java method that does the following: "Sets the value of the dBClusterOptionGroupMemberships property.". |
Of course, here is the Java code you requested:
```java
public void attributeDecl(
String eName,
String aName,
String type,
String valueDefault,
String value)
throws SAXException
{
// Do not inline external DTD
if (m_inExternalDTD)
return;... | Create a Java method that does the following: "Attribute Declaration Method.". |
Of course, here is the Java code you requested:
```java
Long cleanUpLongJobIfItHasFinishedExecuting(long currentTime, Job job) {
if(longRunningJobs.containsKey(job)
&& longRunningJobs.get(job).executionsCount != job.executionsCount()) {
Long jobLastExecutionTimeInMillis = job.lastExecutionEndedTimeInMillis();
... | Create a Java method that does the following: "Clean up the long job if it has finished executing.". |
Of course, here is the Java code you requested:
```java
protected Component newCloseTitle(final String titleId, final IModel<?> titleModel,
final int index)
{
return new Label(titleId, titleModel);
}
```
Hope this helps! | Create a Java method that does the following: "Factory method for creating a new close title.". |
Of course, here is the Java code you requested:
```java
private DeltaIteration<ST, WT> setResources(ResourceSpec minResources, ResourceSpec preferredResources) {
Preconditions.checkNotNull(minResources, "The min resources must be not null.");
Preconditions.checkNotNull(preferredResources, "The preferred resources ... | Create a Java method that does the following: "Sets the resources for the iteration.". |
Of course, here is the Java code you requested:
```java
@Override
public Response toResponse(JsonIOException exception) {
Throwable throwable = exception;
if (exception.getCause() instanceof JsonProcessingException) {
throwable = exception.getCause();
}
return mappers.g... | Create a Java method that does the following: "Override toResponse to return a Response object from the exception.". |
Of course, here is the Java code you requested:
```java
public Instant getStartAsInstant() {
Moment moment = this.getStartAsMoment();
return ((moment == null) ? null : moment.toTemporalAccessor());
}
```
Hope this helps! | Create a Java method that does the following: "Gets the start as an instant.". |
Of course, here is the Java code you requested:
```java
public static void setExternalStorageState(File directory, String state) {
storageState.put(directory.toPath(), state);
}
```
Hope this helps! | Create a Java method that does the following: "Set the external storage state for the given directory.". |
Of course, here is the Java code you requested:
```java
private DescribeVpcsResponseType describeVpcs() {
DescribeVpcsResponseType ret = new DescribeVpcsResponseType();
ret.setRequestId(UUID.randomUUID().toString());
VpcSetType vpcSet = new VpcSetType();
for (Iterator<MockVpc> mockVpc =... | Create a Java method that does the following: "Method to describe Vpcs.". |
Of course, here is the Java code you requested:
```java
@Override
public void reset(final long mNodeKey) {
super.reset(mNodeKey);
mRightSiblingKeyStack = new Stack<Long>();
if (isSelfIncluded()) {
mNextKey = getNode().getDataKey();
} else {
mNextKey = ((ITree... | Create a Java method that does the following: "Resets the internal state of the iterator.". |
Of course, here is the Java code you requested:
```java
public synchronized static CharBuffer formatLocal(CharBuffer cb,
long gmtTime,
String format)
{
_localDate.setGMTTime(gmtTime);
return _localDate.fo... | Create a Java method that does the following: "Format the local date in the specified format.". |
Of course, here is the Java code you requested:
```java
@Override
public final void setItsId(final IdUserRoleTomcat pItsId) {
this.itsId = pItsId;
if (this.itsId == null) {
this.itsUser = null;
this.itsRole = null;
} else {
this.itsUser = this.itsId.getItsUser();
this.itsRole = th... | Create a Java method that does the following: "Set the ItsId.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
@Nullable
public T getValue() {
Object o = value;
if (o != null && !NotificationLite.isError(o)) {
return (T)value;
}
return null;
}
```
Hope this helps! | Create a Java method that does the following: "Gets the value of the CIDCTYPE field.". |
Of course, here is the Java code you requested:
```java
@Override
public void registerThrowable(RetryContext context, Throwable throwable) {
RetryContext[] contexts = ((CompositeRetryContext) context).contexts;
RetryPolicy[] policies = ((CompositeRetryContext) context).policies;
for (int i = 0; i < contexts.len... | Create a Java method that does the following: "Override this method to register a throwable with the composite retry context.". |
Of course, here is the Java code you requested:
```java
@Override
public byte[] getFileContents(final String key) {
FileItem file = getFileItem(key);
return file == null ? null : file.get();
}
```
Hope this helps! | Create a Java method that does the following: "Gets the contents of the file with the specified key.". |
Of course, here is the Java code you requested:
```java
public static List<String> getImageIds( String formString ) throws Exception {
List<String> imageIds = new ArrayList<String>();
if (formString != null && formString.length() > 0) {
JSONObject sectionObject = new JSONObject(formString);... | Create a Java method that does the following: "Get the imageIds from a form string". |
Of course, here is the Java code you requested:
```java
public byte getScalarByte(int recnum, StructureMembers.Member m) {
if (!(m.getDataType().getPrimitiveClassType() == byte.class))
throw new IllegalArgumentException("Type is " + m.getDataType() + ", must be byte");
Array data = m.getDataArray();
... | Create a Java method that does the following: "Get the byte value of a single record from the file.". |
Of course, here is the Java code you requested:
```java
protected void processPrivilegedActionException(PrivilegedActionException e) throws Exception, TransactionRolledbackLocalException {
if (e.getCause() instanceof RuntimeException) {
processRuntimeException((RuntimeException) e.getCause());
}
else if (... | Create a Java method that does the following: "Process a privileged action exception.". |
Of course, here is the Java code you requested:
```java
@Override
public synchronized void onNext(final ClientRuntimeProtocol.JobControlProto jobControlProto) {
if (jobControlProto.hasSignal()) {
if (jobControlProto.getSignal() == ClientRuntimeProtocol.Signal.SIG_TERMINATE) {
try {
if (jo... | Create a Java method that does the following: "Override onNext method.". |
Of course, here is the Java code you requested:
```java
public final void setMessageContent(final byte[] content) {
Utility.assertNotNull("content", content);
this.messageContent = Base64.encode(content);
this.messageType = QueueMessageType.BASE_64_ENCODED;
}
```
Hope this helps! | Create a Java method that does the following: "Sets the message content.". |
Of course, here is the Java code you requested:
```java
public List<FilterDefinition> getFilters() {
try {
if (isStarted()) {
final FilterAcknowledger acknowledger = new FilterAcknowledger();
// Be sure that the emit/ack is synchronous to get the filters before the test are run
new Thread(new Run... | Create a Java method that does the following: "Gets the filters from the agent.". |
Of course, here is the Java code you requested:
```java
public synchronized boolean hasNext() {
while( nexting ) {
if( logger.isInfoEnabled() ) {
logger.info("[" + this + "] Waiting for another thread to pull item...");
}
try { wait(150L); }
catch... | Create a Java method that does the following: "Checks if there is more item to be loaded.". |
Of course, here is the Java code you requested:
```java
public void start() {
lock.lock();
try {
if (State.NOT_STARTED.equals(state)) {
spiderThread.addSpiderListener(this);
spiderThread.start();
state = State.RUNNING;
SpiderEventPublisher.publishScanEvent(
ScanEventPublisher.SCAN_STARTED_... | Create a Java method that does the following: "Start the SpiderThread.". |
Of course, here is the Java code you requested:
```java
@Override
public String getDeploymentStack() {
String value = getValueFromConfig(DeploymentContext.ContextKey.stack.getKey());
if (value != null) {
return value;
} else {
value = getValueFromConfig(DEPLOYMENT_ST... | Create a Java method that does the following: "Get the deployment stack.". |
Of course, here is the Java code you requested:
```java
ExtensionLoader createDefaultExtensionLoader() {
// First find the right Class/ClassLoader
final Class<?> extensionLoaderImplClass;
try {
extensionLoaderImplClass = ClassLoaderSearchUtil.findClassFromClassLoaders(EXTENSION_LOAD... | Create a Java method that does the following: "Create a new instance of the extension loader.". |
Of course, here is the Java code you requested:
```java
@Override
public LocatableInputSplit getNextInputSplit(String host, int taskId) {
// for a null host, we return a remote split
if (host == null) {
synchronized (this.remoteSplitChooser) {
synchronized (this.unassigned) {
LocatableInputSplitWith... | Create a Java method that does the following: "Get the next input split for the given host.". |
Of course, here is the Java code you requested:
```java
public ResourceBindingImpl binding(String refName, String origBindingName, String type, Map<String, Object> properties) {
ResourceBindingImpl binding = null;
for (Iterator<ServiceAndServiceReferencePair<ResourceBindingListener>> it = listeners.get... | Create a Java method that does the following: "Creates a binding object.". |
Of course, here is the Java code you requested:
```java
public Response editCoords(String photoId, String userId, Integer x, Integer y, Integer width, Integer height) throws JinxException {
JinxUtils.validateParams(photoId, userId, x, y, width, height);
Map<String, String> params = new TreeMap<>();
params.... | Create a Java method that does the following: "Edit the coordinates of a user s NCSUL specification.". |
Of course, here is the Java code you requested:
```java
public synchronized Chain getRunningChain(String chainName) {
Chain chain = null;
if (null != chainName) {
chain = this.chainRunningMap.get(chainName);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) ... | Create a Java method that does the following: "Get the running chain for the specified chain name.". |
Of course, here is the Java code you requested:
```java
public EClass getBCF() {
if (bcfEClass == null) {
bcfEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(196);
}
return bcfEClass;
}
```
Hope this helps! | Create a Java method that does the following: "Get the BCFEClass.". |
Of course, here is the Java code you requested:
```java
public FeatureSearchSupportedWmsServerLayer createLayer(String title, String crs, TileConfiguration tileConfig,
WmsLayerConfiguration layerConfig, WmsLayerInfo layerInfo, WfsFeatureTypeDescriptionInfo wfsConfig) {
return new FeatureSearchSupportedWmsServerLa... | Create a Java method that does the following: "Create a new WMS layer.". |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.