Category "java"

How to Handle Browser Popup (During the Download) using Java

currently we scrap the data from Websites using Web driver (Selenium)with Java, during that Scrapping we need to do some download process (i.e XML file Download

Micronaut data @MongoFindQuery not working with multiple fields

I am trying to write custom query using @MongoFindQuery but it's not working with multiple fileds, Repository Interface @MongoRepository public interface BookRe

How to convert Java "Arrays.copyOfRange" function to C#?

Working on MergeSort in Java: public void mergeSort(int[] A) { if (A.length > 1) { int q = A.length/2; int[] leftArray = Arrays.

resteasy-cdi breaks deployment to Tomcat 7

I am developing a simple REST server using resteasy 3.0.6.Final, which is deployed to tomcat 7.0.50. According to the official doc, there are basically two way

How can you extend Java to introduce passing by reference?

Java is pass-by-value. How could you modify the language to introduce passing by reference (or some equivalent behavior)? Take for example something like publ

How to convert Java "Arrays.copyOfRange" function to C#?

Working on MergeSort in Java: public void mergeSort(int[] A) { if (A.length > 1) { int q = A.length/2; int[] leftArray = Arrays.

Why is Lombok @Builder not compatible with this constructor?

I have this simple code: @Data @Builder public class RegistrationInfo { private String mail; private String password; public RegistrationInfo(Reg

Is it a wise thing to add validation functions into the Page Object Classes in a selenium automation framework based on Page Object Model?

I've frequently seen code where the test validation functions are frequently written into the Page Object classes themselves. Is there any use to doing this? Ma

Android app using Proguard & R8 differences [closed]

In my android app i am using Google R8(experimental release for now) and Proguard 6.0.3 ... According to your experience, what do you think ?

CountNonDivisible - Codility training task

I'm traning on codility now. Some tasks I can solve by myself, but with some tasks have problems. Difficulty of this task is <**>. It's medium, but I stal

How to solve "Spring Cloud LoadBalancer is currently working with the default cache. You can switch to using Caffeine cache' warning?

How to solve Spring Cloud LoadBalancer is currently working with the default cache. You can switch to using Caffeine cache, by adding it to the classpath. warni

Difference between save and saveAndFlush in Spring data jpa

I am trying to learn spring data JPA by testing some CRUD operation via JpaRepository. I came across two methods save and saveAndFlush. I don't get the differe

Static vs Instance Variables: Difference?

What is the difference between a static and instance variable. The following sentence is what I cant get: In certain cases, only one copy of a particular v

How do I manipulate a CSV file?

Create a program in Java that will read the CSV file and compute the Final Grade of the student using the computation below: Lab Exercise * 30% + Long Quiz * 30

can a kafka consumer filter messages before polling all of them from a topic?

It was said that consumers can only read the whole topic. No luck doing evaluations on brokers to filter messages. It implies that we have to consume/receive a

How to configure port for a Spring Boot application

How do I configure the TCP/IP port listened on by a Spring Boot application, so it does not use the default port of 8080.

Converting MultipartFile to java.io.File without copying to local machine

I have a Java Spring MVC web application. From client, through AngularJS, I am uploading a file and posting it to Controller as webservice. In my Controller, I

Extract string between the tags in Java

I have string like below Msg_Begin Some message1 Msg_End Msg_Begin Some message2 Msg_End Msg_Begin Some message3 Msg_End And want to get the message between

Reading a large compressed file using Apache Commons Compress

I'm trying to read a bz2 file using Apache Commons Compress. The following code works for a small file. However for a large file (over 500MB), it ends after

Jackson/Kafka LocalDateTime serialization not working properly

We have a very strange/intermittent issue with kafka and jackson. We have a dto defined which has 4 date field startdate, enddate and a embedded metatdata class