Skip to main content

Questions tagged [java]

Java is a high-level, platform-independent, object-oriented programming language originally developed by Sun Microsystems. Java is currently owned by Oracle, which purchased Sun in 2010.

Filter by
Sorted by
Tagged with
1 vote
4 answers
157 views

I'm working on a Spring Boot application with a VoucherService and VoucherController. I currently have the service method return an ApiResponse<T> directly, like this: @Transactional public ...
Conquer the world's user avatar
1 vote
1 answer
222 views

I am refactoring my monolithic application, in which the code is organized based on layered architecture. I want to implement Modulith (Modular Monolit) in my app, but I've run into a problem: I haven'...
Ice K's user avatar
  • 31
2 votes
3 answers
636 views

Sometimes, you inherit from a class that defines the semantics of your type (Shape – Ellipse – Circle). Other times, you inherit simply because it's convenient to do so. A superclass may have ...
Sergey Zolotarev's user avatar
0 votes
2 answers
203 views

I’m refactoring a microservice project where multiple services share the same domain objects. Over time, these objects have diverged across services, causing inconsistencies. To solve this, I plan to ...
Ryley38's user avatar
  • 111
0 votes
3 answers
217 views

Problem: our application allows users to close a form window after certain changes without any confirmation, instead of pressing the Save button. This makes them complain they have to start afresh. We ...
Sergey Zolotarev's user avatar
0 votes
1 answer
131 views

I am exploring the state-of-the-art methods to create a service that can run and scale in both cloud (container) and on-premise environments. The current version of the software is designed for on-...
Apollo's user avatar
  • 139
2 votes
3 answers
265 views

(related: Fetching records matching multiple joined attributes) If Spring Data doesn't allow GET requests to have a body (and it's considered bad practice anyway) curl -X 'GET' \ 'http://localhost:...
Sergey Zolotarev's user avatar
1 vote
5 answers
557 views

Say I have a bunch of classes that imitate cars: SportsCar, Truck, and SUV. All of these classes share some public methods like start() and stop() which they inherit from an abstract class Car. While ...
Ruben Rundström's user avatar
2 votes
3 answers
181 views

Is it fine for your data models to have a sort of "open-ended" list of properties? For example, you may have some Employee: // getters, setters, annotations are omitted public class Employee ...
Sergey Zolotarev's user avatar
21 votes
5 answers
5k views

I've heard that I should never use Java serialization (Serializable/ObjectInputStream/ObjectOutputStream) because of security. What's the problem?
Stack Exchange Broke The Law's user avatar
3 votes
2 answers
504 views

I'm working on a Spring-based micro service project and considering different approaches for handling authentication and authorization. Instead of setting up a dedicated authorization server, I'm ...
GeekChap's user avatar
8 votes
7 answers
5k views

We have entities with numeric properties, they are of boxed types (e.g. Integer). Typically, each of those properties has a pair of getters: getInt(), which returns zero on null values, and ...
Sergey Zolotarev's user avatar
1 vote
4 answers
209 views

Due to type erasure, I can't do instanceof T in Java. With that in mind, how do (should) I write, for example, a generic TreeNode (or, more precisely, DefaultMutableTreeNode)? setUserObject() accepts ...
Sergey Zolotarev's user avatar
0 votes
2 answers
364 views

Which code style is preferred in Java? final boolean result = isCausedBy(e, ExceptionType1.class) || isCausedBy(e, ExceptionType2.class) || isCausedBy(e, ExceptionType3.class) |...
Andriy Makukha's user avatar
3 votes
1 answer
168 views

I am currently working in a project where we are utilizing kafka as a Message Queue. We have two use cases here, one is to consume the messages in parallel, no ordering of any kind required. And one ...
Akshansh Jain's user avatar
3 votes
4 answers
2k views

I have a stack of custom Row widgets. Each of them is a label with some editComponent (often a JTextComponent). Rows are aware of their previous and next siblings (if a Row has no such sibling, the ...
Sergey Zolotarev's user avatar
0 votes
2 answers
246 views

I have recently come across a few codebases at work where the previous developers chose to reach the >80% coverage criteria by writing only integration tests with the @SpringBootTest annotation ...
Mary's user avatar
  • 3
0 votes
1 answer
87 views

I have a foundational metamodel which I have implemented using Java interfaces which I can easily version using major.minor.bugfix. I also have plugins that utilize these libraries to implement these ...
Proud Papa's user avatar
0 votes
2 answers
194 views

The application in question is integrating with BigImportantThing (BIT). Part of our application's job is to provide a better interface, so this is something to resolve within our application. The ...
Mr Redstoner's user avatar
0 votes
0 answers
93 views

I am building an app where I have tenants and each tenant can have multiple users. The users can do multiple things in the application and these functionalities also are kind of independent from each ...
securita's user avatar
3 votes
3 answers
1k views

I read about three-tier architecture and I have a question: I read that in business logic (that is, what is in logic tier) there should be POJO classes, but in most Spring manuals these classes are ...
dude34810's user avatar
4 votes
5 answers
3k views

I have the following method, which needs to return a List, but exceptions might occur along the way, and I don't want to handle them in my application, mainly because I don't even know how to handle ...
MasterTJ123's user avatar
2 votes
1 answer
244 views

With the introduction of JEP 358 in Java 14, which provides more informative NullPointerException (NPE) messages, is it advisable to remove existing explicit null checks in cases where the null-check ...
ftb457932's user avatar
-2 votes
1 answer
221 views

Some may think I'm kidding, but I'm really stuck on this Suppose you have some UserDao interface that you want to implement What should you call it? Here are a few points I'd like to make I firmly ...
Sergey Zolotarev's user avatar
0 votes
2 answers
316 views

Let's say there is a domain model: @Table(name = "room") @Getter @FieldNameConstants @AllArgsConstructor(onConstructor = @__({@PersistenceCreator})) public class HotelRoom extends ...
叶知泉's user avatar

1
2 3 4 5
101