1,915,769 questions
0
votes
1
answer
31
views
Java Spring Boot response entity with map
I have the following code that creates a ResponseEntity for the response of a Spring app.
Is there any more efficient way of doing this method?
@GetMapping"/api/payments/reservation/{...
0
votes
1
answer
56
views
How to safely update a shared resource map under high concurrency in Java without performance loss?
I am currently developing a backend feature where multiple worker threads need to track and update the access frequency of shared resources in memory.
Initially, I used a standard HashMap, but I ...
-3
votes
0
answers
102
views
How to avoid java.lang.StackOverflowError when traversing a very deep N-ary tree in Java? [closed]
I am currently implementing a hierarchical structure management system using an N-ary tree in Java. Each node contains a list of children, and the data is mapped from a database.
To traverse the tree ...
1
vote
3
answers
60
views
Database query counting method for Spring Boot Unit Tests
How to implement a database requests counting method in a Spring Boot application and implement it in unit tests.
I saw the assertSelectCount method in the examples on Baeldung, but I don't know how ...
Advice
0
votes
0
replies
38
views
Migrating a lightweight Jersey/Jetty proxy service to Spring Boot 3.5: Best practices?
I’m an intern and I’ve been asked to help migrate a small Java app from Jersey/Jetty to Spring Boot.
The app is not very big. From what I’ve seen so far, it mainly exposes a few REST endpoints and ...
Advice
0
votes
12
replies
138
views
clarity and guidance for oriented plan to pursue computer engineer as career path
i have just completed my first year ,
CSE core engineering , i want to pursure as my career path ,
i have basic knowledge of python , cpp,c ,java,[can write a code for a probelm in a compiler window , ...
Best practices
0
votes
3
replies
58
views
What is the best way to connect Java Swing controllers?
I am learning MVC in Java
I am trying to separate the logic from the JFrame using a controller class.
The problem is that my button does not execute the controller method when clicked.
View:
public ...
Best practices
0
votes
1
replies
102
views
How should a beginner start contributing to open source projects, and what prerequisites are needed?
I am a computer science student with knowledge of Java, Spring Boot, React, JavaScript, and basic Git/GitHub usage. I want to start contributing to open source projects, but I feel overwhelmed by ...
3
votes
0
answers
59
views
Java Swing+AWT application in Gnome with Wayland on Arch shows crosshair pointer and takes screenshots
I am experiencing a very peculiar behaviour of a Java Swing application with AWT components. I run Arch Linux with Gnome and Wayland.
The application compiles and starts fine - it looks as expected, ...
2
votes
1
answer
64
views
Why is Spring Boot still loading JPA and Hibernate configuration when using another active profile?
I am working on a Spring Boot project with multiple profiles.
I currently have profiles such as:
application.properties
application-memory.properties
application-mongo.properties
The idea is that ...
0
votes
1
answer
53
views
Redundant requests after pageable JPA Query with Joins
While testing various methods for retrieving data about the Order entity through the OrderRepository, I noticed redundant requests after a JPA query with pagination.
@Component(OrderRepository....
Best practices
0
votes
2
replies
93
views
Array-based Queue vs. LinkedList-based Queue: Memory and CPU trade-offs in production
I am analyzing the performance trade-offs when implementing a Queue from scratch.
A Queue can be implemented using either a node-based LinkedList or a dynamic array (like a circular buffer).
From a ...
-4
votes
0
answers
52
views
How to rebuild a tree from PostgreSQL without duplicate nodes? [closed]
I'm developing a Spring Boot application that stores a tree structure in PostgreSQL.
The table schema is:
CREATE TABLE nodes (
id BIGINT PRIMARY KEY,
value VARCHAR(150),
parent_id BIGINT
);...
-4
votes
0
answers
46
views
How can I make a Java PriorityQueue return the highest priority song first? [duplicate]
I am building a small Java console project that simulates a Spotify-style playlist queue. Each song has a title and a priority. Songs with a higher priority should be played first.
I am using ...
2
votes
1
answer
66
views
Multiple @SpringBootApplication classes in Maven project
I'm working on a multi-module Spring Boot project.
The application contains two classes annotated with @SpringBootApplication:
@SpringBootApplication
public class OrganigramaApplication {
public ...
