Category "java"

How can I map with modelmapper some conditions?

I have some Game entity that I want to map in GameDto. In Game I have another Game field basedOn. In GameDto I have basedOnName, basedOnId and basedOnCheckBox f

JedisCluster configurations and how it maintains the pool of connections

I have recently started using JedisCluster for my application. There is little to no documentation and examples for the same. I tested a use case and the result

Android ClipboardManger work in background

Is there any way that I can run ClipboardManger in the background on Android 12 I developed a clipboard application where any text I copy it, It will save in my

How to move failed testcase code from @Aftermethod to TESTNG Listener?

This is the working code to capture screenshot for failure testcases in Extent reports I am trying to put inside TESTNG listeners: @AfterMethod public void tear

Trouble with replacing a variable in a txt file with user input - using java in eclipse

I am trying to replace one word in a txt file with a new one from user input (Using Java in Eclipse IDE). For example: My txt file is as follows: Jacket 12 59.9

How to take an element from an array list and assign it into another array list

I have to create a program in java, which is based on an ordering system. I have the following classes : orders, orders list, supplier, supplier list, payment,

Regex : matches all 7 digit number except the one that starts with abc

ex: abc:1234567,cd:2345678,efg:3456789012 expected outcome 2345678 I tried (?!abc)\d{7,7} my result: 1234567

Firebase crashlytics not able to read crash reports

I have configured crashlytics as per Firebase Documentation https://firebase.google.com/docs/crashlytics/get-started?platform=android. But crash reports not gen

Regex : matches all 7 digit number except the one that starts with abc

ex: abc:1234567,cd:2345678,efg:3456789012 expected outcome 2345678 I tried (?!abc)\d{7,7} my result: 1234567

How to Invoke Selenium class from clicking Html Button using tomcat

I have three test case in different java file and want to invoke it using tomcat server by clicking html button. This is my html <form action="case1" method=

How to Invoke Selenium class from clicking Html Button using tomcat

I have three test case in different java file and want to invoke it using tomcat server by clicking html button. This is my html <form action="case1" method=

Error With ConfigurationPropertiesBinder java spring when trying to start application context

I have a simple application it fails to load with the below error APPLICATION FAILED TO START Description: An attempt was made to call a method that does not ex

How do I call one constructor's variable into another constructor variable?

I saw several posts based on calling variables of one constructor to another. But I am beginner using visual studio to code, we are not using any "main" method.

How do I call one constructor's variable into another constructor variable?

I saw several posts based on calling variables of one constructor to another. But I am beginner using visual studio to code, we are not using any "main" method.

Redundant "Reset stmt" before "Execute" when setting useServerPrepStmts and cachePrepStmts to true in MySQL Connector/J

I'm using MySQL Connector/J (version 8.0.28) as the driver on client side. Following is part of my code for test purpose: PreparedStatement ps = null; String ur

How to iterate through all instances of an entity in Spring data JPA

I have an entity called packet, I want to update an attribute in all instances of that entity. The attribute I want to update is the price of the packet by a gi

Is it reasonable to have properties file while having Javaconfig classes in spring projects?

I encountered handful of guides to creating spring data jpa projects and people configured persistence layer using properties file and javaconfig both. If we on

Is it reasonable to have properties file while having Javaconfig classes in spring projects?

I encountered handful of guides to creating spring data jpa projects and people configured persistence layer using properties file and javaconfig both. If we on

Finding the third largest string from an array of strings in Java

One of my friends asked me about a coding challenge that their lecturer gave them as an exercise. I got a solution working to solve it. But I think the solution

How to get all the dependencies of Maven packages

To start off, I am still a student and trying to learn things, but I am quite stuck on how to get all the dependencies of each package from Maven. Initially, I