Category "java"

How do I use jdk.net.hosts.file and fallback to default NS resolution?

After I added -Djdk.net.hosts.file property my app cannot resolve the name of my local machine. Is there a way to make it fallback to default resolution when no

Neighbours does not yield true

I am writing a small program of how to calculate sum of neighbours of a given position in a grid. for some reason the program does not recognize the right value

how to replace all in a given string except the last 4 digits like **** **** **** 4587 [duplicate]

"\\d(?=\\d{4})","*" I've tried it like that but it does not seem to be working it gives me the exact same string i entered to the scanner

intellij mass refactoring using macros

I am working on a project in intellij using java and spring. I want to change in multiple files my api's in a similar way like this: instead of: public void som

No variants of io.grpc:protoc-gen-grpc-java:1.33.1 match the consumer attributes

Issue: I'm using Dexguard to obfuscate codes for release build. Previously, I could build as normal without errors. However, when I add this dependency com.gith

Hibernate Jpa: update on @Embeddable table generates a query using the wrong table which @Embedded

I have the database tables Person and Details. Details are intended to carry the miscellaneous fields for the Person using the foreign key PERSON_ID. JPA code h

Swagger - How to hide request fiends on API wise, for same input model?

Using Swagger with SpringBoot implementation "org.springframework.boot:spring-boot-starter-web:2.6.7" implementation "org.springdoc:springdoc-openapi-ui:1.6.8"

Serializing multiline string from JsonNode to YAML string adds double quotes and "\n"

I have a YAML string where one of the attributes looks like this: description: | this is my description //imagine there's a space after description th

How to cache token with Microsoft Graph for Java

I am using Microsoft Graph SDK for some requests however everytime I perform a GET request it does another request to get a token. I've tried reading documentat

Chromedriver Selenium getting 'Connection Reset' when versions match

I am using chromedriver but am sometimes getting the following errors: 03:34:09.188 [AsyncHttpClient-1-2] WARN org.openqa.selenium.remote.http.WebSocket - Conne

In Java, how do you deal with double quote inside of a CSV that you need to parse

here is what I want to do, This my spend.csv file : "Date","Description","Detail","Amount" "5/03/21","Cinema","Batman","7.90" "15/02/20","Groceries","Potatoes",

Issue while getting custom message from @email annotation Spring Boot

I'm trying to get the message from my @Email annotation for my front-end . The issue is that it doesn't actually pass and I get an empty response. Nothing gets

How to put class field into method argument to avoid code repeat

I am currently solving this issue. For example. I have two classes. One for item and second for some kind of records of these items. What I need to do, if I wan

Boolean Supplier Java wait until condition is true

I am trying to get to wait until there exists the condition (theOne, that I am waiting for) in the list of areHere. I am trying to work with BooleanSupplier but

Error creating bean with name 'securityConfig': Requested bean is currently in creation:

package ro.contabilitateexpert.AccountExpert.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotati

Print to a specific point in the terminal

I have a method that prints an upload progress like this: 36% [=================> ] 210,81 KB/s To rewrite the line,

The intellij idea takes up a lot of Ram [closed]

The intellij idea takes up a lot of RAM, is there a way we can reduce the program size?

Do I have to use @Payload spring annotation to read Kafka message

Spring for Apache Kafka 2.8.4 under https://docs.spring.io/spring-kafka/reference/html shows some of the listener methods with @Payload annotation next to the m

SpringBoot: Enabling WRAP_ROOT_VALUE feature using custom Jackson2ObjectMapperBuilder shuts off Swagger3

I've read many articles/threads and what not about how to enable Jackson's WRAP_ROOT_VALUE feature in SpringBoot (v2.2.2RELEASE) and none of them really work, u

In a Java interface, is there a way to return an enum nested in a generic type?

I'm looking for a way to return an Enum type nested in a Generic class. Here's what I mean: public interface MapperClass<E, D> { D entityToDto(E enti