11 questions from the last 1 days
Advice
0
votes
0
replies
38
views
How to make ANTLR ignore unwanted tokens in the parse tree?
When parsing my grammar file, ANTLR seems to be reluctant to correct its course by ignoring tokens. For example, ? if true { is valid syntax, which is parsed into a definition with an expression true ...
Score of -2
0 answers
47 views
How to clear Redis ClientSideCaching/FrontendCache
I have some wrapper over CacheFrontend to make client-side caching in my app.
I have the config class where I create my client-side cache:
@Configuration
public class RedisConfiguration {
private ...
Best practices
1
vote
3
replies
58
views
Unit test separation
I have a test method for a utility class I made. Here's the test method
@Test
void interpolateTest() {
String input = "Hi, I am {} and it is {}℃ out";
...
Score of 0
1 answer
124 views
Java generics parameters multiple levels
I'm trying to extend MutableLiveData in multiple classes, each one extends the previous, like (those following rows could be copy/pasted directly in java file to test/lint them):
class ALiveData<T&...
Score of 0
0 answers
68 views
Spring thinks that my post processor doesn't implement the right interface if load time weaving is enabled and I use a factory method to create it
I've tried to create a minimal example of the problem. It took me many hours of debugging to understand the issue well enough to even attempt this. Hopefully, I got it right. We need three files:
...
Score of 0
1 answer
58 views
How to customize the pager prompt for JLine's Less builtin?
Is there a method to customize what is displayed as the pager prompt printed by JLine's Less builtin?
Examining the source code for JLine's Less, I can find no support for the -P option (which is what ...
Score of 0
0 answers
60 views
Ignoring binary data in Hibernate JDBC logging
I am using Hibernate 6.5.x, and I am currently logging the SQLs an the JDBC binding parameters using the following configuration from the Hibernate logging guide by Thorben Jannsen
org.hibernate.SQL=...
Score of -4
0 answers
69 views
Java NullPointerException after looping through a empty array, and trying to check if a certain variable is there [duplicate]
I have 2 builder patterns, in which I have items, and character respectively, the characters have arrays as one of their components. ( I have to include these just, so you can run the code, I can't ...
Score of -2
3 answers
230 views
My if statement always gives the same output [duplicate]
This if statement checks whether playerInput.contains("equip") or playerInput.contains("unequip")
System.out.println("Equip or UnEquip");
String playerInput = scanner....
Score of 0
0 answers
59 views
JxBrowser OFF_SCREEN mode: window.innerWidth/outerWidth report stale/inconsistent values during rapid resize — is there a resize-completion callback?
I'm embedding JxBrowser (Chromium) inside a Java Swing desktop application using OFF_SCREEN rendering mode. During window resize, I'm seeing a consistent race condition between Java's known-correct ...
Best practices
2
votes
4
replies
148
views
How would you read the data from the Excel file and store it into a database using Java?
You have an Excel (.xls/.xlsx) file containing 1000 employee records. How would you read the data from the Excel file and store it into a database using Java?
<dependency>
<groupId>org....