1,916,992 questions
Best practices
0
votes
1
replies
26
views
Does the Java Memory Model permit reordering writes to a volatile variable into a loop?
I have been learning about the double-checked locking problem in Java, and the Java Memory Model and which optimisations are permitted to be made to a program's execution.
I am currently addressing a ...
0
votes
1
answer
39
views
Custom swimming entity (Animal) won't move in water
I'm making a Fabric 1.21.11 mod (Mojang mappings, GeckoLib 5.4.4) with a custom whale entity that extends Animal. The whale won't swim properly. It either stands still, floats to the surface, or gets ...
-2
votes
0
answers
28
views
Spring Boot 4 + IntelliJ 2025: ClassNotFoundException for PfeApplication [closed]
Error: Could not find or load main class com.backend.PFE.PfeApplication
Caused by: java.lang.ClassNotFoundException: com.backend.PFE.PfeApplication
Class PfeApplication is located in src/main/java/...
0
votes
1
answer
31
views
With ArchUnit, how can I make sure that all classes in my project are starting with the same package?
I have a Gradle project with different dependencies.
I now want to make sure that all source Java classes in my project are starting with the same packages.
How can I achieve this with ArchUnit?
Best practices
1
vote
2
replies
42
views
Safely validating AST of LLM-generated PostgreSQL queries in Java to prevent side effects
I am building a Text-to-SQL application where an LLM generates PostgreSQL queries based on natural language. These queries are executed against a database using a strict read-only user. However, as an ...
-6
votes
1
answer
61
views
How can I check if a Spring @Transactional method is actually running in a transaction? [duplicate]
public class MyService {
@Transactional
public void doSomething() {
// How can I check here?
}
}
I have a Spring Boot service method annotated with @Transactional.
How can I ...
Best practices
3
votes
1
replies
41
views
How to think the organisation of a Java Spring-Boot multi-module project in a clean architecture? I'd like to redispatch/reforge an hexagonal one
My context
I have a large Java Spring-Boot project that have fitted in an hexagonal architecture. It is focused on cities and local authorities problematic, and study various subjects: cities, ...
Tooling
1
vote
0
replies
29
views
How to configure automatic data expiration (TTL) for time-series containers in GridDB using the Java API?
I am experimenting with GridDB for an IoT application where sensors continuously send temperature and humidity readings.
Each record contains a timestamp and the measurements. The container is defined ...
-4
votes
0
answers
22
views
Spring batching rollback issue [closed]
I have a do data migration using spring batching
And created a processor of 10 steps in which first 3 steps are api calls that create the new txn in the system with the data from the source
But if ...
0
votes
0
answers
41
views
NullAway dereferenced error using @EnsuresNonNullIf validation method
NullAway is reporting a dereference error on all parts of the place.getGeographicLocation().getValue().getGeoJson().getCoordinates() chain from the snippet below, even though it's been validated by ...
0
votes
0
answers
60
views
Query 4 Firebase Realtime DB nodes asynchronously and then transform the data in Android Java app
Here is my dilemma, I need to query ALL 4 nodes in Firebase Realtime DB in an Android Java app (I have this working fine in iOS):
PlayerInGroup
Users
PlayerPicks
Teams
I start by getting the ...
-2
votes
0
answers
127
views
How do I call Java code from C in a plugin and avoid random fails [closed]
Then my plugin, written in C, is loaded it makes an initial call to JNI_CreateJavaVM(). It seems to fail completely at random. Running it one time might fail but the next time it might succeed. It ...
Advice
0
votes
3
replies
86
views
Is it considered an anti-pattern to use nested static classes for service commands and responses?
I am structuring the command and response models for my service layer. Currently, putting all models into a single, flat folder (like /commands or /responses) is becoming hard to manage due to the ...
Advice
0
votes
5
replies
68
views
Any product to show ROI on code refactoring or improvements
We have a very large java code base and we are looking for some tools which show technical debt and also shows return of investment in terms of time and money on resolving those issues. Please suggest....
-4
votes
0
answers
71
views
ClamAV INSTREAM scan from Java returns OK for file containing EICAR signature [closed]
I am integrating ClamAV scanning into a Spring Boot application to validate uploaded files before storing them. The application streams file bytes to the clamd daemon using the INSTREAM command via a ...