Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 156470 - NPE at com.sun.tools.javac.comp.Flow.visitMethodDef(Flow.java:677)
NPE at com.sun.tools.javac.comp.Flow.visitMethodDef(Flow.java:677)
Status: VERIFIED FIXED
Product: java
Classification: Unclassified
Component: Compiler
6.x
All All
: P3 (vote)
: 6.x
Assigned To: Dusan Balek
issues@java
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-08 12:03 UTC by Jiri Prox
Modified: 2009-02-19 21:09 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments
file before the code was pasted (7.45 KB, text/plain)
2009-01-08 12:04 UTC, Jiri Prox
Details
form file (6.96 KB, text/plain)
2009-01-08 12:05 UTC, Jiri Prox
Details
dump (11.24 KB, text/plain)
2009-01-08 12:08 UTC, Jiri Prox
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Prox 2009-01-08 12:03:24 UTC
Product Version: NetBeans IDE Dev (Build 20090108033400)
Java: 1.6.0_11; Java HotSpot(TM) Client VM 11.0-b16
System: Linux version 2.6.24-22-generic running on i386; UTF-8; en_US (nb)

NPE was thrown when pasting code into the editor

Content of clipboard:

return new JPanel() {
      public void paintComponent(Graphics g) {
        super.paintComponent(g);
        Font font = (Font) value;
        String text = font.getFamily();
        FontMetrics fm = g.getFontMetrics(font);
        g.setColor(isSelected ? list.getSelectionBackground() : list
            .getBackground());
        g.fillRect(0, 0, getWidth(), getHeight());
        g.setColor(isSelected ? list.getSelectionForeground() : list
            .getForeground());
        g.setFont(font);
        g.drawString(text, 0, fm.getAscent());
      }

      public Dimension getPreferredSize() {
        Font font = (Font) value;
        String text = font.getFamily();
        Graphics g = getGraphics();
        FontMetrics fm = g.getFontMetrics(font);
        return new Dimension(fm.stringWidth(text), fm.getHeight());
      }
    };

Beginnig of the stacktrace
Annotation: An error occurred during parsing of
'/home/jp159440/NetBeansProjects/QATools/src/org/netbeans/modules/qa/QAToolsPanel.java'. Please report a bug against
java/source and attach dump file '/home/jp159440/.netbeans/dev/var/log/QAToolsPanel_3.dump'.
Annotation: An error occurred during parsing of
'/home/jp159440/NetBeansProjects/QATools/src/org/netbeans/modules/qa/QAToolsPanel.java'. Please report a bug against
java/source and attach dump file '/home/jp159440/.netbeans/dev/var/log/QAToolsPanel_3.dump'.
An error occurred during parsing of
'/home/jp159440/NetBeansProjects/QATools/src/org/netbeans/modules/qa/QAToolsPanel.java'. Please report a bug against
java/source and attach dump file '/home/jp159440/.netbeans/dev/var/log/QAToolsPanel_3.dump'.
An error occurred during parsing of
'/home/jp159440/NetBeansProjects/QATools/src/org/netbeans/modules/qa/QAToolsPanel.java'. Please report a bug against
java/source and attach dump file '/home/jp159440/.netbeans/dev/var/log/QAToolsPanel_3.dump'.
Caused: java.lang.NullPointerException
	at com.sun.tools.javac.comp.Flow.visitMethodDef(Flow.java:677)
	at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:657)
	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
	at com.sun.tools.javac.comp.Flow.visitClassDef(Flow.java:657)
	at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:588)
Comment 1 Jiri Prox 2009-01-08 12:04:58 UTC
Created attachment 75581 [details]
file before the code was pasted
Comment 2 Jiri Prox 2009-01-08 12:05:38 UTC
Created attachment 75582 [details]
form file
Comment 3 Jiri Prox 2009-01-08 12:08:31 UTC
Created attachment 75583 [details]
dump
Comment 4 Dusan Balek 2009-01-12 10:45:02 UTC
Fixed.

changeset 3761259f344e in main/nb-javac
details: http://hg.netbeans.org/main/nb-javac?cmd=changeset;node=3761259f344e
changeset 25b51f837760 in main
details: http://hg.netbeans.org/main?cmd=changeset;node=25b51f837760
Comment 5 David Strupl 2009-01-13 08:45:19 UTC
Please note: if someone takes the new javac (s)he must include also fix for #151422 otherwise things will be broken.
Comment 6 Jiri Prox 2009-01-13 11:37:25 UTC
verified in
Product Version: NetBeans IDE Dev (Build 20090113073351)
Java: 1.6.0_11; Java HotSpot(TM) Client VM 11.0-b16
System: Linux version 2.6.24-23-generic running on i386; UTF-8; en_US (nb)
Comment 7 Quality Engineering 2009-01-14 07:45:26 UTC
Integrated into 'main-golden', will be available in build *200901140201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/25b51f837760
User: Dusan Balek <dbalek@netbeans.org>
Log: Issues #152782 and #156470 - fixed.
Comment 8 pgebauer 2009-01-15 09:58:53 UTC
As was mentioned in the third comment above, this issue have to be fixed together with the issue 151422 but IZ#151422 isn't suitable a candidate for a 
patch.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo