111 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
3
votes
1
answer
160
views
Java 15 String.formatted(args): safe for locale-aware usage?
In Java prior to version 15, the most straightforward way of formatting a string was to use String.format(Locale, String, args) method. It was also considered a best practice to put Locale.ROOT as the ...
1
vote
1
answer
67
views
Database PostgreSql: column String or JSON?
i have a project write in Java 17. We use spring-boot and database PostgreSql.
We have a table called "Setting" with this column:
Id BIGINT, KEY String, VALUE String, uuid UUID
In this table ...
0
votes
1
answer
2k
views
pom.xml file is showing these yellow color warnings in IntelliJIDEA while I can run the project just fine
I am using Appium 2.0.0-beta66, Java Client 8.5.0, node 18.xx, Selenium-java 4.9.1, Selenium Server 3.141.59, TestNG 7.7.1, and JDK 1.15.0-02, what is the next long term JDK I can go for ?
BTW, I am ...
user avatar
user3780373
0
votes
1
answer
7k
views
Apache Netbeans 15 is not opening on windows 10
I have been working on a Java project using Apache NetBeans for a long time now. Today I opened Apache Netbeans IDE, it started pretty normally the first time showing the "starting modules" ...
0
votes
1
answer
194
views
What is the purpose explicitly specifying a sub-class as non-sealed? [closed]
In the following example why do I explicitly need to specify a class Square as non-sealed?
Isn't public class Square extends Shape {...} more intuitive?
package com.example.geometry;
public abstract ...
3
votes
1
answer
701
views
How to Access JavaFX Virtual Keyboard (FXVK) Using Open JDK 15 or beyond?
I use the javafx virtual keyboard with open jdk 8. At times I have to access the virtual keyboard to prevent it from displaying when certain text fields get focus. An example of this is a screen where ...
0
votes
1
answer
659
views
How to solve " Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException" [duplicate]
How to solve " Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException" When I run the same code with Java 15, at runtime I get errors indicating ...
0
votes
3
answers
2k
views
Inserting String variable into JSON which is in a form of String
I have a JSON payload saved as a String
String jsonBody = "{\n"
+ " \"example\": {\n"
+ " \"example\": [\n"
+ " {\n"
+ " \"example\": 100,\n"
...
1
vote
0
answers
2k
views
Java 15 - unsupportedoperationexception: can't get field offset on a hidden class
Java 15, java-driver-core 4.15.0 and cassandra-unit 4.3.1.0 is used in the test.
When I trying to prepare statement in my test using cqlSession from EmbeddedCassandraServerHelper - I get 'com.datastax....
3
votes
1
answer
649
views
Use Class<?> parameter in instanceof method
I have the following method that can return different types of Storable (ex: Food, Ore).
Inventory.java
public Storable get(Class<? extends Storable> cls) {
for (Storable storable : ...
1
vote
0
answers
4k
views
Intermitent "Received RST_STREAM: Not an error" observed when calling send on java.net.http.HttpClient
I've noticed recently a weird, intermittent error: "Received RST_STREAM: Not an error" which seems to come from java when calling send on java.net.http.HttpClient. Googling it, I found ...
11
votes
2
answers
1k
views
Lambda expressions and anonymous classes don't work when loaded as hidden classes
I am trying to compile and load dynamically generated Java code during runtime. Since both ClassLoader::defineClass and Unsafe::defineAnonymousClass have serious drawbacks in this scenario, I tried ...
1
vote
1
answer
3k
views
Jackson serialise property based on other property value
I'm looking for a solution to serialize a POJO object property based on some other property value within the same POJO using Jackson.
If a property value matches some criteria then other property ...
-2
votes
2
answers
307
views
Why R is not being printed ? why the output is PQST?
Here's my code. Here PQRST should be the output but R is not printed. I don't understand why ?
class Validator{
public int[] studentId = { 101, 102, 103 };
public void validateStudent(int id) ...
2
votes
2
answers
11k
views
The import java.text.SimpleDateFormat cannot be resolved
I use Java 15 for my example.
I used Eclipse IDE for Java Developers - 2020-12.
I got an error shown below when I define SimpleDateFormat to handle with formating a date object.
import java.text....