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 15601 Details for
Bug 76780
[model] return type not recognized correctly on some generic methods
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed regression test
org.eclipse.jdt.core.tests.model_patch.txt (text/plain), 4.38 KB, created by
Jerome Lanneluc
on 2004-11-03 09:25:33 EST
(
hide
)
Description:
Proposed regression test
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2004-11-03 09:25:33 EST
Size:
4.38 KB
patch
obsolete
>Index: src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java,v >retrieving revision 1.99 >diff -u -r1.99 AbstractJavaModelTests.java >--- src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java 2 Nov 2004 11:40:57 -0000 1.99 >+++ src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java 3 Nov 2004 14:10:08 -0000 >@@ -1258,7 +1258,10 @@ > } > } > : null; >- ICompilationUnit workingCopy = getCompilationUnit(path).getWorkingCopy(new WorkingCopyOwner() {}, problemRequestor, null/*no progress monitor*/); >+ return getWorkingCopy(path, source, new WorkingCopyOwner() {}, problemRequestor); >+ } >+ public ICompilationUnit getWorkingCopy(String path, String source, WorkingCopyOwner owner, IProblemRequestor problemRequestor) throws JavaModelException { >+ ICompilationUnit workingCopy = getCompilationUnit(path).getWorkingCopy(owner, problemRequestor, null/*no progress monitor*/); > workingCopy.getBuffer().setContents(source); > workingCopy.makeConsistent(null/*no progress monitor*/); > return workingCopy; >Index: src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java,v >retrieving revision 1.47 >diff -u -r1.47 ReconcilerTests.java >--- src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java 26 Oct 2004 15:13:53 -0000 1.47 >+++ src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java 3 Nov 2004 14:10:09 -0000 >@@ -1521,6 +1521,48 @@ > assertEquals("We should have one comment!", 1, testCU.getCommentList().size()); > } > /* >+ * Ensures that a method that has a type parameter with bound can be overriden in another working copy. >+ * (regression test for bug 76780 [model] return type not recognized correctly on some generic methods) >+ */ >+public void testTypeParameterWithBound() throws CoreException { >+ this.workingCopy.discardWorkingCopy(); // don't use the one created in setUp() >+ this.workingCopy = null; >+ WorkingCopyOwner owner = new WorkingCopyOwner() {}; >+ ICompilationUnit workingCopy1 = null; >+ try { >+ workingCopy1 = getWorkingCopy( >+ "/Reconciler15/src/test/I.java", >+ "package test;\n"+ >+ "public interface I {\n"+ >+ " <T extends I> void foo(T t);\n"+ >+ "}\n", >+ owner, >+ null /*no problem requestor*/ >+ ); >+ >+ this.problemRequestor = new ProblemRequestor(); >+ this.workingCopy = getWorkingCopy("Reconciler15/src/test/X.java", "", owner, this.problemRequestor); >+ setWorkingCopyContents( >+ "package test;\n"+ >+ "public class X implements I {\n"+ >+ " public <T extends I> void foo(T t) {\n"+ >+ " }\n"+ >+ "}\n" >+ ); >+ this.workingCopy.reconcile(ICompilationUnit.NO_AST, false, owner, null); >+ >+ assertProblems( >+ "Unexpected problems", >+ "----------\n" + >+ "----------\n" >+ ); >+ } finally { >+ if (workingCopy1 != null) { >+ workingCopy1.discardWorkingCopy(); >+ } >+ } >+} >+/* > * Ensures that a varargs method can be referenced from another working copy. > */ > public void testVarargs() throws CoreException { >@@ -1529,18 +1571,18 @@ > WorkingCopyOwner owner = new WorkingCopyOwner() {}; > ICompilationUnit workingCopy1 = null; > try { >- workingCopy1 = getCompilationUnit("/Reconciler15/src/test/X.java").getWorkingCopy(owner, null, null); >- createFolder("/Reconciler15/src/test"); >- workingCopy1.getBuffer().setContents( >+ workingCopy1 = getWorkingCopy( >+ "/Reconciler15/src/test/X.java", > "package test;\n"+ > "public class X {\n"+ > " void bar(String ... args) {}\n"+ >- "}\n" >+ "}\n", >+ owner, >+ null /*no problem requestor*/ > ); >- workingCopy1.makeConsistent(null); > > this.problemRequestor = new ProblemRequestor(); >- this.workingCopy = getCompilationUnit("Reconciler15/src/test/Y.java").getWorkingCopy(owner, this.problemRequestor, null); >+ this.workingCopy = getWorkingCopy("Reconciler15/src/test/Y.java", "", owner, this.problemRequestor); > setWorkingCopyContents( > "package test;\n"+ > "public class Y {\n"+ >@@ -1561,7 +1603,6 @@ > if (workingCopy1 != null) { > workingCopy1.discardWorkingCopy(); > } >- deleteFolder("/Reconciler15/src/test"); > } > } >
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 76780
:
15600
| 15601