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 146576 Details for
Bug 288698
Cannot create type hierarchy for abstract types when they have inline descendants and *.class* in project name
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
proposed patch with test
bug_288698-patch1.txt (text/plain), 5.13 KB, created by
Stephan Herrmann
on 2009-09-06 11:31:56 EDT
(
hide
)
Description:
proposed patch with test
Filename:
MIME Type:
Creator:
Stephan Herrmann
Created:
2009-09-06 11:31:56 EDT
Size:
5.13 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: workspace/TypeHierarchy/.classpath >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/workspace/TypeHierarchy/.classpath,v >retrieving revision 1.5 >diff -u -r1.5 .classpath >--- workspace/TypeHierarchy/.classpath 12 May 2004 10:54:57 -0000 1.5 >+++ workspace/TypeHierarchy/.classpath 6 Sep 2009 15:17:17 -0000 >@@ -8,5 +8,6 @@ > <classpathentry kind="lib" path="test54043.jar"/> > <classpathentry kind="lib" path="test58440.jar"/> > <classpathentry kind="lib" path="test60365.jar"/> >+ <classpathentry kind="src" path="src288698.classbug"/> > <classpathentry kind="output" path="bin"/> > </classpath> >Index: src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java,v >retrieving revision 1.93 >diff -u -r1.93 TypeHierarchyTests.java >--- src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java 27 Aug 2009 15:26:53 -0000 1.93 >+++ src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java 6 Sep 2009 15:17:17 -0000 >@@ -2404,4 +2404,21 @@ > deleteProjects(new String[] {"P"}); > } > } >+/** >+ * @bug 288698: Canât create type hierarchy for abstract types when they have inline descendants and *.class* in project name >+ * @test Ensure that ".class" as a substring of a path name is not interpreted as the ".class" suffix. >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=288698" >+ */ >+public void testBug288698() throws JavaModelException { >+ IType type = getCompilationUnit("/TypeHierarchy/src288698.classbug/p288698/AbstractBugTest.java").getType("AbstractBugTest"); >+ assertTrue("Type should exist!", type.exists()); >+ ITypeHierarchy hierarchy = type.newTypeHierarchy(null); // when bug occurred a StringIndexOutOfBoundsException was thrown here >+ assertHierarchyEquals( >+ "Focus: AbstractBugTest [in AbstractBugTest.java [in p288698 [in src288698.classbug [in TypeHierarchy]]]]\n" + >+ "Super types:\n" + >+ " Object [in Object.class [in java.lang [in "+ getExternalJCLPathString() + "]]]\n" + >+ "Sub types:\n" + >+ " <anonymous #1> [in testIt() [in BugTest2Buggy [in BugTest2Buggy.java [in p288698 [in src288698.classbug [in TypeHierarchy]]]]]]\n", >+ hierarchy); >+} > } >Index: workspace/TypeHierarchy/src288698.classbug/p288698/AbstractBugTest.java >=================================================================== >RCS file: workspace/TypeHierarchy/src288698.classbug/p288698/AbstractBugTest.java >diff -N workspace/TypeHierarchy/src288698.classbug/p288698/AbstractBugTest.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ workspace/TypeHierarchy/src288698.classbug/p288698/AbstractBugTest.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,9 @@ >+package p288698.example; >+ >+/** >+ * Abstract class >+ * >+ * @author Ivan >+ */ >+public abstract class AbstractBugTest { >+} >Index: workspace/TypeHierarchy/src288698.classbug/p288698/BugTest2Buggy.java >=================================================================== >RCS file: workspace/TypeHierarchy/src288698.classbug/p288698/BugTest2Buggy.java >diff -N workspace/TypeHierarchy/src288698.classbug/p288698/BugTest2Buggy.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ workspace/TypeHierarchy/src288698.classbug/p288698/BugTest2Buggy.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,17 @@ >+package p288698; >+ >+/** >+ * create type hierarchy for class @see AbstractBugTest >+ * You will get @see java.lang.reflect.InvocationTargetException where Root exception is: >+ * >+ * @see java.lang.StringIndexOutOfBoundsException: String index out of range: -27; method substring (), called by @see >+ * org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.java : 475 >+ * >+ * @author Ivan >+ */ >+public class BugTest2Buggy { >+ public void testIt () { >+ new AbstractBugTest() {}; >+ } >+} >+ >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java,v >retrieving revision 1.108 >diff -u -r1.108 IndexBasedHierarchyBuilder.java >--- model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java 7 Mar 2009 01:08:09 -0000 1.108 >+++ model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java 6 Sep 2009 15:17:20 -0000 >@@ -460,8 +460,8 @@ > boolean isLocalOrAnonymous = record.enclosingTypeName == IIndexConstants.ONE_ZERO; > pathRequestor.acceptPath(documentPath, isLocalOrAnonymous); > char[] typeName = record.simpleName; >- int suffix = documentPath.toLowerCase().lastIndexOf(SUFFIX_STRING_class); >- if (suffix != -1){ >+ if (documentPath.toLowerCase().endsWith(SUFFIX_STRING_class)) { >+ int suffix = documentPath.length()-SUFFIX_STRING_class.length(); > HierarchyBinaryType binaryType = (HierarchyBinaryType)binariesFromIndexMatches.get(documentPath); > if (binaryType == null){ > char[] enclosingTypeName = record.enclosingTypeName;
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:
john.arthorne
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 288698
:
146555
|
146556
| 146576 |
146585