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 73782 Details for
Bug 196335
[Schema][Editors] Element with no name causes NPEs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch
patch196335.txt (text/plain), 4.35 KB, created by
Adam Archer
on 2007-07-13 19:02:00 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Adam Archer
Created:
2007-07-13 19:02:00 EDT
Size:
4.35 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.core >Index: src/org/eclipse/pde/internal/core/schema/Schema.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/Schema.java,v >retrieving revision 1.66 >diff -u -r1.66 Schema.java >--- src/org/eclipse/pde/internal/core/schema/Schema.java 10 Jul 2007 14:17:51 -0000 1.66 >+++ src/org/eclipse/pde/internal/core/schema/Schema.java 13 Jul 2007 22:39:17 -0000 >@@ -399,6 +399,8 @@ > private ISchemaAttribute processAttribute(ISchemaElement element, > Node elementNode) { > String aname = getAttribute(elementNode, "name"); //$NON-NLS-1$ >+ if (aname == null) >+ return null; > String atype = getAttribute(elementNode, "type"); //$NON-NLS-1$ > String ause = getAttribute(elementNode, "use"); //$NON-NLS-1$ > String avalue = getAttribute(elementNode, "value"); //$NON-NLS-1$ >@@ -611,6 +613,8 @@ > > private ISchemaElement processElement(ISchemaObject parent, Node elementNode) { > String aname = getAttribute(elementNode, "name"); //$NON-NLS-1$ >+ if (aname == null) >+ return null; > String atype = getAttribute(elementNode, "type"); //$NON-NLS-1$ > String aref = getAttribute(elementNode, "ref"); //$NON-NLS-1$ > >@@ -921,6 +925,16 @@ > String nodeName = child.getNodeName().toLowerCase(Locale.ENGLISH); > if (nodeName.equals("element")) { //$NON-NLS-1$ > ISchemaElement element = processElement(this, child); >+ if (element == null) { >+ fValid = false; >+ return; >+ } >+ ISchemaAttribute[] attributes = element.getAttributes(); >+ for (int j = 0; j < attributes.length; j++) >+ if (attributes[j] == null) { >+ fValid = false; >+ return; >+ } > fElements.addElement(element); > } else if (nodeName.equals("annotation")) { //$NON-NLS-1$ > processSchemaAnnotation(child); >#P org.eclipse.pde.ui >Index: src/org/eclipse/pde/internal/ui/editor/schema/SchemaAttributeDetails.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaAttributeDetails.java,v >retrieving revision 1.29 >diff -u -r1.29 SchemaAttributeDetails.java >--- src/org/eclipse/pde/internal/ui/editor/schema/SchemaAttributeDetails.java 11 Jul 2007 21:17:42 -0000 1.29 >+++ src/org/eclipse/pde/internal/ui/editor/schema/SchemaAttributeDetails.java 13 Jul 2007 22:39:19 -0000 >@@ -309,8 +309,12 @@ > public void textValueChanged(FormEntry entry) { > if (blockListeners()) > return; >- fAttribute.setName(fName.getValue()); >- setDecription(NLS.bind(PDEUIMessages.SchemaAttributeDetails_description, fAttribute.getName())); >+ if (fName.getValue().length() != 0) { >+ fAttribute.setName(fName.getValue()); >+ setDecription(NLS.bind(PDEUIMessages.SchemaAttributeDetails_description, fAttribute.getName())); >+ } else { >+ fName.setValue(fAttribute.getName(), true); >+ } > } > }); > fDepTrue.addSelectionListener(new SelectionAdapter() { >Index: src/org/eclipse/pde/internal/ui/editor/schema/SchemaElementDetails.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaElementDetails.java,v >retrieving revision 1.22 >diff -u -r1.22 SchemaElementDetails.java >--- src/org/eclipse/pde/internal/ui/editor/schema/SchemaElementDetails.java 12 Jul 2007 22:11:18 -0000 1.22 >+++ src/org/eclipse/pde/internal/ui/editor/schema/SchemaElementDetails.java 13 Jul 2007 22:39:19 -0000 >@@ -145,9 +145,13 @@ > public void textValueChanged(FormEntry entry) { > if (blockListeners()) > return; >- fElement.setName(fName.getValue()); >- ((Schema)fElement.getSchema()).updateReferencesFor(fElement, ISchema.REFRESH_RENAME); >- setDecription(NLS.bind(PDEUIMessages.SchemaElementDetails_description, fElement.getName())); >+ if (fName.getValue().length() != 0) { >+ fElement.setName(fName.getValue()); >+ ((Schema)fElement.getSchema()).updateReferencesFor(fElement, ISchema.REFRESH_RENAME); >+ setDecription(NLS.bind(PDEUIMessages.SchemaElementDetails_description, fElement.getName())); >+ } else { >+ fName.setValue(fElement.getName(),true); >+ } > } > }); > fDepTrue.addSelectionListener(new SelectionAdapter() {
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
Flags:
mike.pawlowski
:
review+
Actions:
View
|
Diff
Attachments on
bug 196335
: 73782 |
73889