Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 325709

Summary: NamespaceName node should contain the name child property
Product: z_Archived Reporter: Q.S. Wang <qiangsheng.w>
Component: PDTAssignee: PHP Core <php.core-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ganoro, zhaozhongwei
Version: unspecifiedFlags: ganoro: review+
zhaozhongwei: review+
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
new patch none

Description Q.S. Wang CLA 2010-09-20 00:55:40 EDT
The org.eclipse.php.internal.core.ast.nodes.NamespaceName extends from Identifier and should add the NAME_PROPERTY to it's property descriptors list. The lacking of the NAME_PROPERTY causes problems. One example is as below:


Caused by: java.lang.IllegalArgumentException: NamespaceName has no property name
at org.eclipse.php.internal.core.ast.rewrite.RewriteEventStore.validateHasChildProperty(RewriteEventStore.java:938)
at org.eclipse.php.internal.core.ast.rewrite.RewriteEventStore.getEvent(RewriteEventStore.java:407)
at org.eclipse.php.internal.core.ast.rewrite.RewriteEventStore.getNodeEvent(RewriteEventStore.java:430)
at org.eclipse.php.internal.core.ast.nodes.InternalASTRewrite.getNodeEvent(InternalASTRewriter.java:216)
at org.eclipse.php.internal.core.ast.nodes.InternalASTRewrite.preValueChangeEvent(InternalASTRewriter.java:120)
at org.eclipse.php.internal.core.ast.nodes.AST.preValueChangeEvent(AST.java:565)
at org.eclipse.php.internal.core.ast.nodes.ASTNode.preValueChange(ASTNode.java:933)
at org.eclipse.php.internal.core.ast.nodes.Identifier.setName(Identifier.java:153)
at org.eclipse.php.internal.core.ast.nodes.Identifier.<init>(Identifier.java:58)
at org.eclipse.php.internal.core.ast.nodes.NamespaceName.<init>(NamespaceName.java:82)
at org.eclipse.php.internal.core.ast.nodes.NamespaceName.clone0(NamespaceName.java:209)
at org.eclipse.php.internal.core.ast.nodes.ASTNode.clone(ASTNode.java:1270)
at org.eclipse.php.internal.core.ast.nodes.ASTNode.copySubtree(ASTNode.java:1224)
at com.zend.php.ui.core.util.CodeGenerationUtils.createImplementationStub(CodeGenerationUtils.java:897)
at com.zend.php.ui.actions.sourceActions.AddUnimplementedMethodsOperation.run(AddUnimplementedMethodsOperation.java:220)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
at org.eclipse.php.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:91)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
... 48 more
Root exception:
java.lang.IllegalArgumentException: NamespaceName has no property name
at org.eclipse.php.internal.core.ast.rewrite.RewriteEventStore.validateHasChildProperty(RewriteEventStore.java:938)
at org.eclipse.php.internal.core.ast.rewrite.RewriteEventStore.getEvent(RewriteEventStore.java:407)
at org.eclipse.php.internal.core.ast.rewrite.RewriteEventStore.getNodeEvent(RewriteEventStore.java:430)
at org.eclipse.php.internal.core.ast.nodes.InternalASTRewrite.getNodeEvent(InternalASTRewriter.java:216)
at org.eclipse.php.internal.core.ast.nodes.InternalASTRewrite.preValueChangeEvent(InternalASTRewriter.java:120)
at org.eclipse.php.internal.core.ast.nodes.AST.preValueChangeEvent(AST.java:565)
at org.eclipse.php.internal.core.ast.nodes.ASTNode.preValueChange(ASTNode.java:933)
at org.eclipse.php.internal.core.ast.nodes.Identifier.setName(Identifier.java:153)
at org.eclipse.php.internal.core.ast.nodes.Identifier.<init>(Identifier.java:58)
at org.eclipse.php.internal.core.ast.nodes.NamespaceName.<init>(NamespaceName.java:82)
at org.eclipse.php.internal.core.ast.nodes.NamespaceName.clone0(NamespaceName.java:209)
at org.eclipse.php.internal.core.ast.nodes.ASTNode.clone(ASTNode.java:1270)
at org.eclipse.php.internal.core.ast.nodes.ASTNode.copySubtree(ASTNode.java:1224)
at
Comment 1 Q.S. Wang CLA 2010-09-20 04:14:17 EDT
Created attachment 179226 [details]
new patch
Comment 2 Roy Ganor CLA 2010-09-20 06:08:49 EDT
+1 (it seems like most of the patch is formatting related, my suggestion is to have two different patches one for formatter and one the real fix)

thanks
Comment 3 Q.S. Wang CLA 2010-09-20 20:19:43 EDT
fixed
Comment 4 Q.S. Wang CLA 2010-09-20 20:19:56 EDT
Closing