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 194340 - AssertionError: The same token (index: 21962 - PHP_CLOSETAG) was precessed before. Please report this to help fix issue 188809. <?php /* =============================================================
Summary: AssertionError: The same token (index: 21962 - PHP_CLOSETAG) was precessed b...
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-14 09:05 UTC by paolosca
Modified: 2011-06-08 14:10 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 175849


Attachments
stacktrace (8.78 KB, text/plain)
2011-01-14 09:05 UTC, paolosca
Details
stacktrace (10.28 KB, text/plain)
2011-03-05 08:16 UTC, paolosca
Details

Note You need to log in before you can comment on or make changes to this bug.
Description paolosca 2011-01-14 09:05:43 UTC
Build: NetBeans IDE Dev (Build nbms-and-javadoc-6303-on-101210)
VM: Java HotSpot(TM) Client VM, 17.1-b03, Java(TM) SE Runtime Environment, 1.6.0_22-b04
OS: Linux

User Comments:
paolosca: Editing a php file, typed "pg_esc" + ctrl+space to open the autocomplete popup. The popup opened, i pressed down a couple of times to select pg_escape_string(). when I pressed enter to insewrt the code the error popped up.




Stacktrace: 
java.lang.AssertionError: The same token (index: 21962 - PHP_CLOSETAG)  was precessed before.
Please report this to help fix issue 188809.

<?php
/* ===================================================================
 * cnordicl.php
 * Copyright (c) 2000-2010 Mediasoft snc
 *
 * Header:          Impegno materiale
 * Menu:            Magazzino
 * Archives:        cnmagaru, cnmagart
 * Description:     Browse archive.
 * ===================================================================
 * 
 * 1.0.0.0  del 14.01.2011 Caricata nuova versione
 */

// ======================================== IMPOSTAZIONI GENERICHE ===
// ===================================================================
error_reporting(E_ALL);
include("uticon.php");

$archivio = "cnmagaru";
$bint = "";
$saveerr = false;
if (!isset($label)) $label = "";
if ($azione == "") $azione = "B";
if (!isset($oldtfind)) $oldtfind = 0;

// =================================================== SAVE ==========
// =================================================
   at org.netbeans.modules.php.editor.indent.FormatVisitor.showAssertionFor188809(FormatVisitor.java:1048)
   at org.netbeans.modules.php.editor.indent.FormatVisitor.addFormatToken(FormatVisitor.java:1059)
   at org.netbeans.modules.php.editor.indent.FormatVisitor.visit(FormatVisitor.java:230)
   at org.netbeans.modules.php.editor.parser.astnodes.ArrayCreation.accept(ArrayCreation.java:84)
   at org.netbeans.modules.php.editor.parser.astnodes.visitors.DefaultVisitor.scan(DefaultVisitor.java:54)
   at org.netbeans.modules.php.editor.indent.FormatVisitor.scan(FormatVisitor.java:188)
Comment 1 paolosca 2011-01-14 09:05:48 UTC
Created attachment 104987 [details]
stacktrace
Comment 2 OndrejBrejla 2011-02-21 10:46:01 UTC
I can't reproduce it.
Comment 3 paolosca 2011-03-05 08:16:24 UTC
Created attachment 106737 [details]
stacktrace

I found a way to reproduce the bug every time, it seems it's triggered only when the code of the edited file contains errors.
Steps to reproduce:
- edit a php file;
- add a error somewhere in the code (i.e. open a { without closing it);
. place the caret a few lines before the error and type "fore" (without quotes);
- wait for the code completion to popup or open it with ctrl+space;
- select one of the code templates clicking on it or pressing enter;
- The error pops up.

No error is triggered if the edited code contains no errors.
Comment 4 paolosca 2011-04-04 18:08:15 UTC
Seems fixed in latest dev builds, I can't replicate the problem.
If you have no objections I would close the bug.
Comment 5 Tomas Mysik 2011-06-08 14:10:09 UTC
Closing as suggested by reporter.

Thanks.