You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure what I have done, but today I noticed the following notes during Compilation of the MopeLspServer.
> Task :compileJava
Note: /home/swtp/Documents/src/MopeSWTP/src/main/java/Server/MopeModelicaService.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
> Task :processResources UP-TO-DATE
> Task :classes
I cant remember if i saw them earlier... but I think they are connected to my Changes in the feature/Diagnostics Branche
Has anyone an Idea what this means?
After reading through some StackOverflow Questions i think this has something to do with unsafe Typehandling... But I am not sure where i did this in MopeModelicaService.java
The text was updated successfully, but these errors were encountered:
Is this issue not reported in IntellIJ? Usually the IDE should already highlight any warnings.
Have you tried the debug parameter -Xlint:unchecked suggested by the note?
As a general hint: This sounds like an incorrect usage of Java generics. Maybe you forgot the diamond operator (<>) or some concrete name for a generic type parameter somewhere in your code?
You never want to use <?> in generics, because this is essentially the equivalent of throwing your hands in the air and yelling "the fuck do I care what type this is!".
At this point, the correct return type that you get is CompletableFuture<Either<List<CompletionItem>, CompletionList>>. I admit that this is a little unwieldy, but since Java 10 you can use the type inference keyword var for this. You can think of this as the safe variant of <?>, which does not throw away the generic type information, but rather tells the compiler to determine the most fitting type for you.
So the above line should probably be changed to...
var completion = server.getTextDocumentService().completion(params);
After that, you can unpack the value properly by first checking whether you got a Java list or a CompletionList and then proceeding accordingly.
I am not sure what I have done, but today I noticed the following notes during Compilation of the MopeLspServer.
I cant remember if i saw them earlier... but I think they are connected to my Changes in the feature/Diagnostics Branche
Has anyone an Idea what this means?
After reading through some StackOverflow Questions i think this has something to do with unsafe Typehandling... But I am not sure where i did this in MopeModelicaService.java
The text was updated successfully, but these errors were encountered: