1,914,394 questions
Score of -2
1 answer
144 views
Throwing exceptions in method for a class [closed]
I have an issue where when I throw a new exception in a method for a class I am building using Java, it shows a warning saying
Unhandled exception: java.lang.IllegalAccessException
Below is an ...
Score of 0
3 answers
130 views
How to style a JFileChooser
I made a code editor application with Java Swing.
I'm using a JFileChooser to let the user select files to open but by default it's in light mode.
I tried to override some methods:
private ...
Score of -1
0 answers
112 views
Encountering a compilation error in the generated hash() related to additionalProperties when using the OpenApi Generator Plugin with SpringBoot [closed]
We are encountering a compilation error in the generated hash() method related to additionalProperties when using the OpenAPI Maven Generator plugin with Spring Boot 4. Could you please help us ...
Score of -5
0 answers
82 views
Severin Java EndpointMapping [closed]
Is this a good way to memorize different mappings for endpoints? I am searching for different ways to implement it with CRUD operations.
@PostMapping
public ResponseEntity<ItemDto> create(
...
Score of 5
1 answer
143 views
How can I make a BigDecimal parallel reduction deterministic when a finite MathContext is required?
I’m investigating how to aggregate signed monetary adjustments using Java 8 streams. My requirements are:
Positive and negative adjustments can cancel each other.
Calculations use a finite ...
Score of -5
0 answers
49 views
Spring Data JPA Understanding and proxy class creation [duplicate]
I am confused about how the spring data JPA works under the hood. I do know that it creates a proxy class which implements our custom repository interface like OrderRepository (which in turn extends ...
Score of -1
0 answers
115 views
Spring Boot endpoint that returns 202 with a jobId and runs a long sync task in the background
I'm working on a university project for a water billing office. The office has a legacy system with a MySQL database that we are not allowed to modify. As part of a new feature, we created a separate ...
Score of 0
1 answer
106 views
Block model doesn't show it texture, and item icon doesn't show up too
I'm new to modding so help me please. There might be errors.
Casing texture is missing (it may be the model or block_state) and the item icon is missing too.
I tried to use AI but it didn't help. So ...
Score of 0
0 answers
115 views
RAG with Spring AI and Llama 3.2 answers some queries but refuses semantically similar ones [closed]
I'm building a RAG pipeline with Spring Boot 3.2, Spring AI 1.0.0, Ollama running Llama 3.2:3b, and pgvector as the vector store. The pipeline retrieves documents from pgvector and injects them into ...
Score of -2
0 answers
76 views
Connection refused when injecting ChatClient with Ollama and Llama 3.2 in Spring Boot
I'm building a RAG pipeline with Spring Boot 3.2, Spring AI 1.0.0, and a local Llama 3.2 model running on Ollama. When I start the application and try to use ChatClient, I get the following error: org....
Score of 0
3 answers
207 views
How do I take two points and find a new point that'd be R amount closer to the second point? [closed]
I've been trying to code a function that takes points A and B as inputs, and then figures out C by calculating where A would be if it was R units closer to B
My first solution was to have C be equal ...
Score of -5
2 answers
189 views
Does it make sense to perform the following micro-optimization in a *for* loop?
The following code illustrates a behavior of the for loop in Java that may be counterintuitive to some people:
void showNumbers( List<Integer> myList ) {
for( int i = 0; i < myList.size(...
Score of 1
1 answer
96 views
ojdbc17 23.26.3 fails with ORA-12564 (before authentication) when the OS username is "USER" — empty TNS CID sent
Environment
Oracle JDBC thin driver: ojdbc17 23.26.3.0.0 (from Oracle Maven repo)
Java: OpenJDK 25.0.3 (Temurin, macOS aarch64) — also reproduced with a bare JVM,
no app framework
DB: Oracle (...
Score of 11
4 answers
1108 views
Why does casting to Object[] prevent a ClassCastException?
I have a toArray() method on a generic Box<E> class returning E[], and since you can’t write new E[10], I built an Object[] and cast it on the way out. Stripped down, it’s this:
public class Box&...
Score of -8
1 answer
295 views
In Java, Is an Object[] Homogeneous or Heterogeneous? [closed]
According to Java standards, if an array or ArrayList stores all its elements as Object references, shouldn't those elements be considered homogeneous because their declared reference type is the same?...