code stringlengths 160 48.7k | prompt stringlengths 38 3.13k |
|---|---|
Of course, here is the Java code you requested:
```java
public void setRow(int row, double[] values) {
checkIndices(row, values.length - 1);
values[row] = values[row];
}
```
Hope this helps! | Create a Java method that does the following: "Sets the row of the CID image.". |
Of course, here is the Java code you requested:
```java
public void println(String s) throws IOException
{
if(s!=null) {
this.output.write(s.getBytes(), 0, s.length());
}
this.output.write(CRLF, 0, 2);
}
```
Hope this helps! | Create a Java method that does the following: "Print a string to the output.". |
Of course, here is the Java code you requested:
```java
public UIForm locateForm() {
UIComponent parent = this.getParent();
while (!(parent instanceof UIForm)) {
if ((parent == null) || (parent instanceof UIViewRoot)) {
throw new IllegalStateException(
... | Create a Java method that does the following: "Locate the UIForm that this component is attached to.". |
Of course, here is the Java code you requested:
```java
@Override
protected void visitSoyNode(SoyNode node) {
if (isComputableAsJsExprsVisitor.exec(node)) {
// Simply generate JS expressions for this node and add them to the current output var.
jsCodeBuilder.addChunksToOutputVar(genJsExprsVisitor.exe... | Create a Java method that does the following: "Visit a SoyNode.". |
Of course, here is the Java code you requested:
```java
@Override
protected DataPoint[] getAllInRange(long timestampStartMs, long timestampEndMs) {
SortedSet<DataPoint> result = new TreeSet<DataPoint>(new Comparator<DataPoint>() {
@Override
public int compare(DataPoint block1, DataP... | Create a Java method that does the following: "Get all data points in a range of time.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
@Override
public <E> E getBean(Class<E> c) {
String name = c.getSimpleName();
String beanName = name.substring(0, 1).toLowerCase() + name.substring(1);
String className = c.getName();
// System.out.println("name:" + ... | Create a Java method that does the following: "Returns the bean with the specified name.". |
Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Completable doOnEvent(final Consumer<? super Throwable> onEvent) {
ObjectHelper.requireNonNull(onEvent, "onEvent is null");
return RxJavaPlugins.onAssembly(new Complet... | Create a Java method that does the following: "Asynchronous version of doOnEvent.". |
Of course, here is the Java code you requested:
```java
public void writeClass(String className)
throws IOException
{
ConstantPool pool = _javaClass.getConstantPool();
ClassConstant classConst = pool.getClass(className);
if (classConst != null)
writeShort(classConst.getIndex());
else
... | Create a Java method that does the following: "Write a class.". |
Of course, here is the Java code you requested:
```java
static SoyExpression accessField(
SoyProtoType protoType, SoyExpression baseExpr, FieldAccessNode node) {
return new AccessorGenerator(protoType, baseExpr, node).generate();
}
```
Hope this helps! | Create a Java method that does the following: "Returns a field access expression.". |
Of course, here is the Java code you requested:
```java
public static String mapToJSONString(Map<?, ?> map) {
if (map == null || map.size() == 0) {
return "{}";
}
StringBuilder sb = new StringBuilder("{");
for (Object o : map.entrySet()) {
Entry<?, ?> e = (Entry<?, ?>) o;
buildAppendString(sb, e.getKe... | Create a Java method that does the following: "Converts a Map to a JSON string.". |
Of course, here is the Java code you requested:
```java
public int[][] paths() {
final int[][] paths = new int[size()][0];
int i = 0;
for (final Cycle c : basis.members())
paths[i++] = c.path();
return paths;
}
```
Hope this helps! | Create a Java method that does the following: "Get the paths of all the classes in this class.". |
Of course, here is the Java code you requested:
```java
public static SchemaObjectBuilder schemaObjectFrom(Class<?> from) {
String jsonType = jsonType(from);
return schemaObject()
.withType(jsonType)
.withFormat(jsonFormat(from))
.withNullable(!from.isPrimitive())
... | Create a Java method that does the following: "Create a SchemaObjectBuilder from a class". |
Of course, here is the Java code you requested:
```java
private void processSimpleField(Field field) {
PropertyMetadata propertyMetadata = IntrospectionUtils.getPropertyMetadata(field);
if (propertyMetadata != null) {
metadata.putPropertyMetadata(propertyMetadata);
}
}
```
Hope this helps! | Create a Java method that does the following: "Process a single field.". |
Of course, here is the Java code you requested:
```java
private RegistrationResponse registerTaskExecutorInternal(
TaskExecutorGateway taskExecutorGateway,
String taskExecutorAddress,
ResourceID taskExecutorResourceId,
int dataPort,
HardwareDescription hardwareDescription) {
WorkerRegistration<WorkerT... | Create a Java method that does the following: "Register the TaskExecutor with the TaskManager.". |
Of course, here is the Java code you requested:
```java
public void marshall(RemediationParameterValue remediationParameterValue, ProtocolMarshaller protocolMarshaller) {
if (remediationParameterValue == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
... | Create a Java method that does the following: "marshalls the given remediationParameterValue to the JSON object.". |
Of course, here is the Java code you requested:
```java
private String trimOutputSpeech(String outputSpeech) {
if (outputSpeech == null) {
return "";
}
String trimmedOutputSpeech = outputSpeech.trim();
if (trimmedOutputSpeech.startsWith("<speak>") && trimmedOutputSpeech.ends... | Create a Java method that does the following: "Trims the output speech.". |
Of course, here is the Java code you requested:
```java
@Override
public String getOperationReplyDescription(String operationName, Locale locale, ResourceBundle bundle) {
try {
return bundle.getString(getBundleKey(operationName, REPLY));
} catch (MissingResourceException e) {
... | Create a Java method that does the following: "Get the description of the reply of the specified operation.". |
Of course, here is the Java code you requested:
```java
private static double[][] getFactorMatrixUsingCommonsMath(double[][] correlationMatrix, int numberOfFactors) {
/*
* Factor reduction
*/
// Create an eigen vector decomposition of the correlation matrix
double[] eigenValues;
double[][] eigenVectorMat... | Create a Java method that does the following: "Gets the factor matrix using the Commons Math algorithm.". |
Of course, here is the Java code you requested:
```java
@Override
public Statement convert(BELStatement bs) {
if (bs == null) {
return null;
}
String comment = bs.getComment();
String belSyntax = bs.getStatementSyntax();
Statement s = BELParser.parseStatement(b... | Create a Java method that does the following: "Convert a BELStatement to a BEL Statement.". |
Of course, here is the Java code you requested:
```java
public final EObject ruleCrossReferenceableTerminal() throws RecognitionException {
EObject current = null;
EObject this_Keyword_0 = null;
EObject this_RuleCall_1 = null;
enterRule();
try {
// InternalXte... | Create a Java method that does the following: "Use this method to perform the processing of a cross - referenceable terminal.". |
Of course, here is the Java code you requested:
```java
private OAuthWebView.AuthFailure getAuthFailure(Exception e) {
String error = getString(R.string.boxsdk_Authentication_fail);
if (e != null) {
// Get the proper exception
Throwable ex = e instanceof ExecutionException ?
... | Create a Java method that does the following: "Get the AuthenticationFailure object". |
Of course, here is the Java code you requested:
```java
public final <T> T decode(Object value) {
if (value == null) {
return null;
}
if (value instanceof Collection) {
List<T> list = new ArrayList<>();
Cast.<Collection<?>>as(value).forEach(o -> list.add(decode(o)));
... | Create a Java method that does the following: "Decodes the value.". |
Of course, here is the Java code you requested:
```java
public static Unmarshaller createUnmarshaller() throws JAXBException {
Unmarshaller m = getContext().createUnmarshaller();
m.setEventHandler(new XmlValidationHandler());
return m;
}
```
Hope this helps! | Create a Java method that does the following: "Create an instance of the JAXB Unmarshaller class.". |
Of course, here is the Java code you requested:
```java
@Override
public int getChildNodesCount(final NodeData parent) throws RepositoryException
{
if (cache.isEnabled())
{
int childCount = cache.getChildNodesCount(parent);
if (childCount >= 0)
{
return childCo... | Create a Java method that does the following: "Get child nodes count.". |
Of course, here is the Java code you requested:
```java
JCStatement parseStatementAsBlock() {
int pos = token.pos;
List<JCStatement> stats = blockStatement();
if (stats.isEmpty()) {
JCErroneous e = F.at(pos).Erroneous();
error(e, "illegal.start.of.stmt");
ret... | Create a Java method that does the following: "Parse a statement as a block.". |
Of course, here is the Java code you requested:
```java
public void addAdditionalElement(Component component) {
m_additionalElements.add(new InfoElementBean(m_additionalElements.size() + 1, component));
removeClickListener(m_clickListener);
m_clickListener = getClickListener(m_htmlLines, m_add... | Create a Java method that does the following: "Add an additional element to the exception.". |
Of course, here is the Java code you requested:
```java
public String str()
{
String str = m_DTMXRTreeFrag.getDTM().getStringValue(m_dtmRoot).toString();
return (null == str) ? "" : str;
}
```
Hope this helps! | Create a Java method that does the following: "Returns the string value of the node.". |
Of course, here is the Java code you requested:
```java
public static String getLogicalModuleName(String path) // F743-23167
{
int lastForwardSlash = path.lastIndexOf('/');
if (lastForwardSlash != -1)
{
path = path.substring(lastForwardSlash + 1);
}
int lastDot ... | Create a Java method that does the following: "Get the logical module name from a path.". |
Of course, here is the Java code you requested:
```java
public static ArrayList<String> getClassPathList()
{
if (_classPathList != null)
return _classPathList;
ArrayList<String> list = new ArrayList<String>();
String classPath = getClassPath();
String []classPathArray
= classPath.split(... | Create a Java method that does the following: "Get the classPathList". |
Of course, here is the Java code you requested:
```java
public void add(Repository repository, Object plugin) {
if (plugin instanceof Function) {
repository.put(((Function) plugin).getName().toLowerCase(), plugin);
} else {
log.debug("FunctionLoader: " + plugin.getClass() + " not of Type " + getLoa... | Create a Java method that does the following: "Add a plugin to the repository". |
Of course, here is the Java code you requested:
```java
public static Context begin(final String _userName)
throws EFapsException
{
return Context.begin(_userName, Inheritance.Inheritable);
}
```
Hope this helps! | Create a Java method that does the following: "Method to begin the context.". |
Of course, here is the Java code you requested:
```java
public boolean onBackPressed() {
if (corporateSSO) {
Log.d(TAG, "Removing the SSO Login Form, going back to the Username/Password Form.");
resetDomain();
showSSOMessage(true);
return true;
}
... | Create a Java method that does the following: "On back pressed the SSO Login Form.". |
Of course, here is the Java code you requested:
```java
@Override
public void error(VirtualConnection vc, TCPWriteRequestContext wsc, IOException ioe) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "error, vc=" + getVCHash());
}
// Nothing else... | Create a Java method that does the following: "Called by the TCPWriteRequestContext when an error occurs.". |
Of course, here is the Java code you requested:
```java
protected String getFilePattern( final Bundle bundle )
{
if( m_filePatternManifestHeader != null )
{
final Object value = bundle.getHeaders().get( m_filePatternManifestHeader );
if( value instanceof String && ( (String)... | Create a Java method that does the following: "Gets the file pattern from the bundle.". |
Of course, here is the Java code you requested:
```java
public void print() {
for (int i = 0; i < M; i++) {
for (int j = 0; j < N; j++) {
System.out.printf("%9.4f ", data[i][j]);
}
System.out.println();
}
}
```
Hope this helps! | Create a Java method that does the following: "Print the data to stdout.". |
Of course, here is the Java code you requested:
```java
@Nonnull
@Deprecated
public AS2ClientBuilder setPKCS12KeyStore (@Nullable final File aKeyStoreFile,
@Nullable final String sKeyStorePassword)
{
return setKeyStore (EKeyStoreType.PKCS12, aKeyStoreFile, sKeySto... | Create a Java method that does the following: "Set the key store for PKCS12.". |
Of course, here is the Java code you requested:
```java
public <K, V> StatefulRedisSentinelConnection<K, V> connectSentinel(RedisCodec<K, V> codec) {
checkForRedisURI();
return getConnection(connectSentinelAsync(codec, redisURI, timeout));
}
```
Hope this helps! | Create a Java method that does the following: "Connects a Redis Sentinel connection to the Redis server.". |
Of course, here is the Java code you requested:
```java
@Override
public AuditEvent transformToEvent(AnnotationAuditEvent annotationEvent) {
AuditEvent event = null;
if (annotationEvent.getClazz().isAnnotationPresent(Audit.class)
&& !annotationEvent.getMethod().isAnnotationPresent(IgnoreAudit.class)) {
ev... | Create a Java method that does the following: "Transform an annotation audit event to an audit event.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
private static List<String> getWebSphereGroups(final String securityName) {
Context ic = null;
try {
// TODO: Cache UserRegistry object
ic = new InitialContext();
Object objRef = ic.lookup(USER_REGISTRY);
Object use... | Create a Java method that does the following: "Gets the list of groups for a user.". |
Of course, here is the Java code you requested:
```java
public static <K, V> Map<K, V> filter(Map<K, V> map, Editor<Entry<K, V>> editor) {
return MapUtil.filter(map, editor);
}
```
Hope this helps! | Create a Java method that does the following: "Filter the given map by applying the given editor to each entry in the map.". |
Of course, here is the Java code you requested:
```java
private void parseMainVowel() {
if (!validViSyll)
return;
if (iCurPos > strSyllable.length() - 1) {
validViSyll = false;
return;
}
String strVowel = "";
for (int i = iCurPos; i < strSyllable.length(); ++i) {
int idx = vnVowels.indexOf(strSy... | Create a Java method that does the following: "Parses the main vowel.". |
Of course, here is the Java code you requested:
```java
private byte[] getBody(String method) {
byte[] body = null;
String methodsWithInputEntity = HttpMethod.POST.name() + "|" + HttpMethod.PUT.name() + "|" + HttpMethod.DELETE.name();
if (method.matches(methodsWithInputEntity)) {
if (isCo... | Create a Java method that does the following: "Get the body of the request". |
Of course, here is the Java code you requested:
```java
@Override
public boolean isValidFile(RandomAccessFile raf) throws IOException {
if (raf instanceof HTTPRandomAccessFile) { // only do remote if memory resident
if (raf.length() > raf.getBufferSize())
return false;
} else { ... | Create a Java method that does the following: "check if the file is a valid index file". |
Of course, here is the Java code you requested:
```java
public static void setRecordConverterClass(Configuration conf,
Class<?> klass) {
conf.set(RECORD_CONVERTER_CLASS_KEY, klass.getName());
}
```
Hope this helps! | Create a Java method that does the following: "Sets the record converter class.". |
Of course, here is the Java code you requested:
```java
public void record(long measurement) {
lastUsed = clock.now();
if (isExpired()) {
LOGGER.info("Attempting to get the value for an expired monitor: {}."
+ "Will start computing stats again.",
getConfig().getName());
star... | Create a Java method that does the following: "Record a single measurement.". |
Of course, here is the Java code you requested:
```java
public static boolean hasDifferentValue(XsdIntegerRestrictions o1, XsdIntegerRestrictions o2) {
if (o1 == null && o2 == null) {
return false;
}
int o1Value = Integer.MAX_VALUE;
int o2Value;
if (o1 != null) {
... | Create a Java method that does the following: "Checks if two attribute set have different values.". |
Of course, here is the Java code you requested:
```java
static boolean load(String path, AhoCorasickDoubleArrayTrie<String> trie, boolean reverse)
{
String datPath = path;
if (reverse)
{
datPath += Predefine.REVERSE_EXT;
}
if (loadDat(datPath, trie)) return true;... | Create a Java method that does the following: "Load a single AhoCorasickDoubleArrayTrie.". |
Of course, here is the Java code you requested:
```java
protected String deriveHtmlFilePath(String bodyFile) {
final String dirBase = bodyFile.contains("/") ? Srl.substringLastFront(bodyFile, "/") + "/" : "";
final String pureFileName = Srl.substringLastRear(bodyFile, "/"); // same if no delimiter
... | Create a Java method that does the following: "Derive the file path from the body file name.". |
Of course, here is the Java code you requested:
```java
public static int cudnnPoolingBackward(
cudnnHandle handle,
cudnnPoolingDescriptor poolingDesc,
Pointer alpha,
cudnnTensorDescriptor yDesc,
Pointer y,
cudnnTensorDescriptor dyDesc,
Pointer dy,
... | Create a Java method that does the following: "Function to perform backward pooling". |
Of course, here is the Java code you requested:
```java
public final <V> Mono<V> then(Mono<V> other) {
return Mono.onAssembly(new MonoIgnoreThen<>(new Publisher[] { this }, other));
}
```
Hope this helps! | Create a Java method that does the following: "Returns a Mono that is the same as this one but ignoring the other.". |
Of course, here is the Java code you requested:
```java
public void clear( ) {
checkNotClosed( );
if ( objects_to_close == null ) {
return;
}
RuntimeException re = null;
for ( AutoCloseable ac : objects_to_close ) {
try {
ac.close( );
}
catch ( Exception e ) {
if ( re == null ) {
re ... | Create a Java method that does the following: "Clears all objects.". |
Of course, here is the Java code you requested:
```java
protected void move(GL2 gl) {
gl.glTranslated(x, y, z);
gl.glScaled(scaleX, scaleY, scaleZ);
gl.glRotated(rotate, 0.0, 0.0, 1.0);
gl.glRotated(rotateX, 1.0, 0.0, 0.0);
gl.glRotated(rotateY, 0.0, 1.0, 0.0);
}
```
Hope this helps! | Create a Java method that does the following: "Move the coordinates.". |
Of course, here is the Java code you requested:
```java
public <TOut> Task<TOut> cast() {
@SuppressWarnings("unchecked")
Task<TOut> task = (Task<TOut>) this;
return task;
}
```
Hope this helps! | Create a Java method that does the following: "Cast this task to a task object.". |
Of course, here is the Java code you requested:
```java
public static IMolecularFormulaSet remove(IMolecularFormulaSet formulaSet, MolecularFormulaRange formulaRange) {
IMolecularFormulaSet newFormulaSet = formulaSet.getBuilder().newInstance(IMolecularFormulaSet.class);
for (IMolecularFormula formula... | Create a Java method that does the following: "Removes all MolecularFormula from the given range.". |
Of course, here is the Java code you requested:
```java
public synchronized void setBlob(String parameterName,
Blob x) throws SQLException {
super.setBlob(findParameterIndex(parameterName), x);
}
```
Hope this helps! | Create a Java method that does the following: "Sets the designated parameter to the given Java SQL blob object.". |
Of course, here is the Java code you requested:
```java
public void onNewMessage(Peer peer, int sender, long date, ContentDescription description,
boolean hasCurrentUserMention, int messagesCount, int dialogsCount) {
// Check if message already read to avoid incorrect notification... | Create a Java method that does the following: "OnNewMessage Method.". |
Of course, here is the Java code you requested:
```java
static SuggestedFix.Builder makeConcreteClassAbstract(ClassTree classTree, VisitorState state) {
Set<Modifier> flags = EnumSet.noneOf(Modifier.class);
flags.addAll(classTree.getModifiers().getFlags());
boolean wasFinal = flags.remove(FINAL);
boole... | Create a Java method that does the following: "Make an abstract class.". |
Of course, here is the Java code you requested:
```java
public static Stack getPageFlowStack( HttpServletRequest request )
{
ServletContext servletContext = InternalUtils.getServletContext( request );
return PageFlowStack.get( request, servletContext, true ).getLegacyStack();
}
```
Hope this h... | Create a Java method that does the following: "Get the PageFlowStack for the given request.". |
Of course, here is the Java code you requested:
```java
public StringBuffer appendTail(StringBuffer sb) {
if (appendPos < regionEnd) {
sb.append(input.substring(appendPos, regionEnd));
}
return sb;
}
```
Hope this helps! | Create a Java method that does the following: "Append the tail of the input string to the StringBuffer.". |
Of course, here is the Java code you requested:
```java
public void onLeafClick(LeafClickEvent event) {
LayerTreeTreeNode layerTreeNode;
if (event.getLeaf() instanceof LayerTreeLegendItemNode) {
layerTreeNode = ((LayerTreeLegendItemNode) event.getLeaf()).parent;
treeGrid.deselectRecord(event.getLeaf());
t... | Create a Java method that does the following: "When a leaf is clicked select the parent of the leaf node.". |
Of course, here is the Java code you requested:
```java
public synchronized JavaClassModel create(String qualifiedName)
{
// if a phantom exists, just convert it
PhantomJavaClassModel phantom = new GraphService<>(getGraphContext(), PhantomJavaClassModel.class).getUniqueByProperty(
... | Create a Java method that does the following: "Create a new instance of the class with the specified qualified name.". |
Of course, here is the Java code you requested:
```java
public static Value<Boolean> and (Value<Boolean>... values)
{
return and(Arrays.asList(values));
}
```
Hope this helps! | Create a Java method that does the following: "Creates an AND expression from the given values.". |
Of course, here is the Java code you requested:
```java
public final int getAttributeResourceID(int index) {
int resourceIndex=getAttribute(index).name;
if (m_resourceIDs==null ||
resourceIndex<0 || resourceIndex>=m_resourceIDs.length)
{
return 0;
}
r... | Create a Java method that does the following: "Gets the attribute resource ID.". |
Of course, here is the Java code you requested:
```java
public static Object getUIDefaultOfClass(Class clazz, String property) {
Object retVal = null;
UIDefaults defaults = getUIDefaultsOfClass(clazz);
List<Object> listKeys = Collections.list(defaults.keys());
for (Object key : listKeys) {
... | Create a Java method that does the following: "Get the value of the property in the class.". |
Of course, here is the Java code you requested:
```java
public static MultiPolygon fromLngLats(@NonNull List<List<List<Point>>> points) {
return new MultiPolygon(TYPE, null, points);
}
```
Hope this helps! | Create a Java method that does the following: "Creates a multipolygon from a list of lon lat lon lon". |
Of course, here is the Java code you requested:
```java
public void isValidTypeModifierDefinition(Set<TypeDefinitionCategory> legalTypes) {
Preconditions.checkArgument(1 == this.size(), "exactly one type modifier is expected");
for (TypeDefinitionCategory type : this.keySet()) {
Preconditio... | Create a Java method that does the following: "Check that all the type modifiers are legal.". |
Of course, here is the Java code you requested:
```java
public PageSnapshot highlightWithText(WebElement element, Color elementColor, int lineWidth, String text, Color textColor, Font textFont) {
try {
highlight(element, elementColor, 0);
Coordinates coords = new Coordinates(element, devic... | Create a Java method that does the following: "Highlights the element with text.". |
Of course, here is the Java code you requested:
```java
private void updateFdMetrics() {
if (osMbean instanceof com.sun.management.UnixOperatingSystemMXBean) {
final com.sun.management.UnixOperatingSystemMXBean unix =
(com.sun.management.UnixOperatingSystemMXBean) osMbean;
fdCount.setValue(u... | Create a Java method that does the following: "Update the fd metrics.". |
Of course, here is the Java code you requested:
```java
protected void dispose() {
// Remove shutdown hook to prevent resource leaks
ShutdownHookUtil.removeShutdownHook(shutdownHook, getClass().getSimpleName(), LOG);
try {
PlanExecutor executor = this.executor;
if (executor != null) {
executor.stop();... | Create a Java method that does the following: "Dispose of the session.". |
Of course, here is the Java code you requested:
```java
public void marshall(EgressFilter egressFilter, ProtocolMarshaller protocolMarshaller) {
if (egressFilter == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarsha... | Create a Java method that does the following: "marshalls the given EgressFilter to the JSON - compatible parameter object.". |
Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "urn:switchyard-quickstart-demo:library:1.0", name = "returnRequest")
public JAXBElement<ReturnRequest> createReturnRequest(ReturnRequest value) {
return new JAXBElement<ReturnRequest>(RETURN_REQUEST_QNAME, ReturnRequest.cl... | Create a Java method that does the following: "Create an instance of the returnRequest JAXBElement.". |
Of course, here is the Java code you requested:
```java
@Override
public Request<DescribeStaleSecurityGroupsRequest> getDryRunRequest() {
Request<DescribeStaleSecurityGroupsRequest> request = new DescribeStaleSecurityGroupsRequestMarshaller().marshall(this);
request.addParameter("DryRun", Boolean.t... | Create a Java method that does the following: "Gets the request that specifies the details of stale security groups that are stale.". |
Of course, here is the Java code you requested:
```java
public static void globalClassesAbsent(Class<?> aClass){
throw new MappingErrorException(MSG.INSTANCE.message(mappingErrorRelationalException3, aClass.getSimpleName()));
}
```
Hope this helps! | Create a Java method that does the following: "Thrown when a class is missing from the global classes list.". |
Of course, here is the Java code you requested:
```java
@Override
public Object find(Class entityClass, Object key)
{
EntityMetadata entityMetadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, entityClass);
Object e = r.db(entityMetadata.getSchema()).table(entityMetadata.getTab... | Create a Java method that does the following: "Find a single record from the database.". |
Of course, here is the Java code you requested:
```java
@Override
public String decode( String encodedText ) {
if (encodedText == null) return null;
if (encodedText.length() < 7) {
// Not big enough to have an encoded sequence
return encodedText;
}
StringBuil... | Create a Java method that does the following: "This method is used to decode a string of the sequence class from the base64 encoding.". |
Of course, here is the Java code you requested:
```java
public static <T> T getAt(List<T> self, int idx) {
int size = self.size();
int i = normaliseIndex(idx, size);
if (i < size) {
return self.get(i);
} else {
return null;
}
}
```
Hope this helps! | Create a Java method that does the following: "Gets the value at the given index.". |
Of course, here is the Java code you requested:
```java
public VertexElement addVertexElementWithEdgeIdProperty(Schema.BaseType baseType, ConceptId conceptId) {
Objects.requireNonNull(conceptId);
Vertex vertex = graph.addVertex(baseType.name());
long start = System.currentTimeMillis();
... | Create a Java method that does the following: "Add a VertexElement with an edge - id property.". |
Of course, here is the Java code you requested:
```java
public int setColumnIndexUsingSchema(NodeSchema inputSchema) {
int index = inputSchema.getIndexOfTve(this);
if (index < 0) {
//* enable to debug*/ System.out.println("DEBUG: setColumnIndex miss: " + this);
//* enable to deb... | Create a Java method that does the following: "Sets the column index using the input schema.". |
Of course, here is the Java code you requested:
```java
public static MetricValue merge(MetricKind kind, MetricValue prior, MetricValue latest) {
if (prior.getValueCase() != latest.getValueCase()) {
log.atWarning().log("Could not merge different types of metric: %s, %s", prior, latest);
throw new Illeg... | Create a Java method that does the following: "Merge two metric values.". |
Of course, here is the Java code you requested:
```java
Set<String> getValues(RequestType pType, ObjectName pName) {
if (RequestType.READ == pType) {
return readAttributes.get(pName);
} else if (RequestType.WRITE == pType) {
return writeAttributes.get(pName);
} else if (... | Create a Java method that does the following: "Gets the values for a single attribute.". |
Of course, here is the Java code you requested:
```java
public static String[] getDataFromLine(final String line, final String seperator,
final boolean trim)
{
final StringTokenizer tokenizer = new StringTokenizer(line, seperator);
final List<String> data = new ArrayList<>();
while (tokenizer.hasMoreElements(... | Create a Java method that does the following: "Get the data from a line.". |
Of course, here is the Java code you requested:
```java
public B substituteProperties(final B b, final Properties submittedProps) {
return this.substituteProperties(b, submittedProps, null);
}
```
Hope this helps! | Create a Java method that does the following: "Substitute properties in a B.". |
Of course, here is the Java code you requested:
```java
public static String getDirName(Props props) {
String dirSuffix = props.get(CommonJobProperties.NESTED_FLOW_PATH);
if ((dirSuffix == null) || (dirSuffix.length() == 0)) {
dirSuffix = props.get(CommonJobProperties.JOB_ID);
if ((dirSuffix == nu... | Create a Java method that does the following: "Get the directory name from the properties.". |
Of course, here is the Java code you requested:
```java
public EClass getMPGRG() {
if (mpgrgEClass == null) {
mpgrgEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(420);
}
return mpgrgEClass;
}
```
Hope this helps! | Create a Java method that does the following: "Get the MPGRG.". |
Of course, here is the Java code you requested:
```java
public static String[] split(String input, String regex) {
if (input == null) {
return null;
}
String[] arr = input.split(regex);
List<String> results = new ArrayList<>(arr.length);
for (String a : arr) {
if (!a.trim().isEmpty()) {... | Create a Java method that does the following: "Split a string into an array of strings.". |
Of course, here is the Java code you requested:
```java
private I_CmsListDateRestriction parseRange(CmsXmlContentValueLocation dateRestriction) {
CmsXmlContentValueLocation location = dateRestriction.getSubValue(N_RANGE);
if (location == null) {
return null;
}
CmsXmlContent... | Create a Java method that does the following: "Parses a range restriction.". |
Of course, here is the Java code you requested:
```java
public final void save(String dirName, String className, String methodName, Set<RegData> regData) {
// @Research(if statement).
if (!Config.X_DEPENDENCIES_SAVE_V) {
return;
}
// Ensure that the directory for coverage ex... | Create a Java method that does the following: "Saves a set of coverage data to a file.". |
Of course, here is the Java code you requested:
```java
private void checkSslConfigAvailability(Config config) {
if (config.getAdvancedNetworkConfig().isEnabled()) {
return;
}
SSLConfig sslConfig = config.getNetworkConfig().getSSLConfig();
checkSslConfigAvailability(sslConfi... | Create a Java method that does the following: "Check if SSL config is available.". |
Of course, here is the Java code you requested:
```java
public void resetClientInformation(WSRdbManagedConnectionImpl mc) throws SQLException {
if (mc.mcf.jdbcDriverSpecVersion >= 40 && (mc.clientInfoExplicitlySet || mc.clientInfoImplicitlySet)) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEn... | Create a Java method that does the following: "resetClientInformation This method is called by the application to reset the client information of the managed connection.". |
Of course, here is the Java code you requested:
```java
@Override
protected Void doInBackground(Void... args) {
switch (type) {
case FACEBOOK:
FacebookUtils.unlink(context.get());
break;
case TWITTER:
TwitterUtils.unlink(context.get());
break;
}
return null;
}
```
Hope this helps! | Create a Java method that does the following: "Unlinks the Facebook or Twitter resources.". |
Of course, here is the Java code you requested:
```java
private static void addRelationPropertyDefinitions(RelationshipTypeDefinitionImpl type) {
type.addPropertyDefinition(
createPropDef(
PropertyIds.SOURCE_ID,
"Source",
"Source",
Pr... | Create a Java method that does the following: "Adds the relation property definitions.". |
Of course, here is the Java code you requested:
```java
public List<Object> find(String name, boolean required) throws ReferenceException {
if (name == null || name.length() == 0) {
throw new NullPointerException(name);
}
Object locator = find(name);
if (locator == null) {
if (required) {
throw new ... | Create a Java method that does the following: "Find the list of objects that match the specified name.". |
Of course, here is the Java code you requested:
```java
public void setPatches(java.util.Collection<Patch> patches) {
if (patches == null) {
this.patches = null;
return;
}
this.patches = new com.amazonaws.internal.SdkInternalList<Patch>(patches);
}
```
Hope this he... | Create a Java method that does the following: "Sets the value of the patches property.". |
Of course, here is the Java code you requested:
```java
public ProductPartitionNode removeChild(ProductDimension childDimension) {
if (!children.containsKey(childDimension)) {
throw new IllegalArgumentException(String.format(
"Attempted to remove child %s but no such child exists", toString(childDi... | Create a Java method that does the following: "Removes a child node from this node.". |
Of course, here is the Java code you requested:
```java
public BlockHeader read(byte[] buffer, int offset, int postHeaderSkipBytes)
{
m_offset = offset;
System.arraycopy(buffer, m_offset, m_header, 0, 8);
m_offset += 8;
int nameLength = FastTrackUtility.getInt(buffer, m_offset);
m_of... | Create a Java method that does the following: "Read the header from the given buffer.". |
Of course, here is the Java code you requested:
```java
@Deprecated
public JSONObject addUserKey(List<String> acls, int validity, int maxQueriesPerIPPerHour, int maxHitsPerQuery) throws AlgoliaException {
return addApiKey(acls, validity, maxQueriesPerIPPerHour, maxHitsPerQuery);
}
```
Hope this helps! | Create a Java method that does the following: "Add a user key to the API.". |
Of course, here is the Java code you requested:
```java
public long getLongField(String name) throws NumberFormatException {
HttpField field = getField(name);
return field == null ? -1L : field.getLongValue();
}
```
Hope this helps! | Create a Java method that does the following: "Gets the value of the specified field as a long.". |
Of course, here is the Java code you requested:
```java
public void marshall(UpdateRecordsRequest updateRecordsRequest, ProtocolMarshaller protocolMarshaller) {
if (updateRecordsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
... | Create a Java method that does the following: "marshalls the given updateRecordsRequest to the JSON object.". |
Of course, here is the Java code you requested:
```java
public Observable<InputStream> generateThumbnailAsync(int width, int height, String url, GenerateThumbnailOptionalParameter generateThumbnailOptionalParameter) {
return generateThumbnailWithServiceResponseAsync(width, height, url, generateThumbnailOptiona... | Create a Java method that does the following: "Generates a thumbnail of the image.". |
Of course, here is the Java code you requested:
```java
public Boolean isValid() {
return addressLine1 != null ||
addressLine2 != null ||
city != null ||
region != null ||
postalCode != null ||
(country != null && country != Count... | Create a Java method that does the following: "Returns true if the address is valid.". |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.