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.
Build: NetBeans IDE 7.2 (Build 201207301726) VM: Java HotSpot(TM) Client VM, 20.1-b02, Java(TM) SE Runtime Environment, 1.6.0_26-b03 OS: Linux User Comments: GUEST: Called Format Text from Source menu. gahgneh: typed inside function { {cursor here} } a code template gahgneh: auto-complete is randomly broken, the exception happens either on code-template or code completion GUEST: PHP????"??? > ??"????????????????????? Stacktrace: java.lang.NullPointerException at org.netbeans.modules.php.editor.indent.TokenFormatter$1.countWhiteSpaceBeforeLeftBrace(TokenFormatter.java:1445) at org.netbeans.modules.php.editor.indent.TokenFormatter$1.run(TokenFormatter.java:484) at org.netbeans.editor.GuardedDocument.runAtomic(GuardedDocument.java:317) at org.netbeans.modules.php.editor.indent.TokenFormatter.reformat(TokenFormatter.java:344) at org.netbeans.modules.php.editor.indent.PHPFormatter.reformat(PHPFormatter.java:96) at org.netbeans.modules.csl.core.GsfReformatTask$1.run(GsfReformatTask.java:105)
Created attachment 122918 [details] stacktrace
Reproducible.
Reproducible use case: Set Tools -> Options -> Editor -> Formatting -> PHP -> Braces -> "try catch" to "Preserve existing" <?php function b() { try{ // here invoke "fnc" code template }catch (Exception $exc) {echo $exc->getTraceAsString();} } ?>
Fixed in web-main #4ea97e5b4547 Vlado, please, verify it for 7.2 patch 1. Thanks.
Integrated into 'main-golden', will be available in build *201208100001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/4ea97e5b4547 User: Ondrej Brejla <obrejla@netbeans.org> Log: #216585 - NullPointerException at org.netbeans.modules.php.editor.indent.TokenFormatter$1.countWhiteSpaceBeforeLeftBrace
verified in trunk Product Version: NetBeans IDE Dev (Build 201208100001) Java: 1.7.0_06; Java HotSpot(TM) Client VM 23.2-b09 System: Linux version 3.0.0-23-generic-pae running on i386; UTF-8; en_US (nb)
Integrated into releases #c1f31bc03c31
Integrated into 'releases', will be available in build *201209010822* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/c1f31bc03c31 User: Ondrej Brejla <obrejla@netbeans.org> Log: #216585 - NullPointerException at org.netbeans.modules.php.editor.indent.TokenFormatter$1.countWhiteSpaceBeforeLeftBrace (transplanted from 4ea97e5b4547e92f6386bfd717e03a644972b6a8)
verified in patch Product Version: NetBeans IDE 7.2 (Build 201207171143) Java: 1.7.0_06; Java HotSpot(TM) Client VM 23.2-b09 System: Linux version 3.2.0-29-generic-pae running on i386; UTF-8; en_US (nb)