I want to retrieve the method name on an android app for logging purposes but can’t seem to get it. I’ve already tried doing what was suggested in other answers, such as: Thread.currentThread().getStackTrace(); and new Object(){}.getClass().getEnclosingMethod().getName(); To no avail, the first re…
Tag: java
Spark Dataset Foreach function does not iterate
Context I want to iterate over a Spark Dataset and update a HashMap for each row. Here is the code I have: Issue My issue is that the foreach doesn’t iterate at all, the lambda is never executed and I don’t know why. I implemented it as indicated here: How to traverse/iterate a Dataset in Spark Ja…
Using QuarkusTestExtension in combination with another JUnit extension leads to exception
Is it possible to use the QuarkusTestExtension from Quarkus in combination with the SoftAssertionsExtension from AssertJ? I would like to run a Quarkus test which implicitly calls softAssertions.assertAll() after a test which uses AssertJ’s soft assertions. I’m always encountering an exception, th…
Trying to add a regex for password pattern matching with Spring Boot
I want to add pattern matching for a user registering a password. In my user model I have: However, when I go to register a user I am getting a 400 Bad Request. Can it be done with the @Pattern annotation? And should it go on the model? The endpoint for my controller looks like this: This is the data
How to use Netflix DGS graphql-dgs-extended-scalars JSON scalar (java/spring-boot, maven)?
I ran into the issue where I wanted to use graphql-dgs-extended-scalars, specifically the JSON scalar, but had trouble finding a clear tutorial on how to do it. I’m sure they’re out there, but just in case someone finds themselves in the same situation as me hopefully my simple explanation below w…
How to enable certificate_authorities extension in Jetty with TLS 1.3
I recently updated my Jetty server (11.0.1) to TLS 1.3 (jre 11.0.9.1).The server do not send trusted certificate_authorities anymore in the CertificateRequest phase (client certificate authentication is required). Consequently, in the prompt window, the browsers do not filter the clients certificates delivere…
How to use Array Spilling with Apache POI 5.1.0
Using Apache POI to generate excel files, is it possible to prevent Excel from adding the implicit intersection operator (@) inside formulas ? For instance, using the following code, what I want to do is copy all the values inside the columns from A to K, using Excel Array Spilling behaviour. However, when op…
JAXB UnMarshalling Renders Null Values (JAXB, Java 1.8)
I have an XSD which I have written like this: Now I generate the JAXB classes using CXF maven plugin. And i get a JAXB class like (used a decompiler for this): Now to get it out, I wrote a simple class that just takes a string and unmarshalls it: But that last line prints null. I was expecting it
JUnit5 test void method. Get org.opentest4j.AssertionFailedError: expected:
Don’t judge my code, I am beginner. In the future, I’ll refactor it. I would like to ask for help writing JUnit5 unit tests. I need to test my class Formatter The main task of the class is to print the result of long division Something like this I wrote a test My test throws an error but outputs w…
SnakeYAML – Where is documentation and project homepage (is it still alive)?
I’m trying to figure out how to fine control a specific feature in SnakeYaml (local tags). Unfortunately, I seem to be unable to find a project homepage or the repository of Snake Yaml? All references I find point to either a website, that seems to have been hacked (www dot snakeyaml dot org – not…