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 113574 Details for
Bug 248680
Error when create a new element (class, interface,...)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix and regression test
248680.txt (text/plain), 3.70 KB, created by
Jerome Lanneluc
on 2008-09-26 05:41:27 EDT
(
hide
)
Description:
Proposed fix and regression test
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2008-09-26 05:41:27 EDT
Size:
3.70 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/TestCompilationParticipant.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TestCompilationParticipant.java,v >retrieving revision 1.2 >diff -u -r1.2 TestCompilationParticipant.java >--- src/org/eclipse/jdt/core/tests/model/TestCompilationParticipant.java 27 Jun 2008 16:02:39 -0000 1.2 >+++ src/org/eclipse/jdt/core/tests/model/TestCompilationParticipant.java 26 Sep 2008 09:40:47 -0000 >@@ -17,7 +17,13 @@ > public class TestCompilationParticipant extends CompilationParticipant { > > public static CompilationParticipant PARTICIPANT; >+ public static boolean failToInstantiate = false; > >+ public TestCompilationParticipant() { >+ if (failToInstantiate) >+ throw new RuntimeException(); >+ } >+ > public boolean isActive(IJavaProject project) { > return PARTICIPANT != null && PARTICIPANT.isActive(project); > } >Index: src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java,v >retrieving revision 1.140 >diff -u -r1.140 ReconcilerTests.java >--- src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java 9 Sep 2008 16:42:52 -0000 1.140 >+++ src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java 26 Sep 2008 09:40:47 -0000 >@@ -3070,6 +3070,38 @@ > } > > /* >+ * Ensures that a misbehaving reconcile participant doesn't interfere with a reconcile operation >+ * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=248680 ) >+ */ >+public void testReconcileParticipant12() throws CoreException { >+ try { >+ TestCompilationParticipant.failToInstantiate = true; >+ simulateExitRestart(); >+ this.workingCopy = getCompilationUnit("Reconciler/src/p1/X.java").getWorkingCopy(this.wcOwner, null); >+ setWorkingCopyContents( >+ "package p1;\n" + >+ "import p2.*;\n" + >+ "public class X {\n" + >+ " public void bar() {\n" + >+ " System.out.println()\n" + >+ " }\n" + >+ "}" >+ ); >+ startDeltas(); >+ this.workingCopy.reconcile(ICompilationUnit.NO_AST, false, null, null); >+ assertWorkingCopyDeltas( >+ "Unexpected participant delta", >+ "X[*]: {CHILDREN | FINE GRAINED}\n" + >+ " bar()[+]: {}\n" + >+ " foo()[-]: {}" >+ ); >+ } finally { >+ stopDeltas(); >+ TestCompilationParticipant.failToInstantiate = false; >+ } >+} >+ >+ /* > * Ensures that errors are fixed if renaming the .classpath file causes the missing type to be visible. > * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=207890) > */ >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/JavaModelManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java,v >retrieving revision 1.411 >diff -u -r1.411 JavaModelManager.java >--- model/org/eclipse/jdt/internal/core/JavaModelManager.java 12 Sep 2008 15:42:59 -0000 1.411 >+++ model/org/eclipse/jdt/internal/core/JavaModelManager.java 26 Sep 2008 09:40:48 -0000 >@@ -268,8 +268,8 @@ > } > }); > } >- CompilationParticipant participant = (CompilationParticipant) participants[i]; >- if (participant != null && participant.isActive(project)) >+ CompilationParticipant participant; >+ if ((participants[i] instanceof CompilationParticipant) && (participant = (CompilationParticipant) participants[i]).isActive(project)) > result[index++] = participant; > } > if (index == 0)
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 248680
:
113551
|
113552
|
113553
| 113574