I used to have this problem all the time myself, doing the same workaround 
(open each file, save it to remove the stray error badge). But at some point 
(several years ago) it stopped happening for me. I'm on Java 24 now.

One source of mysterious errors I observed (in NetBeans and other tools) was 
caused by annotations in enum constructors, e.g. the "@Nullable" annotation in 
the following example:

public enum TemporalStyle {
  ISO('i', null),
  LOCALIZED_SHORT('s', FormatStyle.SHORT),
  LOCALIZED_MEDIUM('m', FormatStyle.MEDIUM);

  private TemporalStyle(char c, @Nullable FormatStyle fs) {
    ...
  }
  ...
}

See https://bugs.openjdk.org/browse/JDK-8024694 . It may or may not have 
anything to do with the stray error badge problem, but the latter problem 
disappeared for me around the same time as when I removed all annotations in 
enum constructors.

-- Eirik

From: Jens Zurawski <j...@diegurus.de>
Date: Monday, May 5, 2025 at 9:41 AM
To: "users@netbeans.apache.org" <users@netbeans.apache.org>
Subject: Possibility to force new calculation of error notifications in project 
view?

Hi folks,

I have a nasty problem every time I'm updating to a new Netbeans
Version, which really prevents me from doing it too often. So every now
and then I'm skipping a version to avoid this issue.

I'm working (besides others) on a big EE application with lots of JSF
views and composition components and relying on a lot of libs including
PrimeFaces, OmniFaces, DeltaSpike etc. Now, every time I'm upgrading the
Netbeans Version, on first opening of this big project, a random number
of files (around half of them, sometimes more) are marked with the
little red error notification icon. And this icon stays there even after
a complete Clean and Build cycle (the project builds without any error).
The only way to get rid of these icons is to open every single file into
the editor, make some silly change (a single space is enough) and save
it again. After that the icon eventually vanishes. Once all of the files
are "cleaned" this way, from that time on Netbeans works like expected
and really only marks files with errors.

I assume that there is some timing/order conflict in gathering and
generating all needed informations upon start up and opening a project
for the first time, but I have no clue, what it could be.

This isn't really a showstopper for me, because in the end everything
seems to work, but it's annoying and irritating to see lots of "errors"
which in fact are not errors.
A good workaround for me would be, if I could trigger the
calculation/generation of these markers once every lib etc. has been
scanned (or whatever causes that problem) so that I don't have to
manually go through the whole project and open every second file just to
get rid of these icons. Is there a way of doing this? Deleting the cache
and restarting Netbeans doesn't do the trick.

If it matters: This is for Netbeans 25 (but already was this way since
older versions, but sadly I don't recall when it starts to get my
attention), I'm using Java 21 on Windows 10

cu
Jens


---------------------------------------------------------------------
To unsubscribe, e-mail: 
users-unsubscr...@netbeans.apache.org<mailto:users-unsubscr...@netbeans.apache.org>
For additional commands, e-mail: 
users-h...@netbeans.apache.org<mailto:users-h...@netbeans.apache.org>

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Reply via email to