This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 134663 - NullPointerException at org.netbeans.modules.editor.hints.HintsControllerImpl$1.run
Summary: NullPointerException at org.netbeans.modules.editor.hints.HintsControllerImpl...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Javadoc (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Pokorsky
URL: http://statistics.netbeans.org/except...
Keywords:
: 144545 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-05-07 13:11 UTC by tboerkel
Modified: 2008-09-10 08:40 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 51624


Attachments
stacktrace (3.62 KB, text/plain)
2008-05-07 13:11 UTC, tboerkel
Details
stacktrace (3.62 KB, text/plain)
2008-06-30 14:47 UTC, tboerkel
Details
Java-File for ISE-Stacktrace (19.08 KB, text/plain)
2008-09-09 13:21 UTC, arittner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tboerkel 2008-05-07 13:11:17 UTC
Build: NetBeans IDE 6.1 (Build 200804211638)
VM: Java HotSpot(TM) Client VM, 10.0-b22, Java(TM) SE Runtime Environment, 1.6.0_06-b02
OS: Windows XP, 5.1, x86

User Comments: 
Editing
Comment 1 tboerkel 2008-05-07 13:11:26 UTC
Created attachment 61125 [details]
stacktrace
Comment 2 Jan Becicka 2008-05-15 13:24:49 UTC
Max volunteered :)
Comment 3 tboerkel 2008-06-30 14:47:18 UTC
Created attachment 63689 [details]
stacktrace
Comment 4 Max Sauer 2008-06-30 15:55:40 UTC
Is there some reproducible scenario, or some sample code available? Thanks.
Comment 5 Max Sauer 2008-06-30 16:02:13 UTC
ErrorDescriptionFactory.createErrorDescription should not be called with null position. Honzo, could you please have a look at it? (Analyzer:createSignaturePositions ?)
Comment 6 Jan Pokorsky 2008-07-01 12:05:27 UTC
It appears that TreeUtilities.findNameSpan(Tree) returns null positions. Unfortunately I cannot do more without further
info. I have added logging to Analyzer that should shed light on what's wrong.

http://hg.netbeans.org/main/rev/2906df71ab29
Comment 7 Quality Engineering 2008-07-02 04:30:34 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #294 build
Changeset: http://hg.netbeans.org/main/rev/2906df71ab29
User: Jan Pokorsky <jpokorsky@netbeans.org>
Log: #134663: improved logging
Comment 8 Jan Pokorsky 2008-09-04 18:34:38 UTC
*** Issue 144545 has been marked as a duplicate of this issue. ***
Comment 9 Jan Pokorsky 2008-09-04 18:37:40 UTC
Thanks to gtg I have a test case now.
Comment 10 Jan Pokorsky 2008-09-05 10:31:37 UTC
fixed http://hg.netbeans.org/main/rev/464b855d935e
Comment 11 Quality Engineering 2008-09-05 17:33:35 UTC
Integrated into 'main-golden', will be available in build *200809051401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/464b855d935e
User: Jan Pokorsky <jpokorsky@netbeans.org>
Log: #134663: do not analyze method with errorneous name
Comment 12 arittner 2008-09-09 13:16:02 UTC
WARNUNG [org.netbeans.api.java.source.JavaSource]: JavaSource.runUserActionTask called in AWT event thread by:
org.netbeans.modules.editor.java.JavaCodeTemplateFilter.<init>(JavaCodeTemplateFilter.java:78)
SEVERE [global]
java.lang.IllegalStateException: Please attach the stack trace and if possible also the edited source file
'C:\Entw\Work\svn\S3\src\AdmSoftware\App\mainLoader.java' to issue http://www.netbeans.org/issues/show_bug.cgi?id=134663
kind: CLASS
tree: '
public static class SplashWindow extends Frame {
    private Image imageLogo;
    private Image image;
    private String updateVersion = Pool.getProperty("Update.Version", "0");
    
