1,915,758 questions
Advice
0
votes
0
replies
28
views
Quarkus PanacheRepositoryBase.findByIds() returns a list of <T extends PanacheEntityBase>
Why does
https://github.com/quarkusio/quarkus/blob/main/extensions/panache/hibernate-orm-panache/runtime/src/main/java/io/quarkus/hibernate/orm/panache/PanacheRepositoryBase.java
method findByIds(List&...
0
votes
0
answers
69
views
ErrorPageRegistrarBeanPostProcessor bean overriding error
I created a MyApplication.java file following the tutorial under the URL linked below using maven.
https://docs.spring.io/spring-boot/tutorial/first-application/index.html
import org.springframework....
Best practices
0
votes
12
replies
138
views
After I sort two char arrays, how can I check if one array is part of another array? (in Java)
I think ordering the characters in two arrays a useful first step to solve
leetCode's problem 567. Permutation in String:
Given two strings s1 and s2, return true if s2 contains a permutation of s1, ...
-4
votes
1
answer
101
views
Why does my for loop throw ArrayIndexOutOfBoundsException when filling an array of size 5 in Java? [duplicate]
I am learning Java and arrays in my programming course.
I am trying to fill an array of size 5 using a for loop. My understanding is that the array positions should go from 0 to 4.
However, when I run ...
-11
votes
0
answers
139
views
Why does casting a double to int change the result of my calculation? [closed]
I am learning about type casting in Java, and I noticed that my calculation produces a different result than I expected.
public class Main {
public static void main(String[] args) {
double ...
Advice
0
votes
1
replies
102
views
Difference between Spring Initializr and Maven Repository
I am moving from standalone Java applications to building Spring Boot projects, and I am confused about the mechanical overlap between Spring Initializr (start.spring.io) and the Maven Central ...
0
votes
1
answer
67
views
Reading an existing apache-jena tdb database using the java jena api : dataset is empy
I created an apache jena TDB using tdbload , the database contains statements:
tdbquery --loc=/path/to/TDB.rdfs --query=query.sparql
(... OK output rows.... )
Now, I'd like to query (read-only) this ...
Best practices
1
vote
3
replies
81
views
Apache Tika: How to use RAM instread of temp files while parsing?
I'm going to parse mp4 metadata according to this example:
...
BodyContentHandler handler = new BodyContentHandler();
Metadata metadata = new Metadata();
FileInputStream inputstream = new ...
1
vote
2
answers
112
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/{...
-1
votes
2
answers
131
views
How to safely update a shared resource map under high concurrency in Java without performance loss? [duplicate]
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 ...
-4
votes
0
answers
131
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 ...
0
votes
3
answers
77
views
Database query counting method for Spring Boot Unit Tests [closed]
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
50
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
20
replies
204
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
85
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 ...
