code stringlengths 146 48.7k | prompt stringlengths 55 1.51k |
|---|---|
Of course, here is the Java code you requested:
```java
public static ModelNode createOperation(final String operation, final ModelNode address) {
if (address.getType() != ModelType.LIST) {
throw ControllerClientLogger.ROOT_LOGGER.invalidAddressType();
}
final ModelNode op = createO... | Create a Java method that does the following: "Create an operation node with the given name and address.". |
Of course, here is the Java code you requested:
```java
private boolean digestMatches(byte[] digest, String providedDigest) {
return providedDigest.equalsIgnoreCase(Hex.encodeHexString(digest)) || providedDigest.equalsIgnoreCase(new String(Base64.getEncoder().encode(digest)));
}
```
Hope this helps! | Create a Java method that does the following: "Checks if the digest matches the provided digest.". |
Of course, here is the Java code you requested:
```java
private MethodSource<JavaClassSource> inspectSuperClasses(UIExecutionContext context, final String type,
String name,
String[] paramTypes)
{
Project project = getSelectedProject(context);
JavaSource<?> clazz = sourceForName... | Create a Java method that does the following: "Inspects the super classes of a type.". |
Of course, here is the Java code you requested:
```java
private void copyTemplateForTieCommands(final Sheet sheet) {
// if skip configuration. then return.
if (parent.isSkipConfiguration()) {
return;
}
Workbook wb = sheet.getWorkbook();
String copyName = TieConstants.COPY_SHEET_PREFIX + sheet.getShe... | Create a Java method that does the following: "Copy template for tie commands.". |
Of course, here is the Java code you requested:
```java
public static dnspolicy[] get(nitro_service service) throws Exception{
dnspolicy obj = new dnspolicy();
dnspolicy[] response = (dnspolicy[])obj.get_resources(service);
return response;
}
```
Hope this helps! | Create a Java method that does the following: "Use this API to fetch all the dnspolicy resources that are configured on netscaler.". |
Of course, here is the Java code you requested:
```java
@Override
public Object invoke(String methodName, Object argument, Type returnType) throws Throwable {
return invoke(methodName, argument, returnType, new HashMap<String, String>());
}
```
Hope this helps! | Create a Java method that does the following: "Override this method to override the default implementation of the method.". |
Of course, here is the Java code you requested:
```java
@Override
public DescribeFleetHistoryResult describeFleetHistory(DescribeFleetHistoryRequest request) {
request = beforeClientExecution(request);
return executeDescribeFleetHistory(request);
}
```
Hope this helps! | Create a Java method that does the following: "Retrieves the description of a fleet.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings({"checkstyle:cyclomaticcomplexity", "checkstyle:npathcomplexity"})
public static Element writeMapElement(MapElement primitive, String primitiveNodeName,
XMLBuilder builder, XMLResources resources) throws IOException {
Element primitiveNode... | Create a Java method that does the following: "Write a MapElement to the XML.". |
Of course, here is the Java code you requested:
```java
public synchronized void remove(Entry entry)
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "remove", new Object[] { entry });
super.remove(entry);
DestinationHandler dh = (DestinationHandler) entry.data;
HashMap<String, Entry> busMap = getBu... | Create a Java method that does the following: "Removes a single entry from the list of destination handlers.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public <EngineComponent> EngineComponent[] getEngineComponents(Class<EngineComponent> clazz) {
String thisMethodName = "getEngineComponents";
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
... | Create a Java method that does the following: "Gets the EngineComponents of the specified class.". |
Of course, here is the Java code you requested:
```java
@Override
public int unionSize(IntSet other) {
return other == null ? size() : size() + other.size() - intersectionSize(other);
}
```
Hope this helps! | Create a Java method that does the following: "Returns the union size of this set and the other set.". |
Of course, here is the Java code you requested:
```java
private void createProcessSampleJUnit(IJavaProject project, String exampleType, IProgressMonitor monitor)
throws JavaModelException, IOException {
String s = "org/jbpm/eclipse/wizard/project/ProcessJUnit-" + exampleType + ".java";
IRuntime runtime = startP... | Create a Java method that does the following: "Create ProcessJUnit.". |
Of course, here is the Java code you requested:
```java
public List<OAuthPermission> convertScopeToPermissions(Client client, List<String> scopes) {
List<OAuthPermission> list = new ArrayList<OAuthPermission>();
for (String scope : scopes) {
if (scope.equals(OAuthConstants.READ_CALENDAR_SCOPE)) {
l... | Create a Java method that does the following: "Convert a list of scopes to permissions.". |
Of course, here is the Java code you requested:
```java
public int getPropertyAsInteger(final String bundleName, final String key) {
LOG.info("Getting value for key: " + key + " from bundle: "
+ bundleName);
ResourceBundle bundle = bundles.get(bundleName);
try {
return Integer.parseInt(bundle.getString(ke... | Create a Java method that does the following: "Gets the value of the property as an integer.". |
Of course, here is the Java code you requested:
```java
public static <T> T getBean(Class<T> clazz) throws ReflectionException {
return parameterizeObject(Reflect.onClass(clazz).create().<T>get());
}
```
Hope this helps! | Create a Java method that does the following: "Get a bean from a class.". |
Of course, here is the Java code you requested:
```java
@Override
public Request<ModifyCapacityReservationRequest> getDryRunRequest() {
Request<ModifyCapacityReservationRequest> request = new ModifyCapacityReservationRequestMarshaller().marshall(this);
request.addParameter("DryRun", Boolean.toStrin... | Create a Java method that does the following: "Returns a request configured to delete the resource in the DryRun state.". |
Of course, here is the Java code you requested:
```java
public void add(InputSplit s) throws IOException {
if (null == splits) {
throw new IOException("Uninitialized InputSplit");
}
if (fill == splits.length) {
throw new IOException("Too many splits");
}
splits[fill++] = s;
totsize ... | Create a Java method that does the following: "Adds a new InputSplit to the end of the list.". |
Of course, here is the Java code you requested:
```java
private OWLSAtomicService buildOWLSServiceFromLocalOrRemoteURI(URI serviceURI, List<URI> modelURIs) throws ModelException
{
BSDFLogger.getLogger().info("Builds OWL service (BSDF functionality) from: " + serviceURI.toString());
OWLContainer owl... | Create a Java method that does the following: "Builds an OWLSAtomicService from a local or remote URI.". |
Of course, here is the Java code you requested:
```java
public DefaultShardManagerBuilder setShards(final int... shardIds)
{
Checks.notNull(shardIds, "shardIds");
for (int id : shardIds)
{
Checks.notNegative(id, "minShardId");
Checks.check(id < this.shardsTotal, "max... | Create a Java method that does the following: "Sets the shards to be used.". |
Of course, here is the Java code you requested:
```java
public void start() {
initMBeanServer(globalConfig);
if (mBeanServer != null) {
Collection<ComponentRef<?>> components = basicComponentRegistry.getRegisteredComponents();
resourceDMBeans = Collections.synchronizedCollection(getResou... | Create a Java method that does the following: "Start the MBeanServer.". |
Of course, here is the Java code you requested:
```java
public static Pair<INDArray, ByteBuffer> toArrayAndByteBuffer(DirectBuffer buffer, int offset) {
return toArrayAndByteBuffer(getDirectByteBuffer(buffer), offset);
}
```
Hope this helps! | Create a Java method that does the following: "Convert a direct buffer to an array and a byte buffer.". |
Of course, here is the Java code you requested:
```java
public GBC insets(int top, int left, int bottom, int right)
{
this.insets = new Insets(top, left, bottom, right);
return this;
}
```
Hope this helps! | Create a Java method that does the following: "Sets the insets of the image.". |
Of course, here is the Java code you requested:
```java
public void setExpandActivityOverflowButtonContentDescription(int resourceId) {
CharSequence contentDescription = getContext().getString(resourceId);
mExpandActivityOverflowButtonImage.setContentDescription(contentDescription);
}
```
Hope thi... | Create a Java method that does the following: "Sets the content description of the expand activity overflow button image.". |
Of course, here is the Java code you requested:
```java
public String getNewCalendarPath(File file)
{
StringTokenizer st = new StringTokenizer(file.getName());
int iPlace = 0, iMonth = 0, iYear = 0;
while (st.hasMoreTokens())
{
String strToken = st.nextToken();
... | Create a Java method that does the following: "Get the new calendar path for a file.". |
Of course, here is the Java code you requested:
```java
@PUT
@Path("/{pushAppID}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response updatePushApplication(@PathParam("pushAppID") String pushApplicationID, PushApplication updatedPushApp) {
PushApplicati... | Create a Java method that does the following: "Update a Push Application". |
Of course, here is the Java code you requested:
```java
public static boolean isAssignable(
Class<?>[] classArray, Class<?>[] toClassArray, boolean autoboxing) {
if (arrayGetLength(classArray) != arrayGetLength(toClassArray)) {
return false;
}
if (classArray == null) {
classArray = EMPTY_... | Create a Java method that does the following: "Checks if the two arrays are assignable.". |
Of course, here is the Java code you requested:
```java
public static String serialize(final Object obj) throws IOException {
final ObjectMapper mapper = new ObjectMapper();
mapper.disable(MapperFeature.USE_GETTERS_AS_SETTERS);
return mapper.writeValueAsString(obj);
}
```
Hope this helps! | Create a Java method that does the following: "Serialize an object to a JSON string.". |
Of course, here is the Java code you requested:
```java
public static double pearson(int[] x, int[] y) {
if (x.length != y.length)
throw new IllegalArgumentException(String.format("Arrays have different length: x[%d], y[%d]", x.length, y.length));
return 1 - Math.cor(x, y);
}
```
Hope... | Create a Java method that does the following: "Computes the pearson distance between two sets of integers.". |
Of course, here is the Java code you requested:
```java
public static <T> T pickRandom (List<T> values)
{
int size = values.size();
if (size == 0) {
throw new IllegalArgumentException(
"Must have at least one element [size=" + size + "]");
}
return values... | Create a Java method that does the following: "Pick a random object from a list of objects.". |
Of course, here is the Java code you requested:
```java
public static boolean isHasSaveAttr(final Cell cell) {
Cell saveAttrCell = cell.getRow().getCell(TieConstants.HIDDEN_SAVE_OBJECTS_COLUMN);
if (saveAttrCell != null) {
return isHasSaveAttr(cell, saveAttrCell.getStringCellValue());
}
return false;
... | Create a Java method that does the following: "Checks if the cell has a hidden save attribute.". |
Of course, here is the Java code you requested:
```java
public final B serverAddresses(Iterable<InetSocketAddress> serverAddresses) {
requireNonNull(serverAddresses, "serverAddresses");
final DnsServerAddresses addrs = DnsServerAddresses.sequential(serverAddresses);
serverAddressStreamProvider ... | Create a Java method that does the following: "Sets the server addresses.". |
Of course, here is the Java code you requested:
```java
public static void append(Appendable out, Object object) throws IOException {
if (object instanceof String) {
out.append((String) object);
} else if (object instanceof Object[]) {
out.append(toArrayString((Object[]) object)... | Create a Java method that does the following: "Append a single object to the given appendable.". |
Of course, here is the Java code you requested:
```java
public void add(T queryParameter) {
Assert.notNull(queryParameter, "QueryParameter must not be null!");
this.parameters.put(queryParameter.getName(), queryParameter);
}
```
Hope this helps! | Create a Java method that does the following: "Add a query parameter to the query.". |
Of course, here is the Java code you requested:
```java
private void computeDefaultSerializableFields(DocEnv env,
ClassSymbol def,
ClassDocImpl cd) {
for (Scope.Entry e = def.members().elems; e != null; e = e.si... | Create a Java method that does the following: "Compute the default serializable fields.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("AssignmentToForLoopParameter")
public static String encode(final byte[] data) {
final int len = data.length;
final StringBuilder result = new StringBuilder((len / 3 + 1) * 4);
int bte;
int index;
for... | Create a Java method that does the following: "Encode a byte array to a string.". |
Of course, here is the Java code you requested:
```java
public void setLongdesc(String longdesc) {
_imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.LONGDESC, longdesc);
}
```
Hope this helps! | Create a Java method that does the following: "Sets the longdesc attribute for the HTML image tag.". |
Of course, here is the Java code you requested:
```java
@Override
public CloseableReference<Bitmap> decodeJPEGFromEncodedImageWithColorSpace(
EncodedImage encodedImage,
Bitmap.Config bitmapConfig,
@Nullable Rect regionToDecode,
int length,
@Nullable final ColorSpace colorSpace) {
bo... | Create a Java method that does the following: "This method is used to decode a single image from a given encoded image.". |
Of course, here is the Java code you requested:
```java
private WMenu buildTreeMenu(final WText selectedMenuText) {
WMenu menu = new WMenu(WMenu.MenuType.TREE);
menu.setSelectMode(SelectMode.SINGLE);
mapTreeHierarchy(menu, createExampleHierarchy(), selectedMenuText);
return menu;
}
```
Hope this helps! | Create a Java method that does the following: "Build a tree menu.". |
Of course, here is the Java code you requested:
```java
static <B> Hasher<B> bitStoreHasher(StreamSerializer<B> s) {
return Hashing.murmur3Int().hasher(s);
}
```
Hope this helps! | Create a Java method that does the following: "Returns a hasher for the given stream serializer.". |
Of course, here is the Java code you requested:
```java
public boolean hasVersionLabel(String label) throws RepositoryException
{
checkValid();
if (this.getVersionDataByLabel(label) == null)
{
return false;
}
return true;
}
```
Hope this helps! | Create a Java method that does the following: "Checks if the version data exists for the given label.". |
Of course, here is the Java code you requested:
```java
private ColumnType detectType(List<String> valuesList, ReadOptions options) {
CopyOnWriteArrayList<AbstractColumnParser<?>> parsers = new CopyOnWriteArrayList<>(getParserList(typeArray, options));
CopyOnWriteArrayList<ColumnType> typeCandidates ... | Create a Java method that does the following: "Detect type.". |
Of course, here is the Java code you requested:
```java
private boolean isLocked(Class entityType, String entityKey, Integer lockType)
throws LockingException {
IEntityLock[] locks = retrieveLocks(entityType, entityKey, lockType);
return locks.length > 0;
}
```
Hope this helps! | Create a Java method that does the following: "Check if the entity is locked.". |
Of course, here is the Java code you requested:
```java
public boolean isValid (Object target)
{
TileSet set = (TileSet)target;
boolean valid = true;
// check for the 'name' attribute
if (StringUtil.isBlank(set.getName())) {
log.warning("Tile set definition missing 'nam... | Create a Java method that does the following: "Check if the target object is a valid CRS image set.". |
Of course, here is the Java code you requested:
```java
private static Campaign createCampaign(
AdWordsServicesInterface adWordsServices, AdWordsSession session, Budget budget)
throws RemoteException, ApiException {
// Get the CampaignService.
CampaignServiceInterface campaignService =
adWo... | Create a Java method that does the following: "Creates a Campaign.". |
Of course, here is the Java code you requested:
```java
private void getSizeInfo(AlluxioURI path, List<URIStatus> statuses,
boolean readable, boolean summarize, boolean addMemory) {
if (summarize) {
long totalSize = 0;
long sizeInAlluxio = 0;
long sizeInMem = 0;
for (URIStatus status ... | Create a Java method that does the following: "Get size information.". |
Of course, here is the Java code you requested:
```java
public static RoaringBitmap andNot(final RoaringBitmap x1, final RoaringBitmap x2,
long rangeStart, long rangeEnd) {
rangeSanityCheck(rangeStart, rangeEnd);
RoaringBitmap rb1 = selectRangeWithoutCopy(x1, rangeStart, rangeEnd);
RoaringBitmap rb2... | Create a Java method that does the following: "AND NOT.". |
Of course, here is the Java code you requested:
```java
protected synchronized WriterPoolMember makeNewWriterIfAppropriate() {
long now = System.currentTimeMillis();
lastWriterNeededTime = now;
if(currentActive < maxActive) {
currentActive++;
lastWriterRolloverTime = now;
... | Create a Java method that does the following: "Make a new writer if the current active count is not below maxActive.". |
Of course, here is the Java code you requested:
```java
public CommandLine parse(Options options, String[] arguments, Properties properties, boolean stopAtNonOption)
throws ParseException
{
// clear out the data in options in case it's been used before (CLI-71)
for (Option opt : options... | Create a Java method that does the following: "Parses the command line.". |
Of course, here is the Java code you requested:
```java
public static <N, V> HColumn<N, V> createColumn(N name, V value, long clock,
Serializer<N> nameSerializer, Serializer<V> valueSerializer) {
return new HColumnImpl<N, V>(name, value, clock, nameSerializer,
valueSerializer);
}
```
Hope this hel... | Create a Java method that does the following: "Create a new HColumn.". |
Of course, here is the Java code you requested:
```java
private String getTypeName( Type type ) {
CheckArg.isNotNull(type, "type");
if (type.isPrimitiveType()) {
PrimitiveType primitiveType = (PrimitiveType)type;
return primitiveType.getPrimitiveTypeCode().toString();
}
... | Create a Java method that does the following: "Get the name of the type.". |
Of course, here is the Java code you requested:
```java
public void broadcastAvailablePlaylists(Supplier<List<String>> availablePlaylist, Function<String, Playlist> playlistForNameFunction) {
if (availablePlaylist == null || playlistForNameFunction == null)
return;
this.availablePlaylist = ... | Create a Java method that does the following: "Broadcasts the available playlists to the user.". |
Of course, here is the Java code you requested:
```java
private MessagesApi explicitMessagesApi() {
return new play.i18n.MessagesApi(
new play.api.i18n.DefaultMessagesApi(
Collections.singletonMap(
Lang.defaultLang().code(), Collections.singletonMap("foo", "bar")),
n... | Create a Java method that does the following: "explicitMessagesApi is a convenience method for creating a MessagesApi object.". |
Of course, here is the Java code you requested:
```java
public static void escapeJsonMinimal(final String text, final Writer writer)
throws IOException {
escapeJson(text, writer,
JsonEscapeType.SINGLE_ESCAPE_CHARS_DEFAULT_TO_UHEXA,
JsonEscapeLevel.LEVEL_1_BASIC_ESCAP... | Create a Java method that does the following: "Escape the text using minimal JSON.". |
Of course, here is the Java code you requested:
```java
public ComplexFloat subi(ComplexFloat c, ComplexFloat result) {
if (this == result) {
r -= c.r;
i -= c.i;
} else {
result.r = r - c.r;
result.i = i - c.i;
}
return this;
}
```
Hope this helps! | Create a Java method that does the following: "Subtracts this complex number from another.". |
Of course, here is the Java code you requested:
```java
private JsonClassWriterBase getCustomWriter(Class c)
{
JsonClassWriterBase writer = writerCache.get(c);
if (writer == null)
{
writer = forceGetCustomWriter(c);
writerCache.put(c, writer);
}
retur... | Create a Java method that does the following: "Get a custom class writer.". |
Of course, here is the Java code you requested:
```java
protected CmsToggleButton createOpener() {
final CmsToggleButton opener = new CmsToggleButton();
opener.setButtonStyle(ButtonStyle.FONT_ICON, null);
opener.setSize(Size.small);
opener.addStyleName(CSS.listTreeItemOpener());
... | Create a Java method that does the following: "Creates the opener button.". |
Of course, here is the Java code you requested:
```java
public static boolean isValidMapcodeFormat(@Nonnull final String mapcode) throws IllegalArgumentException {
checkNonnull("mapcode", mapcode);
try {
// Throws an exception if the format is incorrect.
getPrecisionFormat(mapco... | Create a Java method that does the following: "Check if the mapcode is valid.". |
Of course, here is the Java code you requested:
```java
private AbsAxis parseForwardAxis() throws TTXPathException {
final AbsAxis axis;
if (is("child", true)) {
axis = new ChildAxis(getTransaction());
} else if (is("descendant", true)) {
axis = new DescendantAxis(ge... | Create a Java method that does the following: "Parse forward axis.". |
Of course, here is the Java code you requested:
```java
private boolean augment() {
// reset data structures
Arrays.fill(even, NIL);
Arrays.fill(odd, NIL);
dsf = new DisjointSetForest(graph.length);
bridges.clear();
queue.clear();
// enqueue every unmatched ver... | Create a Java method that does the following: "Augment the path with the matching information.". |
Of course, here is the Java code you requested:
```java
@Override
protected Buffer buffer(final boolean fullResponse) {
// form
Buffer formBuffer = formBuffer();
// response
Buffer response = new Buffer();
response.append(httpVersion)
.append(SPACE)
.append(statusCode)
.append(SPACE)
.append... | Create a Java method that does the following: "Returns a Buffer containing the contents of the response.". |
Of course, here is the Java code you requested:
```java
public static BalancingThreadPoolExecutor newBalancingThreadPoolExecutor(int maxThreads,
float targetUtilization,
... | Create a Java method that does the following: "Creates a new BalancingThreadPoolExecutor.". |
Of course, here is the Java code you requested:
```java
public GitlabProjectMember addProjectMember(GitlabProject project, GitlabUser user, GitlabAccessLevel accessLevel) throws IOException {
return addProjectMember(project.getId(), user.getId(), accessLevel);
}
```
Hope this helps! | Create a Java method that does the following: "Add a project member to the project.". |
Of course, here is the Java code you requested:
```java
public static <E> int counti(Iterator<E> iterator) {
final long value = reduce(iterator, new Count<E>(), 0l);
dbc.state(value <= Integer.MAX_VALUE, "iterator size overflows an integer");
return (int) value;
}
```
Hope this helps! | Create a Java method that does the following: "Count the number of elements in the iterator.". |
Of course, here is the Java code you requested:
```java
private boolean hasFileChangedUnexpectedly() {
synchronized (this) {
if (mDiskWritesInFlight > 0) {
// If we know we caused it, it's not unexpected.
if (DEBUG) System.out.println( "disk write in flight, not unex... | Create a Java method that does the following: "Checks if the file has changed unexpectedly.". |
Of course, here is the Java code you requested:
```java
public String getString()
{
String string = super.getString(); // By default, get the data as-is
if (this.getField() instanceof NumberField)
{
double dValue = this.getField().getValue();
if (m_bDebit)
... | Create a Java method that does the following: "Get the String value for this lang phrase.". |
Of course, here is the Java code you requested:
```java
private StringBuffer toQueryPrefix(String t) {
StringBuffer sb = new StringBuffer(255);
return sb.append(selstar).append(t).append(whereTrue);
}
```
Hope this helps! | Create a Java method that does the following: "Returns a StringBuffer representing the query prefix for a single record.". |
Of course, here is the Java code you requested:
```java
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException {
NameNode.getNameNodeMetrics().numFileDataServletDoGet.inc();
final UnixUserGroupInformation ugi = getUGI(request);
final ClientProtocol nnproxy = crea... | Create a Java method that does the following: "Get a single file from the name node.". |
Of course, here is the Java code you requested:
```java
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case AfplibPackage.EXTENDED_RESOURCE_LOCAL_IDENTIFIER__RES_TYPE:
setResType((Integer)newValue);
return;
case AfplibPackage.EXTENDED_RESOURCE_LOCAL_IDENTIFIER__RES_L... | Create a Java method that does the following: "Override the eSet method for the interface.". |
Of course, here is the Java code you requested:
```java
public static LineString computeDirection(Geometry geometry) throws IllegalArgumentException {
if(geometry == null){
return null;
}
// Convert geometry into triangle
Triangle triangle = TINFeatureFactory.createTriangle(... | Create a Java method that does the following: "Compute the direction of the geometry.". |
Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "postf_plz")
public JAXBElement<String> createPostfPlz(String value) {
return new JAXBElement<String>(_PostfPlz_QNAME, String.class, null, value);
}
```
Hope this helps! | Create a Java method that does the following: "Create an instance of the postf_plz property.". |
Of course, here is the Java code you requested:
```java
public static <T extends Message<T>> void writeTo(OutputStream out, T message, boolean numeric,
LinkedBuffer buffer)
throws IOException
{
writeTo(out, message, message.cachedSchema(), numeric, buffer);
}
```
Hope this help... | Create a Java method that does the following: "Write to the output stream using the cached schema.". |
Of course, here is the Java code you requested:
```java
public static String removeAccents(String text) {
text = Normalizer.normalize(text, Normalizer.Form.NFD);
text = text.replaceAll("[\\p{InCombiningDiacriticalMarks}]", "");
return text;
}
```
Hope this helps! | Create a Java method that does the following: "Removes all accents from a string.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("deprecation")
private static JobConf createJobConfForCopyByChunk(Configuration conf) {
JobConf jobconf = new JobConf(conf, DistCp.class);
jobconf.setJobName(NAME);
// turn off speculative execution, because DFS doesn't handle
... | Create a Java method that does the following: "Create a job conf for a copy - by - chunk job.". |
Of course, here is the Java code you requested:
```java
public com.google.protobuf.ByteString
getLocalityBytes() {
java.lang.Object ref = locality_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.... | Create a Java method that does the following: "Gets the value of the locality field.". |
Of course, here is the Java code you requested:
```java
public static Class<?> getSubclassInScope(final Class<?> scopeClass) {
final String callerClass = Thread.currentThread().getStackTrace()[3].getClassName();
try {
final Class<?> candidateClass = Class.forName(callerClass, false, Thread.currentThread().getCo... | Create a Java method that does the following: "Get the subclass of the specified class in the specified scope.". |
Of course, here is the Java code you requested:
```java
public static PreparedStatement prepareStatementForBatch(Connection conn, String sql, Object[]... paramsBatch) throws SQLException {
return prepareStatementForBatch(conn, sql, new ArrayIter<Object[]>(paramsBatch));
}
```
Hope this helps! | Create a Java method that does the following: "Create a PreparedStatement for a batch of rows.". |
Of course, here is the Java code you requested:
```java
public String getPhysicalContact() {
if (RegulationOfGeneExpression_Type.featOkTst && ((RegulationOfGeneExpression_Type)jcasType).casFeat_physicalContact == null)
jcasType.jcas.throwFeatMissing("physicalContact", "de.julielab.jules.types.bootstrep.Regul... | Create a Java method that does the following: "getter for physicalContact - gets". |
Of course, here is the Java code you requested:
```java
public String asString() throws IOException {
long len = getContentLength();
ByteArrayOutputStream buf;
if (0 < len) {
buf = new ByteArrayOutputStream((int) len);
} else {
buf = new ByteArrayOutputStream();
}
writeTo(buf);
... | Create a Java method that does the following: "Returns the content of the file as a String.". |
Of course, here is the Java code you requested:
```java
private boolean validateAtlasRelationshipType(AtlasRelationshipType type) {
boolean isValid = false;
try {
validateAtlasRelationshipDef(type.getRelationshipDef());
isValid = true;
} catch (AtlasBaseException abe) {
... | Create a Java method that does the following: "Validate the AtlasRelationshipType.". |
Of course, here is the Java code you requested:
```java
public static Object getByXPath(String expression, Object source, QName returnType) {
final XPath xPath = createXPath();
try {
if (source instanceof InputSource) {
return xPath.evaluate(expression, (InputSource) source, returnType);
} else {
... | Create a Java method that does the following: "Gets the result of an XPath expression on the given source object using the given return type.". |
Of course, here is the Java code you requested:
```java
public static GUID getIID( Class<?> _interface ) {
IID iid = _interface.getAnnotation(IID.class);
if(iid==null)
throw new IllegalArgumentException(_interface.getName()+" doesn't have @IID annotation");
return new GUID(iid.value... | Create a Java method that does the following: "Gets the IID value of an interface.". |
Of course, here is the Java code you requested:
```java
public List<Commit> getCommits(Object projectIdOrPath, String ref, String path) throws GitLabApiException {
return (getCommits(projectIdOrPath, ref, null, null, path, getDefaultPerPage()).all());
}
```
Hope this helps! | Create a Java method that does the following: "Get a list of all the commits of a single file in a project.". |
Of course, here is the Java code you requested:
```java
public void marshall(StreamProcessorOutput streamProcessorOutput, ProtocolMarshaller protocolMarshaller) {
if (streamProcessorOutput == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {... | Create a Java method that does the following: "marshalls the given StreamProcessorOutput to the JSON - compatible parameter object.". |
Of course, here is the Java code you requested:
```java
@Override
public void clearCached(ICacheManager mgr) {
Map<String, CacheEntry> moduleBuilds;
synchronized (this) {
moduleBuilds = _moduleBuilds;
_moduleBuilds = null;
}
if (moduleBuilds != null) {
for (Map.Entry<String, CacheEntry> entry... | Create a Java method that does the following: "Clears the cache.". |
Of course, here is the Java code you requested:
```java
public static double pythagoreanTheorem(final double a, final double b) {
return Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));
}
```
Hope this helps! | Create a Java method that does the following: "Pythagorean theorem.". |
Of course, here is the Java code you requested:
```java
public EClass getIfcLibrarySelect() {
if (ifcLibrarySelectEClass == null) {
ifcLibrarySelectEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(959);
}
return ifcLibrarySelectEClass;
}
```... | Create a Java method that does the following: "Get the Ifc2x3tc1Package for the ifcLibrarySelect feature.". |
Of course, here is the Java code you requested:
```java
public String getName()
{
if (_name==null)
{
_name=this.getClass().getName();
if (!log.isDebugEnabled())
_name=_name.substring(_name.lastIndexOf('.')+1);
}
return _name;
}
```
Hope t... | Create a Java method that does the following: "Gets the name of the class.". |
Of course, here is the Java code you requested:
```java
@BetaApi
public final ListRoutesPagedResponse listRoutes(ProjectName project) {
ListRoutesHttpRequest request =
ListRoutesHttpRequest.newBuilder()
.setProject(project == null ? null : project.toString())
.build();
return ... | Create a Java method that does the following: "Gets a list of routes in the specified project.". |
Of course, here is the Java code you requested:
```java
@Override
protected <T1, T2, R extends Completes<?>> R dispatchQuery(TriFunction<P, T1, T2, R> query, T1 routable1, T2 routable2) {
throw new UnsupportedOperationException("query protocols are not supported by this router by default");
}
```
Hope this he... | Create a Java method that does the following: "Override this method to allow the user to override the default implementation of the query protocols.". |
Of course, here is the Java code you requested:
```java
public CMAArray<CMALocale> fetchAll(String spaceId, String environmentId) {
assertNotNull(spaceId, "spaceId");
assertNotNull(environmentId, "environmentId");
return service.fetchAll(spaceId, environmentId).blockingFirst();
}
```
Hope this helps! | Create a Java method that does the following: "Fetch all CML documents from a space and environment.". |
Of course, here is the Java code you requested:
```java
public List<String> getAllSheetNames() {
List<String> sheets = newArrayList();
for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
sheets.add(workbook.getSheetName(i));
}
return sheets;
}
```
Hope this helps! | Create a Java method that does the following: "Get all sheet names in the workbook". |
Of course, here is the Java code you requested:
```java
public ServiceFuture<EnvironmentSettingInner> createOrUpdateAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, EnvironmentSettingInner environmentSetting, final ServiceCallback<EnvironmentSettingInner> serviceCal... | Create a Java method that does the following: "Creates or updates an environment setting.". |
Of course, here is the Java code you requested:
```java
public static List<String> get(String name, @Nullable Boolean value) {
if (Boolean.TRUE.equals(value)) {
return Collections.singletonList("--" + name);
}
return Collections.emptyList();
}
```
Hope this helps! | Create a Java method that does the following: "Get a list of strings for a given name and boolean value.". |
Of course, here is the Java code you requested:
```java
public boolean isBlock() throws SftpStatusException, SshException {
// This is long hand because gcj chokes when it is not? Investigate why
if ((getAttributes().getPermissions().longValue() & SftpFileAttributes.S_IFBLK) == SftpFileAttributes.S_IFBLK) {
ret... | Create a Java method that does the following: "Determine whether the file is pointing to a block.". |
Of course, here is the Java code you requested:
```java
public static boolean isHasSaveAttr(final Cell cell, final String saveAttrs) {
if (cell != null) {
int columnIndex = cell.getColumnIndex();
String str = TieConstants.CELL_ADDR_PRE_FIX + columnIndex + "=";
if ((saveAttrs != null) && (saveAttrs.ind... | Create a Java method that does the following: "Checks if a cell has a save attribute.". |
Of course, here is the Java code you requested:
```java
public static GrayF64 mean(GrayF64 input, @Nullable GrayF64 output, int radius,
@Nullable GrayF64 storage, @Nullable DWorkArrays workVert) {
if( radius <= 0 )
throw new IllegalArgumentException("Radius must be > 0");
output = InputSanityCheck.c... | Create a Java method that does the following: "Computes the mean of the image using the B - Correlation kernel.". |
Of course, here is the Java code you requested:
```java
private void addRestResourceClasses(Set<Class<?>> resources) {
resources.add(pl.setblack.airomem.direct.banksample.rest.BankResource.class);
}
```
Hope this helps! | Create a Java method that does the following: "Add the rest resource classes to the set of resource classes.". |
Of course, here is the Java code you requested:
```java
public static DMatrixRMaj elements(DMatrixRMaj A , BMatrixRMaj marked , DMatrixRMaj output ) {
if( A.numRows != marked.numRows || A.numCols != marked.numCols )
throw new MatrixDimensionException("Input matrices must have the same shape");
... | Create a Java method that does the following: "Computes the elements of A from the marked matrix.". |
Of course, here is the Java code you requested:
```java
public void setOfferingTransactions(java.util.Collection<OfferingTransaction> offeringTransactions) {
if (offeringTransactions == null) {
this.offeringTransactions = null;
return;
}
this.offeringTransactions = new ... | Create a Java method that does the following: "Sets the value of the offeringTransactions property.". |
Of course, here is the Java code you requested:
```java
public boolean preValidateInfoTopic(final InfoTopic infoTopic, final ContentSpec contentSpec, final Map<String,
InfoTopic> infoTopics) {
// Check if the app should be shutdown
if (isShuttingDown.get()) {
shutdown.set(true);... | Create a Java method that does the following: "Pre validate info topic.". |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.