code stringlengths 160 48.7k | prompt stringlengths 55 1.51k |
|---|---|
Of course, here is the Java code you requested:
```java
public static void recordDefaultAnnotationHandlerMappingInstance(Object obj) {
if (debug) {
System.out.println("SPRING_PLUGIN: Recording new instance of DefaultAnnotationHandlerMappingInstance");
}
defaultAnnotationHandlerMappingInstances.add(obj);
}
``... | Create a Java method that does the following: "Records a new instance of the DefaultAnnotationHandlerMappingInstance.". |
Of course, here is the Java code you requested:
```java
boolean replace(K key, long expectedOldValue, long newValue) {
if (expectedOldValue == 0L) {
return putIfAbsent(key, newValue) == 0L;
} else {
return map.replace(key, expectedOldValue, newValue);
}
}
```
Hope this helps! | Create a Java method that does the following: "Replaces the entry with the new value.". |
Of course, here is the Java code you requested:
```java
public void closeQuietly(@Nullable final Closeable pCloseable)
{
if (pCloseable != null) {
try {
pCloseable.close();
}
catch (IOException e) {
// ignore
}
}
}
... | Create a Java method that does the following: "Close the Closeable.". |
Of course, here is the Java code you requested:
```java
@Override
public void computeHessian(DMatrixSparseCSC jacLeft , DMatrixSparseCSC jacRight) {
A.reshape(jacLeft.numCols,jacLeft.numCols,1);
B.reshape(jacLeft.numCols,jacRight.numCols,1);
D.reshape(jacRight.numCols,jacRight.numCols,1);
// take advantage o... | Create a Java method that does the following: "Computes the Hessian of the two matrices.". |
Of course, here is the Java code you requested:
```java
static Predicate<DateValue> byMonthDayFilter(final int[] monthDays) {
return new Predicate<DateValue>() {
private static final long serialVersionUID = -1618039447294490037L;
public boolean apply(DateValue date) {
int nDays = TimeUtils.monthLength(dat... | Create a Java method that does the following: "Create a filter that accepts dates in the specified month.". |
Of course, here is the Java code you requested:
```java
public static filterglobal_binding get(nitro_service service) throws Exception{
filterglobal_binding obj = new filterglobal_binding();
filterglobal_binding response = (filterglobal_binding) obj.get_resource(service);
return response;
}
```
Hope this helps... | Create a Java method that does the following: "Use this API to fetch a filterglobal_binding resource.". |
Of course, here is the Java code you requested:
```java
public static void addPendingHttpResponse(int statusCode, String responseBody, Header... headers) {
getFakeHttpLayer().addPendingHttpResponse(statusCode, responseBody, headers);
}
```
Hope this helps! | Create a Java method that does the following: "Add a pending HTTP response to the response layer.". |
Of course, here is the Java code you requested:
```java
public void marshall(CreateRealtimeEndpointRequest createRealtimeEndpointRequest, ProtocolMarshaller protocolMarshaller) {
if (createRealtimeEndpointRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
... | Create a Java method that does the following: "Creates the given parameter object.". |
Of course, here is the Java code you requested:
```java
protected static BufferedImage loadImage (InputStream iis)
throws IOException
{
BufferedImage image;
if (iis instanceof ImageInputStream) {
image = ImageIO.read(iis);
} else {
// if we don't already ha... | Create a Java method that does the following: "Load an image from an input stream.". |
Of course, here is the Java code you requested:
```java
public static short[] add(short[] array, short element) {
short[] newArray = (short[])copyArrayGrow1(array, Short.TYPE);
newArray[newArray.length - 1] = element;
return newArray;
}
```
Hope this helps! | Create a Java method that does the following: "Add an element to an array.". |
Of course, here is the Java code you requested:
```java
@Override
public Long getValue(int pollerIndex) {
final long cnt = getCount(pollerIndex);
return (cnt == 0) ? 0L : totalTime.getValue().longValue() / cnt;
}
```
Hope this helps! | Create a Java method that does the following: "Gets the value of the total time of the poller.". |
Of course, here is the Java code you requested:
```java
private static String getHttpOnlyCookieHeader(Cookie cookie) {
NewCookie newCookie = new NewCookie(cookie.getName(), cookie.getValue(),
cookie.getPath(), cookie.getDomain(), cookie.getVersion(),
cookie.getComment(), cookie.getMaxAge(), cookie.getS... | Create a Java method that does the following: "Get the HttpOnly cookie header". |
Of course, here is the Java code you requested:
```java
public final ActionMethod getActionMethod(String path) {
// 不带参数的请求
ActionMethod actionMethod = this.get(path);
if (null != actionMethod) {
return actionMethod;
}
// 带参数的请求
final int lastSlashIndex = path.lastIndexOf(StrUtil.SLASH);
i... | Create a Java method that does the following: "Gets the action method for the specified path.". |
Of course, here is the Java code you requested:
```java
public static String normalize(int c) {
// EOF
if (c == -1) return (null);
// ASCII chars
if (c >= ' ' && c <= 128) return ("" + (char) c);
// Upper case
boolean u = Character.isUpperCase(c);
char cu = (char) Character.toUpperCase(c)... | Create a Java method that does the following: "Normalizes a character to a String.". |
Of course, here is the Java code you requested:
```java
@Override
public void startElement(String namespaceURI, String lName,
String qName, Attributes attrs) throws SAXException {
switch (qName) {
case "category":
String catName = attrs.getValue(NAME);
String catI... | Create a Java method that does the following: "Override the startElement method for the XML 1. 0 specification.". |
Of course, here is the Java code you requested:
```java
public void marshall(VpcConfig vpcConfig, ProtocolMarshaller protocolMarshaller) {
if (vpcConfig == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.mars... | Create a Java method that does the following: "marshalls the given vpcConfig to the JSON object.". |
Of course, here is the Java code you requested:
```java
protected static String fetchString(String key) {
List<String> stringList = (List<String>) fetchObject(key);
return stringList.get(RandomUtils.nextInt(stringList.size()));
}
```
Hope this helps! | Create a Java method that does the following: "Fetch a string from the cache.". |
Of course, here is the Java code you requested:
```java
public static JSONObject loadExternalJSONDocument(Context context, final String file) {
return loadExternalJSONFile(context, Environment.DIRECTORY_DOCUMENTS, file);
}
```
Hope this helps! | Create a Java method that does the following: "Load an external JSON document from a file.". |
Of course, here is the Java code you requested:
```java
public void
sortR(DapNode node, List<DapNode> sortlist)
{
DapVariable var = null;
Map<String, DapAttribute> attrs = null;
sortlist.add(node);
switch (node.getSort()) {
case DATASET:
case GROUP:
/... | Create a Java method that does the following: "Sort a single node in the resultant list.". |
Of course, here is the Java code you requested:
```java
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
try {
if (com.google.api.ads.adwords.axis.v201809.cm.ConstantDataServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
... | Create a Java method that does the following: "Gets the remote port for the given interface.". |
Of course, here is the Java code you requested:
```java
public static Builder newConvertBuilder(String input, String output) {
return new Builder(input, output, TaskGroupActivity.CONVERT);
}
```
Hope this helps! | Create a Java method that does the following: "Create a new Convert builder.". |
Of course, here is the Java code you requested:
```java
public JettyServiceBuilder attr(String name, Object attribute) {
attrs.put(requireNonNull(name, "name"), requireNonNull(attribute, "attribute"));
return this;
}
```
Hope this helps! | Create a Java method that does the following: "Add a custom attribute to the application.". |
Of course, here is the Java code you requested:
```java
@Override
public EClass getIfcApproval() {
if (ifcApprovalEClass == null) {
ifcApprovalEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI).getEClassifiers()
.get(22);
}
return ifcApprovalEClass;
}
```
Hope this he... | Create a Java method that does the following: "Get the IfcApproval class.". |
Of course, here is the Java code you requested:
```java
private void initializePlot() {
plot = new VisualizationPlot();
{ // Add a background element:
CSSClass cls = new CSSClass(this, "background");
final String bgcol = context.getStyleLibrary().getBackgroundColor(StyleLibrary.PAGE);
cls.set... | Create a Java method that does the following: "Initialize the visualization plot.". |
Of course, here is the Java code you requested:
```java
public PStm findStatement(ClassListInterpreter classes, File file,
int lineno)
{
for (SClassDefinition c : classes)
{
if (c.getName().getLocation().getFile().equals(file))
{
PStm stmt = findStatement(c, lineno);
if (stmt != null)
{
... | Create a Java method that does the following: "Find a statement in the given class list.". |
Of course, here is the Java code you requested:
```java
public void callFunction(
final String name,
final List<?> args,
final @Nullable Long requestTimeout) {
this.functionService.callFunction(name, args, requestTimeout);
}
```
Hope this helps! | Create a Java method that does the following: "Call a function.". |
Of course, here is the Java code you requested:
```java
public static BOMInputStream getBOMInputStream(File file) throws IORuntimeException {
try {
return new BOMInputStream(new FileInputStream(file));
} catch (IOException e) {
throw new IORuntimeException(e);
}
}
```
Hope this helps! | Create a Java method that does the following: "Returns a new BOMInputStream for the specified file.". |
Of course, here is the Java code you requested:
```java
public static List<Polygon> createSimpleDirectionArrow( Geometry... geometries ) {
List<Polygon> polygons = new ArrayList<>();
for( Geometry geometry : geometries ) {
for( int i = 0; i < geometry.getNumGeometries(); i++ ) {
... | Create a Java method that does the following: "Create a list of polygons that are simple directions.". |
Of course, here is the Java code you requested:
```java
@Override
public ConfirmConnectionResult confirmConnection(ConfirmConnectionRequest request) {
request = beforeClientExecution(request);
return executeConfirmConnection(request);
}
```
Hope this helps! | Create a Java method that does the following: "Confirm a connection with an existing CA.". |
Of course, here is the Java code you requested:
```java
@Override
public DeleteLoadBalancerTlsCertificateResult deleteLoadBalancerTlsCertificate(DeleteLoadBalancerTlsCertificateRequest request) {
request = beforeClientExecution(request);
return executeDeleteLoadBalancerTlsCertificate(request);
... | Create a Java method that does the following: "Deletes the TLS certificate associated with an load balancer.". |
Of course, here is the Java code you requested:
```java
void choosePaginationPlugin(Context context) {
DatabaseType type = detectDB(context);
PluginConfiguration pluginConfiguration = new PluginConfiguration();
switch (type) {
case MYSQL:
pluginConfiguration.setConfigurationType(MySqlPaginati... | Create a Java method that does the following: "Choose pagination plugin for a context". |
Of course, here is the Java code you requested:
```java
protected String getPropertyValue(String prefix, String postfix) {
String ret = properties.getProperty(prefix + "." + postfix);
if (ret != null) {
// logger.debugFine("Found property: "+prefix + "." +
// postfix+" for "+prefix);
return r... | Create a Java method that does the following: "Get the value of a property with the specified prefix and postfix.". |
Of course, here is the Java code you requested:
```java
public void waitForUninterruptibly(Guard guard) {
if (!((guard.monitor == this) & lock.isHeldByCurrentThread())) {
throw new IllegalMonitorStateException();
}
if (!guard.isSatisfied()) {
awaitUninterruptibly(guard, true);
}
}
```
Ho... | Create a Java method that does the following: "Wait for the guard to be satisfied.". |
Of course, here is the Java code you requested:
```java
public ClientConnection createFlow(final Flow flow, final ReplyProcessor rp) {
Exceptions.checkNotClosed(closed.get(), this);
Preconditions.checkState(!disableFlow.get(), "Ensure flows are enabled.");
log.info("Creating Flow {} for endpoin... | Create a Java method that does the following: "Create a new flow.". |
Of course, here is the Java code you requested:
```java
public Status do_GETRoot(Database _db, String _docID, String _attachmentName) {
Map<String, Object> info = new HashMap<String, Object>();
info.put("CBLite", "Welcome");
info.put("couchdb", "Welcome"); // for compatibility
info.put(... | Create a Java method that does the following: "This is the main entry point for the root page.". |
Of course, here is the Java code you requested:
```java
public int getBucketIdLengthForUnorderedCollection( Name nodeTypeName, Set<Name> mixinTypes ) {
Set<Name> allTypes = new LinkedHashSet<>();
allTypes.add(nodeTypeName);
if (mixinTypes != null && !mixinTypes.isEmpty()) {
allTypes... | Create a Java method that does the following: "Gets the bucket id length for an unordered collection node type.". |
Of course, here is the Java code you requested:
```java
private void writeObject(java.io.ObjectOutputStream s)
throws java.io.IOException {
s.defaultWriteObject();
s.writeInt(length());
s.writeObject(getValue());
}
```
Hope this helps! | Create a Java method that does the following: "Write the object.". |
Of course, here is the Java code you requested:
```java
public Pair<List<Node>, List<Node>> splitIntervalPattern(String raw) {
List<Node> pattern = parse(raw);
Set<Character> seen = new HashSet<>();
List<Node> fst = new ArrayList<>();
List<Node> snd = new ArrayList<>();
// Indicates we've seen a ... | Create a Java method that does the following: "Split the interval pattern into two lists of nodes.". |
Of course, here is the Java code you requested:
```java
public String decrypt(final byte[] text, final KeyType keyType) throws EncryptionException {
final Key key = keyType == KeyType.PRIVATE ? privateKey : publicKey;
try {
// get an RSA cipher object and print the provider
final Cipher ... | Create a Java method that does the following: "Decrypt the text using the specified key type". |
Of course, here is the Java code you requested:
```java
public static void main(String[] args)
{
try
{
setupSystemProperties();
Settings settings = parseCommandLine(args);
// Create a server instance
FFMQServer server = new FFMQServer("engine1",settin... | Create a Java method that does the following: "Main method for the
CTYPE test.". |
Of course, here is the Java code you requested:
```java
public Collection<Logger> getLoggers() {
LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
List<Logger> loggers = new ArrayList<>(ctx.getLoggers());
Collections.sort(loggers, LOGGER_COMP);
return loggers;
}
```
Hope this helps! | Create a Java method that does the following: "Returns a collection of all loggers in the system.". |
Of course, here is the Java code you requested:
```java
public static GeneralParameterValue[] createGridGeometryGeneralParameter( int width, int height, double north, double south,
double east, double west, CoordinateReferenceSystem crs ) {
GeneralParameterValue[] readParams = new GeneralParameterV... | Create a Java method that does the following: "Create a GeneralParameterValue array for reading a 2D grid geometry.". |
Of course, here is the Java code you requested:
```java
protected final void verifyFieldType(short id, String name, Collection<FieldMetadata> fields, ThriftCatalog catalog)
{
boolean isSupportedType = true;
for (FieldMetadata field : fields) {
if (!catalog.isSupportedStructFieldType(fie... | Create a Java method that does the following: "Verify the field type.". |
Of course, here is the Java code you requested:
```java
public static String makeFormattedString(
String aAttrName,
int aInt,
boolean aPrependSeparator) {
StringBuffer mStrBuff = new StringBuffer(PreFormatString(aAttrName, aPrependSeparator));
mStrBuff.append(String.valueOf(aInt... | Create a Java method that does the following: "Make a formatted string of a single entry.". |
Of course, here is the Java code you requested:
```java
public boolean newLineAtEnd () {
return text.length() != 0
&& (text.charAt(text.length() - 1) == ENTER_ANDROID || text.charAt(text.length() - 1) == ENTER_DESKTOP);
}
```
Hope this helps! | Create a Java method that does the following: "Returns true if the current line is at the end of the text.". |
Of course, here is the Java code you requested:
```java
private static List<DAType> computeExtendedInterfaces(List<DAInterface> interfaces) {
Optional<DAType> functionInterface = from(interfaces)
.filter(DAInterfacePredicates.isGuavaFunction())
.transform(toDAType())
.filter(notNull())
... | Create a Java method that does the following: "Compute extended interfaces.". |
Of course, here is the Java code you requested:
```java
@Override
public boolean canHandleData(IoBuffer data) {
byte first = data.get();
boolean result = ((first & 0x0f) == VideoCodec.SCREEN_VIDEO.getId());
data.rewind();
return result;
}
```
Hope this helps! | Create a Java method that does the following: "Override this method to check if the buffer contains a record of a record of type TYPE_VIDEO.". |
Of course, here is the Java code you requested:
```java
private static void deleteContents(File dir) {
if (dir != null && dir.exists()) {
for (File f : dir.listFiles()) {
if (f.isDirectory()) {
deleteContents(f);
}
f.delete();
... | Create a Java method that does the following: "Delete all the content of a directory.". |
Of course, here is the Java code you requested:
```java
public void marshall(AssociateSkillWithUsersRequest associateSkillWithUsersRequest, ProtocolMarshaller protocolMarshaller) {
if (associateSkillWithUsersRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)"... | Create a Java method that does the following: "Creates the given parameter object.". |
Of course, here is the Java code you requested:
```java
@Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLAnnotationImpl instance) throws SerializationException {
deserialize(streamReader, instance);
}
```
Hope this helps! | Create a Java method that does the following: "Deserialize an instance of the
class.". |
Of course, here is the Java code you requested:
```java
protected void announceAttributes() {
if (this.originString == null) {
log.error("Unable to announce solution types, no Origin String set.");
return;
}
this.sentAttrSpecifications = true;
if (this.attributes.size() > 0) {
AttributeAnnounceMessage... | Create a Java method that does the following: "Send an AttributeAnnounceMessage to the solution type.". |
Of course, here is the Java code you requested:
```java
public int getFeatureShapeCount(String database, String table, long featureId) {
return getFeatureShape(database, table, featureId).count();
}
```
Hope this helps! | Create a Java method that does the following: "Get the feature shape count.". |
Of course, here is the Java code you requested:
```java
@Override
public Configuration getConfiguration() {
return Tang.Factory.getTang().newConfigurationBuilder()
.bindNamedParameter(TcpPortRangeBegin.class, String.valueOf(portRangeBegin))
.bindNamedParameter(TcpPortRangeCount.class, String.valu... | Create a Java method that does the following: "Get the configuration.". |
Of course, here is the Java code you requested:
```java
public static <ReqT, RespT> Iterator<RespT> blockingServerStreamingCall(
ClientCall<ReqT, RespT> call, ReqT req) {
BlockingResponseStream<RespT> result = new BlockingResponseStream<>(call);
asyncUnaryRequestCall(call, req, result.listener(), true);
... | Create a Java method that does the following: "Blocking server streaming call.". |
Of course, here is the Java code you requested:
```java
public static String hash(Serializable obj) {
if (obj == null) {
return "";
}
StringBuilder hexString = new StringBuilder();
try {
MessageDigest m = MessageDigest.getInstance("SHA1");
m.update(SerializationUtils.serialize(obj));
byte[] mdby... | Create a Java method that does the following: "Returns the SHA1 hash of the given object.". |
Of course, here is the Java code you requested:
```java
public ServiceCall<Gateway> getGateway(GetGatewayOptions getGatewayOptions) {
Validator.notNull(getGatewayOptions, "getGatewayOptions cannot be null");
String[] pathSegments = { "v1/environments", "gateways" };
String[] pathParameters = { getGatewayOp... | Create a Java method that does the following: "Get gateway.". |
Of course, here is the Java code you requested:
```java
@Nullable
public static MethodSymbol resolveExistingMethod(
VisitorState state,
TypeSymbol base,
Name name,
Iterable<Type> argTypes,
Iterable<Type> tyargTypes) {
Resolve resolve = Resolve.instance(state.context);
Enter ente... | Create a Java method that does the following: "Resolve an existing method.". |
Of course, here is the Java code you requested:
```java
@FFDCIgnore(InvocationTargetException.class)
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "invoke",... | Create a Java method that does the following: "Override the invoke method to call the method on the actual message object.". |
Of course, here is the Java code you requested:
```java
@Override
@InterfaceAudience.Private
public void changed(Database.ChangeEvent event) {
final List<DocumentChange> changes = event.getChanges();
supportExecutor.submit(new Runnable() {
@Override
public void run() {
... | Create a Java method that does the following: "Called when a database change event occurs.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public void startRegistration() {
if (canceled) {
// we already got canceled
return;
}
try {
// trigger resolution of the target address to a callable gateway
final CompletableFuture<G> rpcGatewayFuture;
if (... | Create a Java method that does the following: "Start the registration of the target type.". |
Of course, here is the Java code you requested:
```java
public static base_response save(nitro_service client, cachecontentgroup resource) throws Exception {
cachecontentgroup saveresource = new cachecontentgroup();
saveresource.name = resource.name;
return saveresource.perform_operation(client,"save");
}
```
... | Create a Java method that does the following: "Use this API to save cachecontentgroup.". |
Of course, here is the Java code you requested:
```java
public Query addValueRefinement(String navigationName, String value, boolean exclude) {
return addRefinement(navigationName, new RefinementValue().setValue(value).setExclude(exclude));
}
```
Hope this helps! | Create a Java method that does the following: "Add a value refinement to a navigation". |
Of course, here is the Java code you requested:
```java
@Override
public int read() throws IOException {
int value = super.read();
eofReached = value == -1;
if (!eofReached) {
bytesRead++;
}
return value;
}
```
Hope this helps! | Create a Java method that does the following: "read method for the base class.". |
Of course, here is the Java code you requested:
```java
private static long[] checkStringIndex(String term) {
assert (term != null);
// If second element is < 0, this is a dict key
long[] result = {0L, 1L};
// Empty strings are not allowed.
if ("".equals(term)) { //$NON-NLS-1$
throw EvaluationExc... | Create a Java method that does the following: "Checks if the string is an index.". |
Of course, here is the Java code you requested:
```java
public DescribeInstanceInformationRequest withFilters(InstanceInformationStringFilter... filters) {
if (this.filters == null) {
setFilters(new com.amazonaws.internal.SdkInternalList<InstanceInformationStringFilter>(filters.length));
}
... | Create a Java method that does the following: "Sets the filters for the request.". |
Of course, here is the Java code you requested:
```java
@GwtIncompatible("incompatible method")
public static Calendar toCalendar(final Date date, final TimeZone tz) {
final Calendar c = Calendar.getInstance(tz);
c.setTime(date);
return c;
}
```
Hope this helps! | Create a Java method that does the following: "Converts a Date to a Calendar.". |
Of course, here is the Java code you requested:
```java
public String format(double number, NumberFormat numberFormat, PluralRules pluralRules) {
String formatStr = numberFormat.format(number);
StandardPlural p = selectPlural(number, numberFormat, pluralRules);
SimpleFormatter formatter = templ... | Create a Java method that does the following: "Format a double number using the specified NumberFormat and PluralRules.". |
Of course, here is the Java code you requested:
```java
@Override
public FlushModeType getFlushMode()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "em.getFlushMode() + getEmDebugString();\n" + toString());
return getEMInvocationInfo(false).getFlus... | Create a Java method that does the following: "Get the FlushModeType for this application.". |
Of course, here is the Java code you requested:
```java
private boolean isWithinRange(T value) {
if (getMinInclusive() != null
&& compareTo(getMinInclusive(), value) > 0) {
return false;
}
if (getMaxInclusive() != null
&& compareTo(getMaxInclusive(), ... | Create a Java method that does the following: "Checks if the value is within the range of the attribute.". |
Of course, here is the Java code you requested:
```java
public static ItemRuleList toItemRuleList(List<ItemParameters> itemParametersList) throws IllegalRuleException {
ItemRuleList itemRuleList = new ItemRuleList();
for (ItemParameters parameters : itemParametersList) {
itemRuleList.add(It... | Create a Java method that does the following: "To ItemRuleList.". |
Of course, here is the Java code you requested:
```java
public void configureDeploymentStatisticsQuery(DeploymentStatisticsQueryImpl query) {
configureQuery(query, DEPLOYMENT, "RES.ID_");
query.getProcessInstancePermissionChecks().clear();
query.getJobPermissionChecks().clear();
query.getIncidentPermi... | Create a Java method that does the following: "Configure the deployment statistics query". |
Of course, here is the Java code you requested:
```java
@NonNull
public SelfT addTypeCodecs(@NonNull TypeCodec<?>... typeCodecs) {
Collections.addAll(this.typeCodecs, typeCodecs);
return self;
}
```
Hope this helps! | Create a Java method that does the following: "Add a list of type codes to the type codecs.". |
Of course, here is the Java code you requested:
```java
private static String getSystemProperty(String property) {
try {
return System.getProperty(property);
} catch (SecurityException ex) {
throw new SystemPropertyReadingException(ex, property);
}
}
```
Hope this helps! | Create a Java method that does the following: "Get the value of the system property.". |
Of course, here is the Java code you requested:
```java
@Deprecated
public String getChildJavaOpts(JobConf jobConf, String defaultValue) {
if (getTask().isJobSetupTask()) {
return jobConf.get(JobConf.MAPRED_JOB_SETUP_TASK_JAVA_OPTS,
defaultValue);
} else if (getTask().isJobCleanupTask()) {
... | Create a Java method that does the following: "Get the child java options from the jobConf". |
Of course, here is the Java code you requested:
```java
public int getChildNodesCount(final NodeData parent) throws RepositoryException
{
if (txStarted())
{
int txChildsCount = 0;
for (ItemState change : transactionLog.getAllStates())
{
if (change.isNode() && chang... | Create a Java method that does the following: "Get child nodes count.". |
Of course, here is the Java code you requested:
```java
public static double sum( GrayF64 img ) {
if( BoofConcurrency.USE_CONCURRENT ) {
return ImplImageStatistics_MT.sum(img);
} else {
return ImplImageStatistics.sum(img);
}
}
```
Hope this helps! | Create a Java method that does the following: "Returns the sum of the image.". |
Of course, here is the Java code you requested:
```java
public static base_response init(nitro_service client, sslfipssimtarget resource) throws Exception {
sslfipssimtarget initresource = new sslfipssimtarget();
initresource.certfile = resource.certfile;
initresource.keyvector = resource.keyvector;
initresour... | Create a Java method that does the following: "Use this API to init sslfipssimtarget.". |
Of course, here is the Java code you requested:
```java
public static Method findMethod(Object obj, String methodName, Object... params) {
Class<?>[] classArray = new Class<?>[params.length];
for (int i = 0; i < params.length; i++) {
classArray[i] = params[i].getClass();
}
t... | Create a Java method that does the following: "Find a method in the object that matches the specified method name and parameters.". |
Of course, here is the Java code you requested:
```java
private boolean readConstantPoolEntry(final DataInput di, final int index)
throws IOException {
final int tag = di.readUnsignedByte();
switch (tag) {
case CP_METHOD_TYPE:
di.skipBytes(2); // readUnsignedSh... | Create a Java method that does the following: "Read a constant pool entry.". |
Of course, here is the Java code you requested:
```java
@SafeVarargs
public static <T> MutableList<T> mutableVec(T... items) {
MutableList<T> ret = PersistentVector.emptyMutable();
if (items == null) { return ret; }
for (T t : items) {
ret.append(t);
}
return ret... | Create a Java method that does the following: "Returns a mutable vector of the specified items.". |
Of course, here is the Java code you requested:
```java
private synchronized ListenableFuture<?> updateRevocableMemory(String allocationTag, long delta)
{
if (delta >= 0) {
return memoryPool.reserveRevocable(queryId, delta);
}
memoryPool.freeRevocable(queryId, -delta);
r... | Create a Java method that does the following: "Update the revision of a resource in the resource cache.". |
Of course, here is the Java code you requested:
```java
static Iterator<MutableIntTuple> wrappingIterator(
IntTuple bounds, Iterator<? extends MutableIntTuple> delegate)
{
return wrappingIteratorInternal(IntTuples.copy(bounds), delegate);
}
```
Hope this helps! | Create a Java method that does the following: "Returns an iterator that wraps the given bounds.". |
Of course, here is the Java code you requested:
```java
@Override
public AttributesRow getRow(int[] columnTypes, Object[] values) {
return new AttributesRow(getTable(), columnTypes, values);
}
```
Hope this helps! | Create a Java method that does the following: "Get a new row of Attributes.". |
Of course, here is the Java code you requested:
```java
private RendererSelection isRendererMatch(RendererBeanDescriptor<?> rendererDescriptor, Renderable renderable,
RendererSelection bestMatch) {
final Class<? extends Renderable> renderableType = rendererDescriptor.getRenderableType();
if... | Create a Java method that does the following: "Checks if the renderable is a renderer that matches the best match.". |
Of course, here is the Java code you requested:
```java
public void writeProcessingInstruction(final String target, final String data) throws SAXException {
processStartElement();
transformer.processingInstruction(target, data != null ? data : "");
}
```
Hope this helps! | Create a Java method that does the following: "Write processing instruction.". |
Of course, here is the Java code you requested:
```java
protected IntermediateQueryBuilder convertToBuilderAndTransform(IntermediateQuery originalQuery,
HomogeneousQueryNodeTransformer nodeTransformer,
... | Create a Java method that does the following: "Convert the original query to a builder and transform the result.". |
Of course, here is the Java code you requested:
```java
public boolean registerUser(String username, String email,
String password) {
if (((username == null) && (email == null)) || (password == null)) {
return false;
}
Object[] methodArgs = new Object[1];
Map<Str... | Create a Java method that does the following: "Register a user with the application.". |
Of course, here is the Java code you requested:
```java
private void sendChangeCipherAndFinish(boolean finishedTag)
throws IOException {
Finished mesg = new Finished(protocolVersion, handshakeHash,
Finished.CLIENT, session.getMasterSecret(), cipherSuite);
/*
* Send the... | Create a Java method that does the following: "Send change_cipher_spec and finish message.". |
Of course, here is the Java code you requested:
```java
public void clearStorage() throws BackendException {
openStores.clear();
final String lp = "ClearStorage: "; // "log prefix"
/*
* log4j is capable of automatically writing the name of a method that
* generated a log messa... | Create a Java method that does the following: "Clear the underlying store.". |
Of course, here is the Java code you requested:
```java
private void checkCollectionForeignkeys(ModelDef modelDef, String checkLevel) throws ConstraintException
{
if (CHECKLEVEL_NONE.equals(checkLevel))
{
return;
}
ClassDescriptorDef classDef;
Colle... | Create a Java method that does the following: "Checks the foreignkeys of the Collection.". |
Of course, here is the Java code you requested:
```java
public static boolean startsWithIgnoreCase(final String iText, final String iToFind) {
if (iText.length() < iToFind.length())
return false;
return iText.substring(0, iToFind.length()).equalsIgnoreCase(iToFind);
}
```
Hope this helps! | Create a Java method that does the following: "Check if the string starts with the given string ignoring case.". |
Of course, here is the Java code you requested:
```java
public void initTopology(String topologyName, int delay) {
if (this.topology != null) {
// TODO: possible refactor this code later
System.out.println("Topology has been initialized before!");
return;
}
t... | Create a Java method that does the following: "Initialize the topology.". |
Of course, here is the Java code you requested:
```java
public String[] getCategories() {
List<String> l = m_parameters.getCategories();
return l.toArray(new String[l.size()]);
}
```
Hope this helps! | Create a Java method that does the following: "Get the categories.". |
Of course, here is the Java code you requested:
```java
public synchronized void setSource(Source source) {
String sourceId = CollectorManagerUtils.getSourceId(source);
SourceManager srcMgr = null;
if (!sourceMgrs.containsKey(sourceId)) {
if (TraceComponent.isAnyTracingEnabled() && ... | Create a Java method that does the following: "Set the source to be used by this collector manager.". |
Of course, here is the Java code you requested:
```java
private void sameTextNode() throws TTIOException, XMLStreamException {
// Update variables.
mInsert = EInsert.NOINSERT;
mDelete = EDelete.NODELETE;
mInserted = false;
mInsertedEndTag = false;
mRemovedNode = false;
... | Create a Java method that does the following: "SameTextNode Method.". |
Of course, here is the Java code you requested:
```java
public AtomMediaResource getMediaResource(final String fileName) throws Exception {
final String filePath = getEntryMediaPath(fileName);
final File resource = new File(filePath);
return new AtomMediaResource(resource);
}
```
Hope this... | Create a Java method that does the following: "Get the media resource.". |
Of course, here is the Java code you requested:
```java
@Override
public WorkItemHandlersModel addWorkItemHandler(WorkItemHandlerModel workItemHandler) {
addChildModel(workItemHandler);
_workItemHandlers.add(workItemHandler);
return this;
}
```
Hope this helps! | Create a Java method that does the following: "Add a new WorkItemHandlerModel to the resource.". |
Of course, here is the Java code you requested:
```java
public static CompressionType getOutputCompressionType(JobContext job) {
String val = job.getConfiguration().get("mapred.output.compression.type",
CompressionType.RECORD.toString());
return CompressionType.valu... | Create a Java method that does the following: "Get the output compression type from the job configuration.". |
Of course, here is the Java code you requested:
```java
@PostConstruct
public void init() throws Exception {
try {
if (alreadyInited.compareAndSet(false, true)) {
initAdminContainerConfigIfNeeded();
initAdminRegistryIfNeeded();
if (! adminContain... | Create a Java method that does the following: "Initializes the application.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public static <T> T copy(final T entity) {
return copy((Class<T>) entity.getClass(), entity);
}
```
Hope this helps! | Create a Java method that does the following: "Creates a copy of the given entity.". |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.