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 201206 - NullPointerException at org.netbeans.modules.editor.lib2.highlighting.CompoundAttributes.getAttribute
Summary: NullPointerException at org.netbeans.modules.editor.lib2.highlighting.Compoun...
Status: RESOLVED DUPLICATE of bug 200744
Alias: None
Product: editor
Classification: Unclassified
Component: Painting & Printing (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
: 201933 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-08-22 11:15 UTC by Vladimir Riha
Modified: 2011-09-13 12:51 UTC (History)
10 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 180720


Attachments
stacktrace (6.11 KB, text/plain)
2011-08-22 11:15 UTC, Vladimir Riha
Details
stacktrace (6.33 KB, text/plain)
2011-08-24 16:02 UTC, schkovich
Details
stacktrace (6.11 KB, text/plain)
2011-09-01 19:11 UTC, budgie67
Details
stacktrace (5.30 KB, text/plain)
2011-09-02 08:43 UTC, cpeltier
Details
stacktrace (5.64 KB, text/plain)
2011-09-02 09:02 UTC, Vladimir Riha
Details
stacktrace (4.78 KB, text/plain)
2011-09-06 12:20 UTC, Vladimir Riha
Details
stacktrace (6.13 KB, text/plain)
2011-09-08 13:17 UTC, schkovich
Details
stacktrace (6.23 KB, text/plain)
2011-09-10 15:56 UTC, mrpc
Details
stacktrace (6.20 KB, text/plain)
2011-09-13 09:24 UTC, schkovich
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2011-08-22 11:15:46 UTC
Build: NetBeans IDE Dev (Build 201108210601)
VM: Java HotSpot(TM) Client VM, 21.0-b17, Java(TM) SE Runtime Environment, 1.7.0-b147
OS: Windows XP

User Comments:
vriha: Reproducible. In PHP file, invoke cc at the place of "|". Functions like __construct() are offered, if I select one and press enter, exception is shown


<?php

/**
 * Description of classB
 *
 * @author tester
 */
class classB {
    //put your code here
    public $kocka;
    
    public function |
    public static function run() { print "Works"; }
}

?>




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.editor.lib2.highlighting.CompoundAttributes.getAttribute(CompoundAttributes.java:118)
   at org.netbeans.modules.editor.lib2.view.ViewUtils.getFont(ViewUtils.java:162)
   at org.netbeans.modules.editor.lib2.view.DocumentViewOp.createTextLayout(DocumentViewOp.java:1089)
   at org.netbeans.modules.editor.lib2.view.ParagraphViewChildren.fixSpansAndRepaint(ParagraphViewChildren.java:307)
   at org.netbeans.modules.editor.lib2.view.ParagraphViewChildren.ensureIndexMeasured(ParagraphViewChildren.java:237)
   at org.netbeans.modules.editor.lib2.view.ParagraphViewChildren.modelToViewChecked(ParagraphViewChildren.java:471)
Comment 1 Vladimir Riha 2011-08-22 11:15:50 UTC
Created attachment 110129 [details]
stacktrace
Comment 2 schkovich 2011-08-24 16:02:20 UTC
Created attachment 110185 [details]
stacktrace

selecting line of code and trying to wrap it in if statement
Comment 3 Exceptions Reporter 2011-09-01 11:05:15 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=180720
Comment 4 budgie67 2011-09-01 19:11:15 UTC
Created attachment 110323 [details]
stacktrace

auto create construct
Comment 5 cpeltier 2011-09-02 08:43:16 UTC
Created attachment 110337 [details]
stacktrace

Autocompletion on keyword "catch". Error happened on typing "enter"
Comment 6 Vladimir Riha 2011-09-02 09:02:14 UTC
Created attachment 110339 [details]
stacktrace

Cause: Formatting the code below (php file), happened to me several times


---Code start---
<?php

class Foo {

    /**
     * Some PhpDoc
     * @param string $s
     * @param int $i
     * @param float $f 
     */
    function bar($s, $i, $f) {
        sds
    ssdsd}

    function foobar() {
        $string = "";
        $int = 42;
        $s = "";
        $float = 3.1456;
    }

}

?>

--- code end---
Comment 7 Exceptions Reporter 2011-09-02 09:51:52 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=180720
Comment 8 Vladimir Riha 2011-09-06 12:20:15 UTC
Created attachment 110430 [details]
stacktrace

Reformatting php web page...
Comment 9 schkovich 2011-09-08 13:17:15 UTC
Created attachment 110531 [details]
stacktrace

code completion of endswitch
Comment 10 mrpc 2011-09-10 15:56:51 UTC
Created attachment 110606 [details]
stacktrace

While editing a php file in one big project, I noticed that when use the code completion feature, when I press enter or select by mouse the syndax I like, netbeans completes the method but I doesn't fill the parameters.

After that, I closed netbeans and opened it again to test if it would work normaly. I opened the same file and tried to complete the same method. What I got was an exception:
"A java.lang.NullPointerException exception has occurred."
Comment 11 Vladimir Riha 2011-09-13 05:57:49 UTC
*** Bug 201933 has been marked as a duplicate of this bug. ***
Comment 12 schkovich 2011-09-13 09:24:01 UTC
Created attachment 110693 [details]
stacktrace

code completion of php function var_dump()
$client->setCreatedCallback(function (GearmanClient $client) {
    var_|
});
selected from the list var_dump($client), hit enter
Comment 13 Miloslav Metelka 2011-09-13 12:51:09 UTC
Please test today's fix (once it gets into dev builds) of issue #200744 and if the problem would persist please reopen the issue. Thanks.

*** This bug has been marked as a duplicate of bug 200744 ***