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 95236 Details for
Bug 226134
CCE in SourceMethod.getDefaultValue() for constructor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix and regression test
226134.txt (text/plain), 2.37 KB, created by
Jerome Lanneluc
on 2008-04-08 13:24:21 EDT
(
hide
)
Description:
Proposed fix and regression test
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2008-04-08 13:24:21 EDT
Size:
2.37 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/SourceMethod.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethod.java,v >retrieving revision 1.65 >diff -u -r1.65 SourceMethod.java >--- model/org/eclipse/jdt/internal/core/SourceMethod.java 22 Nov 2007 11:51:58 -0000 1.65 >+++ model/org/eclipse/jdt/internal/core/SourceMethod.java 8 Apr 2008 17:20:50 -0000 >@@ -51,7 +51,7 @@ > return super.equals(o) && Util.equalArraysOrNull(this.parameterTypes, ((SourceMethod)o).parameterTypes); > } > public IMemberValuePair getDefaultValue() throws JavaModelException { >- SourceMethodInfo sourceMethodInfo = (SourceMethodInfo) getElementInfo(); >+ SourceMethodElementInfo sourceMethodInfo = (SourceMethodElementInfo) getElementInfo(); > if (sourceMethodInfo.isAnnotationMethod()) { > return ((SourceAnnotationMethodInfo) sourceMethodInfo).defaultValue; > } >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/CompilationUnitTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompilationUnitTests.java,v >retrieving revision 1.63 >diff -u -r1.63 CompilationUnitTests.java >--- src/org/eclipse/jdt/core/tests/model/CompilationUnitTests.java 5 Apr 2008 08:45:19 -0000 1.63 >+++ src/org/eclipse/jdt/core/tests/model/CompilationUnitTests.java 8 Apr 2008 17:20:54 -0000 >@@ -261,6 +261,27 @@ > } > > /* >+ * Ensures that the default value for a constructor doesn't throw a ClassCastException >+ * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=226134 ) >+ */ >+public void testDefaultValue6() throws CoreException { >+ try { >+ String cuSource = >+ "package p;\n" + >+ "public class Y {\n" + >+ " public Y() {}\n" + >+ "}"; >+ createFile("/P/src/p/Y.java", cuSource); >+ IMethod method = getCompilationUnit("/P/src/p/Y.java").getType("Y").getMethod("Y", new String[0]); >+ assertMemberValuePairEquals( >+ "<null>", >+ method.getDefaultValue()); >+ } finally { >+ deleteFile("/P/src/p/Y.java"); >+ } >+} >+ >+/* > * Ensure that the deprecated flag is correctly reported > * (regression test fo bug 23207 Flags.isDeprecated(IMethod.getFlags()) doesn't work) > */
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 226134
: 95236