JetBrains

112 readers
1 users here now

A community for discussion and news relating to JetBrains and its products! https://www.jetbrains.com/

Related Communities

Copyright ยฉ 2000-2024 JetBrains s.r.o. JetBrains and the JetBrains logo are registered trademarks of JetBrains s.r.o.

founded 6 months ago
MODERATORS
1
 
 

Link to a (frustratingly) deleted question on Stack Overflow. Text and image copied below incase you don't have the ability to see it. (Not sure why the image shows multiple times.)


Is there any way to more granularly control IntelliJ IDEA's inspections' "Nullability and data flow problems" option "Treat non-annotated members and parameters as @Nullable"? Preferably for unboxing specifically?

I am aware I can use a variety of @Nullable annotations in a variety of places in the code to make the warnings appear. That's not always an option as the place the boxed primitives are coming from may be other libraries you don't have control over. (Imagine if the Holder record below was from a different project.) I included other examples below to illustrate my point.

public class Sample {

    private final Boolean value;

    public Sample(Boolean value) {
        this.value = value;
    }

    private boolean isValue() {
        return value; // I would like a warning here
    }

    private static Boolean boxedTrue() {
        return true;
    }

    private static boolean unboxedTrue() {
        return boxedTrue(); // No warning here, but that's understandable since never null
    }

    private static Boolean boxedNull() {
        return null;
    }
    
    private static boolean unboxedNull() {
        return boxedNull(); // Only warning in the file (by default)
        // "Unboxing of 'boxedNull()' may produce 'NullPointerException'
    }

    public record Holder(Boolean value) {}

    public boolean openHolder(Holder holder) {
        return holder.value(); // I would like a warning here
    }
}

When "Treat non-annotated members and parameters as @Nullable" is enabled, the following gives warnings. While that makes sense given the name of the option, there is code like this literally everywhere. It adds hundreds of warnings to my project. I'm trying to find more granular choices.

    public static ZonedDateTime timeStuff(LocalDateTime localDateTime, ZoneId zoneId) {
        return localDateTime.atZone(zoneId); // I do not want warnings for this
    }

I see that the Java Class Library has JetBrains annotations despite not actually being annotated. Is there perhaps some way to add these automatically to libraries if there is no better way to control the inspection?

Showing @NotNull and @Contract annotations on LocalDateTime.atZone(ZoneId)

2
5
submitted 1 week ago* (last edited 1 week ago) by [email protected] to c/[email protected]
 
 

Just installed the new version 2024.2 of @jetbrains #webstorm
I really really hate the new UI and I am very annoyed how Jetbrains tries to force me to use it.
Now it's even just a plugin ๐Ÿ˜ 
Jetbrains, I'm a paying customer. This will stop at the moment when you no longer support the classic ui.

3
 
 

What de hell is this ? (PhpStorm 2024.2) #phpstorm #jetbrains @jetbrains #php

4
 
 

All popular IDEs (and most apps) seem stuck in a single-monitor paradigm. When are we going to get an IDE that sets the bar for working with multiple monitors? For inspiration, look at multi-monitor audio engineering consoles. Please
@jetbrains

5
 
 

ok, @AsahiLinux ([email protected] remix) installed on this m1pro macbook pro. and it's working. @jetbrains #IntellijIdea installed and working too even if its name is awkward af, building and running my project in @eclipseadoptium #Temurin #java but JetBrains Toolbox crashes when it tries to open the window. everything else seems ok and *noticeably* snappier than same under vmware fusion on a mac studio. mastodon access via @Tuba

6
 
 

Messed around this weekend trying to make a desktop app with #Kotlin and #ComposeForDesktop, and it's clear to me that it still has a long way to go. The documentation for it is severely lacking and #KMP libraries really seem to be focused on mobile rather than desktop.

Then there's @jetbrains Slack, which would be cool to use to ask questions if only I could figure out how to get access. You can read archives, but if people link to other threads or messages, the link simply doesn't work.

7
8
9
10
11
12
13
14
15
16
17
18