    public SplashWindow(String specialImageName, String defaultImageName, String logoName) {
        super();
        setUndecorated(true);
        setSize(400, 261);
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension dialogSize = getSize();
        setLocation((screenSize.width - dialogSize.width) / 2, (screenSize.height - dialogSize.height) / 2);
        setBackground(Color.black);
        try {
            ImageResource ir = new ImageResource(specialImageName);
            image = ir.getImage();
        } catch (java.io.IOException ioe) {
            try {
                ImageResource ir = new ImageResource(defaultImageName);
                image = ir.getImage();
                ImageResource irLogo = new ImageResource(logoName);
                imageLogo = irLogo.getImage();
            } catch (java.io.IOException ioe2) {
                System.out.println("Kann Splash-Grafiken nicht laden... " + ioe2);
            }
        }
        if (image != null) {
            MediaTracker md = new MediaTracker(SplashWindow.this);
            try {
                md.addImage(image, 0);
                if (imageLogo != null) md.addImage(imageLogo, 1);
                md.waitForID(0);
                if (imageLogo != null) md.waitForID(1);
            } catch (InterruptedException ie) {
                ;
            }
            BufferedImage buf = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_RGB);
            Graphics gImage = buf.getGraphics();
            gImage.drawImage(image, 0, 0, null);
            if (gImage != null) {
                if (imageLogo != null) {
                    gImage.drawImage(imageLogo, 255, 200, null);
                }
                String javaVersion = System.getProperty("java.runtime.version");
                gImage.setColor(Color.darkGray);
                if (!updateVersion.equals("0")) {
                    gImage.drawString("u-" + updateVersion + "      JRE: " + javaVersion, 50, 163);
                } else {
                    gImage.drawString("JRE: " + javaVersion, 50, 163);
                }
            }
            image = buf;
        }
        this.repaint();
    }
    
    public void update(Graphics g) {
        paint(g);
    }
    
    public void paint(Graphics g) {
        if (image != null) {
            g.drawImage(image, 0, 0, null);
        } else {
            g.setColor(Color.white);
            g.drawString("Sepix Sales System wird geladen...", 20, 100);
        }
    }
}'
	at org.netbeans.modules.javadoc.hints.Analyzer$1.run(Analyzer.java:664)
	at org.netbeans.editor.BaseDocument.render(BaseDocument.java:1366)
	at org.netbeans.modules.javadoc.hints.Analyzer.createSignaturePositions(Analyzer.java:651)
	at org.netbeans.modules.javadoc.hints.Analyzer.analyze(Analyzer.java:197)
	at org.netbeans.modules.javadoc.hints.JavadocHintProvider.run(JavadocHintProvider.java:121)
	at org.netbeans.modules.java.hints.infrastructure.SuggestionsTask.run(SuggestionsTask.java:122)
	at org.netbeans.modules.java.hints.infrastructure.SuggestionsTask.run(SuggestionsTask.java:65)
[catch] at org.netbeans.api.java.source.JavaSource$CompilationJob.run(JavaSource.java:1683)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
	at java.lang.Thread.run(Thread.java:619)

>System Info: 
  Product Version         = NetBeans IDE Dev (Build 200809081401)
  Operating System        = Windows XP version 5.1 running on x86
  Java; VM; Vendor        = 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05; Sun Microsystems Inc.
  Runtime                 = Java(TM) SE Runtime Environment 1.6.0_03-b05
  Java Home               = C:\Entw\jdk\1.6.0\jre

best regards,
  josh.
Comment 13 Jan Pokorsky 2008-09-09 16:53:38 UTC
arittner: your broken source file seems to have invalid positions for AST.

Fixed as http://hg.netbeans.org/main/rev/7301cc555180. The issue should not occur any more.
Comment 14 Quality Engineering 2008-09-10 06:03:01 UTC
Integrated into 'main-golden', will be available in build *200809100201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/7301cc555180
User: Jan Pokorsky <jpokorsky@netbeans.org>
Log: #134663: even more defensive fix for broken source codes
Comment 15 arittner 2008-09-10 08:40:39 UTC
> arittner: your broken source file seems to have invalid positions for AST.

Yes, it's an c&p:

Clipboard:

private boolean x = true;

and paste in:

public Ctor () {
  |
}

Thank you for your fast fix. I'll test it asap.