This Question have 3 answers right now.

How can I disable annoying warning/hint in NetBeans 8.1


I am working with Java and Jersey in NetBeans and all my endpoints are flagged with the following hint: "Convert Method To Asynchronous"

This hint really pollutes the right-hand gutter where I usually look for code changes/errors.

There is nothing in preferences -> editor -> hints that seems to affect this hint.



You can use the @SupressWarning annotation, or, by hovering the mouse-pointer over the warning, there are options to disable for instance (auto-generates @SupressWarning), for file, for package, for project or "forever" (pah-dum-pshh =P).

However, most warnings are there for a reason, and although some can show up by "mistake" while your class isn't fully implemented yet, if your class is complete and a warning is still present, you're advised to correct it rather than suppress it.

By : AlmightyR

Window messages can only pass around 2 integers (the wParam and lParam parameters).

Integer values by themselves do not require any special marshaling across module/process boundaries, they can be passed around as-is. They are also very small to pas around, store in message queues, etc.

For WM_COMMAND in particular, lParam may contain an HWND value, so the other message values (notification code and identifier) can only be passed in wParam only. They are small enough to be stuffed into wParam directly, thus making it easy to pass around 3 values where only 2 values are allowed.

The alternative requires allocating memory for a struct that contains the separate integers, and then pass a pointer to that struct around in one of the message parameters. And many window messages do exactly that, but usually only when the sender and receiver are in the same process, otherwise it requires marshaling the struct data across module/process boundaries, which is a lot of overhead for simple messaging.

It also puts the burden on the receiver to free the allocated memory, since WM_COMMAND is a posted message that goes through the receiving window's message queue. The sender does not wait for the message to be processed, and thus would not be able to free the struct memory after posting the message. The allocated memory would have to stay alive in memory until the message is finally processed by the receiving window procedure.

Sent messages, on the other hand, go directly to a window procedure and block the sender until processed, so they do not have to worry this, the sender can free the memory after the message is sent. But making all multi-value messages, especially status messages, do this would be a big bottleneck on the system.

In general, it is easier and less overhead to stuff shorter integers into a larger integer whenever possible, especially in posted messages (though sent messages can certainly do it, too).

If I am reading this correctly, Message would contain a List<MessageUser>.

If that's the case then this should get you close:

var List<Message> messages = 
    ( from m 
      in db.Messages 
          m.UserID == userid || m.MessageUsers.Any(mu => mu.UserID == userID) 
      select m).ToList();
By : Sam Axe

Video about How can I disable annoying warning/hint in NetBeans 8.1