October 22, 2024
Chicago 12, Melborne City, USA
java

Getting the Content of a Cell from a workbook

In previos versions of graph i was able to get the value of a cell in excel pretty easy in v5.8 i did this List<WorkbookWorksheet> worksheets = workbookreq.worksheets().buildRequest().get().getCurrentPage(); for (WorkbookWorksheet worksheet : worksheets) { WorkbookWorksheetRequestBuilder worksheetReq = workbookreq.worksheets(worksheet.id); WorkbookWorksheetRangeRequest rangeReq = worksheetReq.range().buildRequest(); WorkbookWorksheetUsedRangeRequest usedRangeReq = worksheetReq.usedRange().buildRequest(); WorkbookWorksheetCellParameterSet cellParam = new WorkbookWorksheetCellParameterSet(); cellParam.column = 3; cellParam.row

Read More
java

Get the java project root package in Neovim

I am using Neovim for Java development. I have nvim.jdtls and eclipse.jdt.ls configured. To add some extra commands, like creating a new class, I need to get the project root package path, which I believe is already detected by jdtls. Is there an API to query this infromation from programmatically. You need to sign in

Read More
java

When I run flutter doctor, the android toolchain tries to execute a wrong java path

C:\Users\lenovo>flutter doctor Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, 3.24.3, on Microsoft Windows [Version 10.0.22631.4317], locale en-US) [√] Windows Version (Installed version of Windows is version 10 or higher) [!] Android toolchain – develop for Android devices (Android SDK version 34.0.0) X Cannot execute C:\Program Files (x86)\Common Files\Oracle\Java\java8path\java.exe\bin\java

Read More
java

To compile my code what would I have to do?

I have a doubt, the following appears and it does not let me compile my program in Java,I’m using Visual Code, and I have Java -17, I don’t know exactly why the problem is, please help Method [java.lang.VirtualThread.notifyJvmtiHideFrames(Z)V] is annotated with @IntrinsicCandidate, but no compiler intrinsic is defined for the method. Method [java.lang.VirtualThread.notifyJvmtiDisableSuspend(Z)V] is annotated

Read More
java

After migration to Jakarta: java.lang.NoClassDefFoundError: javax/activation/DataContentHandler

I have module that used javax.mail and javax.activation. Now I moved to Jakarta. I updated the dependencies and all the imports. When I run it locally it runs fine, but when running it in Docker container I have the following error: java.lang.NoClassDefFoundError: javax/activation/DataContentHandler at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1027) at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150) at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862) at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760) at

Read More
java

Java Stream Convert HashMap into ArrayList which joins both Key and % Value using String.format

How to do this: int size = ... var a = new ArrayList<String>(); for (Map.Entry<String,Integer> e : myHashMap) { a.add( String.format("%s %.3f", e.getKey(), 100.0 * e.getValue() / size)); } :using Stream? int size = ... var a = myHashMap.entrySet() .stream() .sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())) .map(Map.Entry::getValue) .toList(); How to both getValue and getKey and combine them using String.format ?

Read More
java

How to check empty line between license header and package name in Checkstyle

Could anyone say how to check the presence of empty line between license header and package name, if it is possible. I mean: /* * My license */ <-- I need an empty line here and I want checkstyle to check it package com.foo; You need to sign in to view this answers

Read More
java

org.junit.jupiter.api.extension.ParameterResolutionException: No ParameterResolver registered for parameter [int arg0] in constructor

I’m migrating our tests from Junit4 to Junit5, one of which is a base test class that’s been inherited by 29 other classes with a constructor. I changed it to use Junit5, the structure is like below: public class BaseTest { protected String field1; protected Integer field2; public BaseTest(String field1, Integer field2) { this.field1 =

Read More
java

Authentication is null despite @WithMockUser

I have this controller where it retrieve the user authentication data and print them out. @GetMapping("/get-role") public ResponseEntity<String> getRole(Authentication auth) { String role = auth.getAuthorities().stream().findFirst().get().toString(); return ResponseEntity.ok(role); } The problem comes when I tried to write the unit test @Test @DisplayName("Test Role") @WithMockUser (username = "user", roles = {"Admin"}) void testRole() throws Exception { URI

Read More
java

onMouse Over nos campos do CA SDM

Gostaria de ajuda para construir uma função que quando o usuário passe o mouse sobre o hdr do campo surja uma janelinha informando a finalidade desse campo. Ex: Campo Item de configuração, quando o ponteiro do mouse passar sobre esse campo surja a janelinha com a informação do campo. Tentei criando um arquivo .js assim:

Read More