I want to create a ENUM which holds different statuses for possible database values and use them also to generate possible drop down statuses in FE: Full code: https://github.com/rcbandit111/Search_specification_POC/blob/main/src/main/java/org/merchant/database/service/businesscustomers/BusinessCustomersStatus.java But when I make a POST request to add a new record I get this error: Note that I have changed TicketStatus with BusinessCustomersStatus into the error stack. When I make
Tag: java
How to generate trace ID in AWS format
I would like to use opentelemetry-java-instrumentation with AWS OTEL collector and X-Ray. Unfortunately, AWS OTEL aws-xray exporter is not able to export generated traces to X-Ray because generated trace ID is invalid X-Ray trace ID: How to instrument my opentelemetry-java-instrumentation 1.7.0 to generate trace IDs in X-Ray format? I’ve tried to add aws extension + env variables: without success. Answer
How does the double-dot “..” syntax work in AspectJ?
i need to put this aop aspect to work, but i always get error 404, i need to know if this dots, after controller is right. idk how these dots works, to acess the controller. if can explain how the dots works. Answer would mean – the execution of any method defined in the com.teste1.teste2.web.controller package or one of its
Using Generics for return type parameter Java
I am trying to create a method that will return a generic type parameter. I have a class VehicleOrder that extends the abstract class Order. In class Order, I created an abstract method receiveHiredObject. This method will not receive any parameter and will return a generic. I implemented this method in the class VehicleOrder and I set it up to
create a sub list of elements based on user input
I wrote the code below, where from an initialized list of countries the method will return all the countries who have a longitude of >= 5, the code works but now I want the method to return the name of countries that are close to String D within a 5 degrees range of longitude. I tried implementing the scanner as
How to simplify String concat in java?
Given the following code: I am trying and discussing in the team how the simpliest code could look like while one could use also constructs like: org.apache.commons.lang3.StringUtils: defaultString() MoreObjects.firstNonNull(user.getVorname(), Strings.EMPTY) A possible test could be like (expected results are visible here too): Any ideas welcome… what could I try? BTW: java 17 is allowed 🙂 The following code seemss to
Visibility of mutable object under different locks in Java
mFeaute is a mutable object. I want to know if the change of mFeature in setFeature(Feature feature) is visible to mFeature in useFeature(…) with a different explicit form of synchronized. Thanks. Answer The above code is suffering from a data race and hence is broken. You do not have a happens before edge between the write and the read of
Vowel counter Java application: stuck in for loops? Doesn’t seem to be an infinite loop
I made a java program to count the number of vowels in a string, and I need to use a, or multiple, for loop(s) to do it for a project. The problem is that it does not do anything, or just takes too long, after inputting the string: I have reduced the number of loops, because the original was very
Single return type in Hibernate Search
Let’s say I have an app with many different entities, which do not have relations between each other. I would like to create a search that queries all of them, but returns a unified type, i.e: So my idea was to index the entities and put their values into one single index (with same index fields): As you can see,
Unable to get the clipboard data in java android
I am working on a android project in java where i need to copy paste some data in an activity, but the problem here is i am able to set the primary clip but when i try to access the primaryClip it returns false. Im setting the Primary clip using the following code, Im trying to access like this Here