Pergunta

Normally, I get little yellow hints from Netbeans. As can be seen, the class fails to compile, but there are no hints from Netbeans where normally I would expect to see little yellow hints on the line numbers:

yellow hints on the line numbers

I have the throws option configured as so:

throws option configured as so

I'm not seeing hints about declaring objects, either. It's like hints are disabled. How do I re-enable hints?

Edit:

code as follows:

package net.bounceme.dur.nntp.swing;

import java.util.logging.Logger;
import javax.swing.DefaultListModel;
import javax.swing.JList;
import javax.swing.JScrollPane;
import net.bounceme.dur.nntp.gnu.Page;
import net.bounceme.dur.nntp.gnu.Usenet;

public class MyPanel extends JScrollPane {

    private static final Logger LOG = Logger.getLogger(MyPanel.class.getName());
    private JList jList;
    private DefaultListModel defaultListModel;
    private Usenet u = Usenet.INSTANCE;
    private Page page;

    public MyPanel() {
        page = u.getPage(new Page().getPmd()); //uncaught exception
        jList = new JList(defaultListModel); // null, need to initialize
        initComponents();
    }

    private void initComponents() {
    }
}

Stack trace showing this class failing to compile:

init:
Deleting: /home/thufir/NetBeansProjects/gnumail-providers/build/built-jar.properties
deps-jar:
Updating property file: /home/thufir/NetBeansProjects/gnumail-providers/build/built-jar.properties
Compiling 1 source file to /home/thufir/NetBeansProjects/gnumail-providers/build/classes
/home/thufir/NetBeansProjects/gnumail-providers/src/net/bounceme/dur/nntp/swing/MyPanel.java:19: error: unreported exception Exception; must be caught or declared to be thrown
        page = u.getPage(new Page().getPmd()); //uncaught exception
Note: /home/thufir/NetBeansProjects/gnumail-providers/src/net/bounceme/dur/nntp/swing/MyPanel.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
/home/thufir/NetBeansProjects/gnumail-providers/nbproject/build-impl.xml:624: The following error occurred while executing this line:
/home/thufir/NetBeansProjects/gnumail-providers/nbproject/build-impl.xml:243: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 0 seconds)
Foi útil?

Solução

This is not answer, it's additional information. The problem resolved itself spontaneously. Maybe it's because I quit Netbeans. Maybe it's because I rebooted. Maybe it's gremlins:

enter image description here

Just to be clear, compile-on-save is still disabled and it's the same version of Netbeans.

Outras dicas

I had the same issue after copying an example off an internet web page. After rebooting Netbeans I did get the hints again.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top