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 39514 Details for
Bug 138507
exception in .class file editor for classes imported via plug-in import
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch and regression test
138507.txt (text/plain), 2.76 KB, created by
Jerome Lanneluc
on 2006-04-26 06:41:52 EDT
(
hide
)
Description:
Proposed patch and regression test
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2006-04-26 06:41:52 EDT
Size:
2.76 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#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.24 >diff -u -r1.24 ClassFileTests.java >--- src/org/eclipse/jdt/core/tests/model/ClassFileTests.java 19 Apr 2006 15:29:05 -0000 1.24 >+++ src/org/eclipse/jdt/core/tests/model/ClassFileTests.java 26 Apr 2006 10:28:34 -0000 >@@ -609,8 +609,8 @@ > } > > /* >- * Ensures that asking for a IClassFile in a non-Java project throws a JavaModelException >- * (regression test for bug 132494 JavaModelException opening up class file in non java project >+ * Ensures that asking for the source range of a IClassFile in a non-Java project throws a JavaModelException >+ * (regression test for bug 132494 JavaModelException opening up class file in non java project) > */ > public void testSourceRangeNonJavaProject() throws CoreException { > try { >@@ -630,6 +630,21 @@ > } > > /* >+ * Ensures that asking for the source range of a IClassFile not on the classpath of a Java project doesn't throw a JavaModelException >+ * (regression test for bug 138507 exception in .class file editor for classes imported via plug-in import) >+ */ >+public void testSourceRangeNotOnClasspath() throws CoreException { >+ try { >+ createJavaProject("P2", new String[] {"src"}, "bin"); >+ createFile("/P2/bin/X.class", ""); >+ IClassFile classX = getClassFile("/P2/bin/X.class"); >+ assertNull("Unxepected source range", classX.getSourceRange()); >+ } finally { >+ deleteProject("P2"); >+ } >+} >+ >+/* > * Ensure that opening a binary type parameter when its parent has not been open yet > * doesn't throw a JavaModelException > * (regression test for bug 101228 JME on code assist) >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/ClassFile.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFile.java,v >retrieving revision 1.123 >diff -u -r1.123 ClassFile.java >--- model/org/eclipse/jdt/internal/core/ClassFile.java 4 Apr 2006 08:49:13 -0000 1.123 >+++ model/org/eclipse/jdt/internal/core/ClassFile.java 26 Apr 2006 10:28:41 -0000 >@@ -310,6 +310,8 @@ > IBuffer buffer = openBuffer(null, info); > if (buffer != null) > return buffer; >+ if (status.getCode() == IJavaModelStatusConstants.ELEMENT_NOT_ON_CLASSPATH) >+ return null; // don't throw a JavaModelException to be able to open .class file outside the classpath (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=138507) > throw new JavaModelException((IJavaModelStatus) status); > } > }
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 138507
: 39514