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 124707 - PHP support unusable due to exceptions from Schlieman
Summary: PHP support unusable due to exceptions from Schlieman
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Alexei Mokeev
URL:
Keywords:
: 125205 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-01-04 14:30 UTC by Tomasz Slota
Modified: 2008-01-18 16:35 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Full IDE log (106.37 KB, text/plain)
2008-01-04 14:31 UTC, Tomasz Slota
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Slota 2008-01-04 14:30:34 UTC
Running today's build against empty user dir. Note that PHP support is now a part of the full build.

1) IAE is thrown from Schlieman parser upon NB startup:

java.lang.IllegalArgumentException
	at org.netbeans.modules.languages.parser.DG.addNode(DG.java:108)
	at org.netbeans.modules.languages.parser.DGUtils.merge(DGUtils.java:137)
	at org.netbeans.modules.languages.parser.DGUtils.merge(DGUtils.java:189)
	at org.netbeans.modules.languages.parser.DGUtils.merge(DGUtils.java:189)
	at org.netbeans.modules.languages.parser.DGUtils.merge(DGUtils.java:189)
	at org.netbeans.modules.languages.parser.DGUtils.append(DGUtils.java:99)
	at org.netbeans.modules.languages.parser.Pattern.append(Pattern.java:532)
	at org.netbeans.modules.languages.parser.Pattern.createIn(Pattern.java:220)
	at org.netbeans.modules.languages.parser.Pattern.createIn(Pattern.java:222)
	at org.netbeans.modules.languages.parser.Pattern.createIn(Pattern.java:222)
	at org.netbeans.modules.languages.parser.Pattern.create(Pattern.java:74)
	at org.netbeans.modules.languages.NBSLanguageReader.readPattern(NBSLanguageReader.java:758)
	at org.netbeans.modules.languages.NBSLanguageReader.readToken(NBSLanguageReader.java:269)
	at org.netbeans.modules.languages.NBSLanguageReader.readBody(NBSLanguageReader.java:228)
	at org.netbeans.modules.languages.NBSLanguageReader.readNBS(NBSLanguageReader.java:214)
	at org.netbeans.modules.languages.NBSLanguageReader.getTokenTypes(NBSLanguageReader.java:140)
	at org.netbeans.modules.languages.LanguageImpl.read(LanguageImpl.java:263)
	at org.netbeans.modules.languages.LanguagesManager$2.run(LanguagesManager.java:144)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)

2) Attempt to create a PHP project results in a loop of exceptions: 

Caused: java.lang.RuntimeException: Language for mime-type text/x-pure-php5 is not found
       at org.netbeans.modules.php.lexer.PhpTokenId.getPurePhpLanguage(PhpTokenId.java:173)
       at org.netbeans.modules.php.lexer.PhpTokenId.getPhpLanguage(PhpTokenId.java:97)
       at org.netbeans.modules.php.model.impl.PhpModelImpl.doSync(PhpModelImpl.java:277)
       at org.netbeans.modules.php.model.impl.PhpModelImpl.access$100(PhpModelImpl.java:83)
       at org.netbeans.modules.php.model.impl.PhpModelImpl$1.run(PhpModelImpl.java:161)
       at org.netbeans.editor.BaseDocument.render(BaseDocument.java:1206)
       at org.netbeans.modules.php.model.impl.PhpModelImpl.sync(PhpModelImpl.java:159)
       at org.netbeans.modules.languages.php.PhpParser.parseFiles(PhpParser.java:142)
       at org.netbeans.napi.gsfret.source.Source.moveToPhase(Source.java:880)
[catch] at org.netbeans.napi.gsfret.source.Source$CompilationJob.run(Source.java:1192)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
       at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
       at java.util.concurrent.FutureTask.run(FutureTask.java:123)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
       at java.lang.Thread.run(Thread.java:613)

The problem might be as well located in the PHP nbs file but it looks like there hasn't been any changes lately.
Comment 1 Tomasz Slota 2008-01-04 14:31:46 UTC
Created attachment 54690 [details]
Full IDE log
Comment 2 Tomasz Slota 2008-01-14 11:01:27 UTC
Still reproducible in today's build, however there is a new message: 

Editors/text/x-pure-php5/langauge.nbs: Can not resolve first set for UnaryExpression. Conflicting input: "&" "new" <php_variable_variable>. 

It hints that the problem could be possibly solved/worked around by amending the nbs file.
Comment 3 Tomasz Slota 2008-01-14 15:20:27 UTC
Thank you Dane for volunteering to take over this issue :-)
Comment 4 Tomasz Slota 2008-01-14 15:27:53 UTC
According to ppisl the problem appeared between Jan 2nd and 3rd (the daily build for the 2nd is OK, the one from the 3rd has the problem)
Comment 5 Andrew Korostelev 2008-01-14 15:42:25 UTC
*** Issue 125205 has been marked as a duplicate of this issue. ***
Comment 6 Jan Jancura 2008-01-14 17:33:59 UTC
There is probably some conflict in PHP gramar. Thats why the parser is not able to initialize. So I am changing conflict
detection as a first part of fix of this issue:
IDE: [1/14/08 6:29 PM] Committing "First.java" started
Checking in First.java;
/cvs/languages/engine/src/org/netbeans/modules/languages/parser/First.java,v  <--  First.java
new revision: 1.5; previous revision: 1.4
done
IDE: [1/14/08 6:29 PM] Committing "First.java" finished
Comment 7 Jan Jancura 2008-01-14 17:43:14 UTC
Second part of this issue should be fixed in PHPTokenId class. Method getPurePhpLanguage () contains some code waiting
on initialization of "text/x-pure-php5" language. This code is not correct. Fix it, please.
Comment 8 Daniel Prusa 2008-01-15 15:54:08 UTC
Here are productions (from purePHP5.nbs) causing the conflict:

NewExpression = [ "&" ] "new" <php_identifier> [ Arguments ];
UnaryExpression = LeftHandSideExpression | ( UnaryOperator UnaryExpression );
UnaryOperator = "&" | "!" | "~" | "-" | "++" | "--" | "@" | <php_type_cast>;
LeftHandSideExpression = CallExpression | NewExpression | BuiltInCallExpression |
        LanguageConstructExpression | ArrayExpression | ListExpression;

When there is
       & new identifier
in a php source file, it can be parsed as NewExpression (& new identifier) but also as UnaryOperator (&) followed by
NewExpression (new identifier).

To fix this, it is sufficient to modify the production for NewExpression as follows

NewExpression = "new" <php_identifier> [ Arguments ];

i.e., to remove [ "&" ]
Comment 9 Denis Anisimov 2008-01-15 16:10:19 UTC
You are right !
Thank you for catching this.

This concerns to message "Conflicting input: "&" "new" <php_variable_variable>. "
So it solves the problem.

To Jan Jancura:
About this statement:
>Second part of this issue should be fixed in PHPTokenId class. Method getPurePhpLanguage () contains some code waiting
>on initialization of "text/x-pure-php5" language. This code is not correct. Fix it, please.

Please note that currently all works fine.
You say that code is incorrect. Please point where is error in this code EXACTLY .
And please provide CORRECT code . Because correctness/incorrectness could be identified against
some rules. But there is not such rules publicly available. It seems you are the only 
person who knows these rules.
Comment 10 Petr Pisl 2008-01-18 16:35:24 UTC
I fixed the problem with the tests and I think this issue can be closed now.