Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8838061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:53:33+00:00 2026-06-14T09:53:33+00:00

I have the simple code below for testing the NonNull annotations in IntelliJ. Then

  • 0

I have the simple code below for testing the NonNull annotations in IntelliJ.

Then I go to:
IntelliJ -> File -> Settings -> Inspections -> Probable bugs -> Constant conditions & exceptions
and I set-up Severity: As error.

Doing so, it marks the line “print(null);” as an error as expected.
However, executing IntelliJ -> Build -> Rebuild project,
it works and it does not show any error and it does not show any warning.

Why is so? Why IntelliJ does not complain when building the project?

How to see a list of the NonNull violations?

Is there a way to enforce IntelliJ to fail the compilation if it finds a NonNull violation?


Note: IntelliJ is set-up to take into account the firebug annotations (as by default);
moreover, using the org.jetbrains.annotations.NotNull produces exactly the same result.


src/main/java/test/Hello.java

package test;
import edu.umd.cs.findbugs.annotations.NonNull;
public class Hello {
    static public void print(@NonNull Object value) {
        System.out.println("value: " + value.toString());
    }

    static public void main(String[] args) {
        if (args.length > 0) {
            print(args[0]);
        } else {
            print(null);
        }
    }
}

and the pom.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>hello</groupId>
  <artifactId>hello</artifactId>
  <version>1.0</version>

  <dependencies>
    <dependency>
      <groupId>net.sourceforge.findbugs</groupId>
      <artifactId>annotations</artifactId>
      <version>1.3.2</version>
    </dependency>
    <dependency>
      <groupId>net.sourceforge.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <version>1.3.7</version>
    </dependency>
  </dependencies>
</project>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T09:53:34+00:00Added an answer on June 14, 2026 at 9:53 am

    Code inspections are not compiler errors, at the moment there is no way to fail compilation if there is some problem reported by inspection, even if the severity level is set to error.

    To get the project wide results use Analyze | Inspect Code with the appropriate inspection profile.

    There is similar feature request in IDEA project issue tracker, but it doesn’t seem to be very popular (almost 2 years old and zero votes).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a very simple WCF service, that worked fine (code below), then
I have a simple code below: import java.util.ArrayList; public class BoidList extends ArrayList {
I have two OptionMenu widgets in the simple pieces of code shown below: variable
The below code is very simple. I have a jQuery autocomplete bound to an
below i have a code that runs in most of my simple programs ..
I have a plot (sample code pasted below) that I am trying to add
I have written grammar for a language (sample code below) //this is a procedure
I have a data that looks like this . And my code below simply
I have simple HTML code with some JavaScript. It looks like: <html> <head> <script
I have a simple code using ctypes: Python 3.1.1 (r311:74480, Feb 23 2010, 11:06:41)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.