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 38930 Details for
Bug 137456
NPE when trying to view a class file with attached source
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch and regression test
137456.txt (text/plain), 2.21 KB, created by
Jerome Lanneluc
on 2006-04-19 11:27:28 EDT
(
hide
)
Description:
Proposed patch and regression test
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2006-04-19 11:27:28 EDT
Size:
2.21 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/BinaryMember.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMember.java,v >retrieving revision 1.24 >diff -u -r1.24 BinaryMember.java >--- model/org/eclipse/jdt/internal/core/BinaryMember.java 13 Oct 2005 09:09:52 -0000 1.24 >+++ model/org/eclipse/jdt/internal/core/BinaryMember.java 19 Apr 2006 15:07:09 -0000 >@@ -56,8 +56,11 @@ > // ensure the class file's buffer is open so that categories are computed > ((ClassFile)getClassFile()).getBuffer(); > >- if (mapper.categories != null) >- return (String[]) mapper.categories.get(this); >+ if (mapper.categories != null) { >+ String[] categories = (String[]) mapper.categories.get(this); >+ if (categories != null) >+ return categories; >+ } > } > return CharOperation.NO_STRINGS; > } >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/ClassFileTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClassFileTests.java,v >retrieving revision 1.23 >diff -u -r1.23 ClassFileTests.java >--- src/org/eclipse/jdt/core/tests/model/ClassFileTests.java 29 Mar 2006 04:03:07 -0000 1.23 >+++ src/org/eclipse/jdt/core/tests/model/ClassFileTests.java 19 Apr 2006 15:07:11 -0000 >@@ -321,6 +321,27 @@ > } > > /* >+ * Ensure that the categories for a member that has no categories when another member defines some are correct. >+ */ >+public void testGetCategories10() throws CoreException, IOException { >+ createClassFile( >+ "package p;\n" + >+ "public class X {\n" + >+ " int field1;\n" + >+ " /**\n" + >+ " * @category test\n" + >+ " */\n" + >+ " int field2;\n" + >+ "}" >+ ); >+ String[] categories = this.classFile.getType().getField("field1").getCategories(); >+ assertStringsEqual( >+ "Unexpected categories", >+ "", >+ categories); >+} >+ >+/* > * Ensures that the children of a type for a given category are correct. > */ > public void testGetChildrenForCategory01() throws CoreException, IOException {
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 137456
: 38930