Community
Participate
Working Groups
I have a class like this: class Some_Class { function some_method() {} function edited_method($something) { if($something) { // <-- if is not closed } function other_method() {} } In fact the class is much larger. When saving the class, lots of errors occure and take 100% CPU for 2 minutes. THe errors all the same are: java.lang.NullPointerException at org.eclipse.php.internal.core.typeinference.PHPModelUtils.getMethodFields(PHPModelUtils.java:657) at org.eclipse.php.internal.core.codeassist.PHPSelectionEngine.getGlobalOrMethodFields(PHPSelectionEngine.java:765) at org.eclipse.php.internal.core.codeassist.PHPSelectionEngine.internalResolve(PHPSelectionEngine.java:555) at org.eclipse.php.internal.core.codeassist.PHPSelectionEngine.select(PHPSelectionEngine.java:144) at org.eclipse.dltk.internal.core.Openable.codeSelect(Openable.java:553) at org.eclipse.dltk.internal.core.AbstractSourceModule.codeSelect(AbstractSourceModule.java:85) at org.eclipse.dltk.internal.core.AbstractSourceModule.codeSelect(AbstractSourceModule.java:76) at org.eclipse.php.internal.ui.editor.highlighters.InternalClassHighlighting.isInternalClass(InternalClassHighlighting.java:60) at org.eclipse.php.internal.ui.editor.highlighters.InternalClassHighlighting.access$0(InternalClassHighlighting.java:57) at org.eclipse.php.internal.ui.editor.highlighters.InternalClassHighlighting$InternalClassApply.visit(InternalClassHighlighting.java:29) at org.eclipse.php.internal.core.ast.nodes.Identifier.accept0(Identifier.java:66) at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275) at org.eclipse.php.internal.core.ast.nodes.FunctionName.childrenAccept(FunctionName.java:74) at org.eclipse.php.internal.core.ast.nodes.FunctionName.accept0(FunctionName.java:68) at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275) at org.eclipse.php.internal.core.ast.nodes.FunctionInvocation.childrenAccept(FunctionInvocation.java:86) at org.eclipse.php.internal.core.ast.nodes.FunctionInvocation.accept0(FunctionInvocation.java:80) at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275) at org.eclipse.php.internal.core.ast.nodes.StaticMethodInvocation.childrenAccept(StaticMethodInvocation.java:82) at org.eclipse.php.internal.core.ast.nodes.StaticMethodInvocation.accept0(StaticMethodInvocation.java:75) at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275) at org.eclipse.php.internal.core.ast.nodes.Assignment.childrenAccept(Assignment.java:130) at org.eclipse.php.internal.core.ast.nodes.Assignment.accept0(Assignment.java:159) at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275) at org.eclipse.php.internal.core.ast.nodes.ExpressionStatement.childrenAccept(ExpressionStatement.java:73) at org.eclipse.php.internal.core.ast.nodes.ExpressionStatement.accept0(ExpressionStatement.java:67) at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275) at org.eclipse.php.internal.core.ast.nodes.Block.childrenAccept(Block.java:97) at org.eclipse.php.internal.core.ast.nodes.Block.accept0(Block.java:90) at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275) at org.eclipse.php.internal.core.ast.nodes.FunctionDeclaration.childrenAccept(FunctionDeclaration.java:108) at org.eclipse.php.internal.core.ast.nodes.FunctionDeclaration.accept0(FunctionDeclaration.java:97) at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275) at org.eclipse.php.internal.core.ast.nodes.MethodDeclaration.childrenAccept(MethodDeclaration.java:90) at org.eclipse.php.internal.core.ast.nodes.MethodDeclaration.accept0(MethodDeclaration.java:82) at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275) at org.eclipse.php.internal.core.ast.nodes.Block.childrenAccept(Block.java:97) at org.eclipse.php.internal.core.ast.nodes.Block.accept0(Block.java:90) at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275) at org.eclipse.php.internal.core.ast.nodes.ClassDeclaration.childrenAccept(ClassDeclaration.java:118) at org.eclipse.php.internal.core.ast.nodes.ClassDeclaration.accept0(ClassDeclaration.java:104) at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275) at org.eclipse.php.internal.core.ast.nodes.Program.childrenAccept(Program.java:191) at org.eclipse.php.internal.core.ast.nodes.Program.accept0(Program.java:184) at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275) at org.eclipse.php.internal.ui.editor.highlighter.AbstractSemanticHighlighting.consumes(AbstractSemanticHighlighting.java:93) at org.eclipse.php.internal.ui.editor.highlighter.AbstractSemanticHighlighting.consumes(AbstractSemanticHighlighting.java:102) at org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingReconciler.reconcile(SemanticHighlightingReconciler.java:116) at org.eclipse.wst.sse.ui.internal.reconcile.DocumentRegionProcessor.endProcessing(DocumentRegionProcessor.java:85) at org.eclipse.wst.sse.ui.internal.reconcile.DirtyRegionProcessor.run(DirtyRegionProcessor.java:655) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Hi Can you attach the whole file,thanks!
No, this is a proprietary code.
(In reply to comment #2) > No, this is a proprietary code. ok, so it seems like one of the highlighters crashes. The "internal classes" coloring. So for now you can turn it off. Zhao, did you turned on this rule and used Seva's simple example?
(In reply to comment #3) > (In reply to comment #2) > > No, this is a proprietary code. > > ok, so it seems like one of the highlighters crashes. The "internal classes" > coloring. So for now you can turn it off. > > Zhao, did you turned on this rule and used Seva's simple example? BTW, most of the problems I have disappear if I disable the non-default highlighters. Seems they are not tested good enough.
OK,I will try again,but I have tested highlighters more(may be still not enough) for another bug.
Hi Seva I used class Some_Class { function some_method() {} function edited_method($something) { if($something) { // <? if is not closed } function other_method() {} } to test,if there is no closed "}",the highlighters does not work,but I could not reproduce your bug when I save the file.My test file has 350 lines.
The classes I work on have lots (700-2000) of lines of non trivial code - loops, conditions, switches, array access, object method invocations, variable assignments. BTW, I'm not sure, which files are you using while testing, but my advice is to start full testing of the popular frameworks & applications source code - ZF, PEAR, Wordpress, phpBB, Drupal, Joomla, etc.
And I have all the possible highlighters enabled and all the semantic analysis options on warning or higher, if it can be relevant.
I used ZF to test long time ago,btw which pdt version do you use?
2.2.0
After consulting with QA, we need to continue the deep performance auditing to complete the fixes for these issues. Also we need others to help us out with reproduction, obviously there are performance bugs that can't be simulated very easily.
Quite old issue. Cannot reproduce.
Seva, I'm closing this. We've done a lot of performance improvements in the past years. I hope you do not have this issue anymore, but if it eventually appears again please help on reproducing.