1,918,410 questions
0
votes
0
answers
31
views
New File object wipes the file of the name it's made with
I am making a program that has to do with file reading. I want to make a File object that copies the contents of another file, then pass that File object onto a Scanner to read the contents of that ...
-7
votes
0
answers
31
views
Roadmap to enter the Java job market [closed]
I have been learning Java for about a year. I have a relatively poor family and I am tired of working in a woodworking workshop. I want to learn Java more professionally so that I can earn an income. ...
0
votes
0
answers
29
views
Configuring same network for multiple generic containers does not work
I am trying to create multiple containers using testcontainers lib which are sharing the same Network. What do I have right now is the following:
network = Network.newNetwork();
container1 = new ...
-2
votes
0
answers
26
views
FTC Autonomous Drift
Our robot's autonomous uses encoders to do the driving. We've checked it in the manual mode and it works. In autonomous, it doesn't. For example, in the first backwards sequence, it goes backwards 20 ...
-1
votes
0
answers
32
views
AWS API Gateway HTTP API v2 removes padding (`=`) from query parameters when calling Lambda (Java Spring Boot)
I’m using AWS API Gateway HTTP API v2 with a Lambda function running a Java Spring Boot application
The integration type is Lambda proxy integration with payloadFormatVersion: 2.0.
Everything works ...
Best practices
1
vote
2
replies
25
views
Using selenium waits as asserts
I'm trying to use asserts in selenium java. I read that for every validation i need to use an assert as best practice.
i stumbled upon this code example:
WebDriverWait wait = new WebDriverWait(driver, ...
-11
votes
0
answers
99
views
Guideline for method ordering [closed]
I need any formal publicly available guideline that specifies the order of method declaration in a Java source file.
In particular, I'm interested in which should go first: private methods invoked ...
-5
votes
0
answers
83
views
How do I compute the space occupied (not the number of elements in it) by a TreeMap at Runtime (in MB)? [closed]
Background:
I am working on an indexer and wish to set a threshold (in bytes) when the current index has to be flushed to disk and a new index must be created to accommodate more objects.
Currently I ...
Best practices
0
votes
2
replies
66
views
How to model and persist entities whose state changes over time
I’m designing a domain model where some entities evolve over time, and I need to keep a historical record of their state that can be retrieved later.
A simplified example:
A Credit Line represents a ...
0
votes
1
answer
57
views
Jakarta Persistence (JPA) Specification for a join
I cannot get this JPA Specification to work for a simple join. I know the ""statusLookup.code" when mapping but does not work here. Does anyone know how to get it to work. Its a ...
0
votes
0
answers
56
views
Javalin CVE. What's the workaround?
I'm trying to use Javalin in a new project I'm working on but every version of Javain has a dependency containing a CVE, and thus, none of the Javalin JAR versions can be downloaded from mvnrepository....
-4
votes
0
answers
55
views
PAckages dont exist? [duplicate]
I'm working on a maven project, with this structure and this POM , but as you can see, vs-code says the packages dont exist. please help me strucutre and code, and the pom is as below.
I dont know ...
Best practices
0
votes
1
replies
50
views
Version catalogs: Naming/referencing dependencies
I try to understand how libraries are named in a toml version-catalog and then referred to, in a gradle-file.
Obviously the last part of the "group" is repeated as the first part of the &...
1
vote
1
answer
81
views
Sometimes wrong output in Java queue simulation
Problem summary:
Each person in line has tickets[i] tickets to buy. Every second
The person at the front buys one ticket.
If they still need more tickets, they move to the end of the queue.
We need ...
Advice
0
votes
6
replies
90
views
Geeksforgeeks problem and example explanation
Here is the problem statement and what I gather is the array to the right of any has to be less then or equal to the leader. In the example and in the test inputs it seems not to account for larger ...