Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 173360 Details for
Bug 318785
DeclaratorWriter unable to write a pointer to array
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
null checks around found NPEs, to be examined
patch.txt (text/plain), 2.72 KB, created by
Tomasz Wesolowski
on 2010-07-03 17:30:18 EDT
(
hide
)
Description:
null checks around found NPEs, to be examined
Filename:
MIME Type:
Creator:
Tomasz Wesolowski
Created:
2010-07-03 17:30:18 EDT
Size:
2.72 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.core >Index: parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ASTWriterVisitor.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ASTWriterVisitor.java,v >retrieving revision 1.7 >diff -u -r1.7 ASTWriterVisitor.java >--- parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ASTWriterVisitor.java 1 Apr 2009 11:22:50 -0000 1.7 >+++ parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ASTWriterVisitor.java 3 Jul 2010 21:15:34 -0000 >@@ -235,7 +235,8 @@ > parameterDeclaration.getDeclSpecifier().accept(this); > IASTDeclarator declarator = getParameterDeclarator(parameterDeclaration); > >- if(getParameterName(declarator).toString().length() != 0){ >+ IASTName parameterName = getParameterName(declarator); >+ if(parameterName != null && parameterName.toString().length() != 0){ > scribe.printSpaces(1); > } > declarator.accept(this); >Index: parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/DeclaratorWriter.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/DeclaratorWriter.java,v >retrieving revision 1.6 >diff -u -r1.6 DeclaratorWriter.java >--- parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/DeclaratorWriter.java 17 Feb 2010 16:23:49 -0000 1.6 >+++ parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/DeclaratorWriter.java 3 Jul 2010 21:15:34 -0000 >@@ -77,7 +77,9 @@ > IASTPointerOperator[] pointOps = declarator.getPointerOperators(); > writePointerOperators(declarator, pointOps); > IASTName name = declarator.getName(); >- name.accept(visitor); >+ if (name != null) { >+ name.accept(visitor); >+ } > IASTInitializer init = getInitializer(declarator); > if(init!= null) { > init.accept(visitor); >@@ -93,7 +95,9 @@ > private void writeFunctionDeclarator(IASTStandardFunctionDeclarator funcDec) { > IASTPointerOperator[] pointOps = funcDec.getPointerOperators(); > writePointerOperators(funcDec, pointOps); >- funcDec.getName().accept(visitor); >+ if (funcDec.getName() != null) { >+ funcDec.getName().accept(visitor); >+ } > writeNestedDeclarator(funcDec); > writeParameters(funcDec); > writeInitializer(funcDec); >@@ -206,7 +210,9 @@ > IASTPointerOperator[] pointOps = arrDecl.getPointerOperators(); > writePointerOperators(arrDecl, pointOps); > IASTName name = arrDecl.getName(); >- name.accept(visitor); >+ if (name != null) { >+ name.accept(visitor); >+ } > > writeNestedDeclarator(arrDecl); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 318785
: 173360 |
173515