Category "java"

Why cant you subract a value from a for loop within an 2DArray but works vice versa(Adding a value to the 2DArray)?

Just like the game minesweeper I want the "O"s to change to "1"s if the borders are next to the "X"s, the board[i][j] will only change to "1"s if and only you a

Breadth-first traversal of a tree of slider puzzle configurations java

I need help with my PuzzleSolver class. I get a notice saying Note: SliderPuzzleSolver.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:u

How convert/adapt ByteObjectHashMap to a JDK Map?

Primitive maps don't seem to implement java.util.Map. If I have a function, accepting JDK Map as an argument and now want to pass eclipse collection implementat

How to make random non-repeating numbers?

I made a code that could generate random numbers, but my issue is that sometimes it would repeat two or three numbers from time to time. int winnum[] = new

Simple Java Animation using JFrame and JPanel

Ok, so the program's purpose is to just draw and oval and move it across the screen. The code compiles on Eclipse without an error, but when run, no oval is dra

com.sun.jersey.api.client.ClientHandlerException when trying to make an Envelope on DocuSign API

That's my code, I'm trying to make an Embedded Sending within my app, I have got to this point deconstructing some code from the API usage examples (that in my

How To Build React App Through Gradle Task

I am a new in gradle task creation.I am using Spring application as backend and in frontend I am using React App.So now My question is how can I build react app

How can I await at least specified amount of time with Awaitility?

I my test class I really need to sleep for some amount of time. It's an integration test involving periodic remote call. for (int i = 0; i < 16; i++) { /

Math.ceil for positive value greater than zero? [duplicate]

The following code is giving me a wrong answer and I can't understand why. int x = 10; int y = 15; System.out.println((int)Math.ceil(

Eclipse format bracket switch and space

i'm searching in eclipse's formatting option but i cannot find anything relative to what i want. Basically i want turn this switch (event) { cas

Quarkus - logback.xml: cannot add jar

Recently I found this Quarkus extension that allows to use logback.xml for configuring the logger (JBoss LogManager is still the implementation). I've added the

Java + JSON: list of anonymous objects (key + value) with different key names

Maybe it's simple, but I'm stuck... I have an app using Spring Boot and springframework.web.client.RestTemplate, so there's Jackson on backseat doing JSON job a

How to fire liquibase rollback script from spring application

I am using spring with liquibase to update my database. Since know I have not need to user rollback functonality, but the times come where I would like to make

joinColumns in Hibernate for standard relations?

In the following example, there are 3 entities which have relations e.g. @ManyToMany, @OneToMany and @ManyToOne: Student: @Entity @Data public class Student {

org.graalvm.polyglot.PolyglotException: ReferenceError: document is not defined

I am using Spring boot 2.4.4, JDK 1.8, and created ScriptEngine as shown. Page loaded perfectly for the first time but the second time it throws the exception

Lombok - Hibernate @OneToOne in same class - StackOverFlowError

I'm working with 2 tables: Person and City. I have a @ManyToOne relationship which worked fine. (many persons can belong to one city). Then I needed to create a

how to write junit for this code service layer in springboot

i am new in junit I want to test this method with junit5 when i try to test this custom exception like this: CustomExceptionMessage exception = assertThrows(Cu

Why can't the instance member be accessed from the lambda of the enum constructor?

In the code below, I am trying to output the value of a symbol that is an instance variable of Operation from a PLUS constant. But I can't access that variable.

Renv and Java: "Error in rJava::.jinit() : Unable to create a Java class loader"

I have a script that works perfectly when I'm not using Renv. However, when running it in a project with Renv enabled, the last command line returns the followi

Convert String array to an Int array and total it

I need to create a program that accepts input from a file. I need to ask the user to enter two(2) variables, the interest rate and months for the loan. I then c