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 21264 Details for
Bug 95580
CreateField on IType doesn't work if the type is an enum type that has enum constants
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Apply on HEAD of org.eclipse.jdt.core.tests.model
patch_95580_tests.txt (text/plain), 3.55 KB, created by
Olivier Thomann
on 2005-05-17 11:36:00 EDT
(
hide
)
Description:
Apply on HEAD of org.eclipse.jdt.core.tests.model
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2005-05-17 11:36:00 EDT
Size:
3.55 KB
patch
obsolete
>Index: src/org/eclipse/jdt/core/tests/model/CreateMembersTests.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CreateMembersTests.java,v >retrieving revision 1.10 >diff -u -r1.10 CreateMembersTests.java >--- src/org/eclipse/jdt/core/tests/model/CreateMembersTests.java 3 May 2005 14:08:59 -0000 1.10 >+++ src/org/eclipse/jdt/core/tests/model/CreateMembersTests.java 17 May 2005 15:35:02 -0000 >@@ -34,7 +34,7 @@ > // Names of tests to run: can be "testBugXXXX" or "BugXXXX") > // TESTS_PREFIX = "testCombineAccessRestrictions"; > // TESTS_NAMES = new String[] {"test004"}; >-// TESTS_NUMBERS = new int[] { 23, 28, 38 }; >+// TESTS_NUMBERS = new int[] { 5, 6 }; > // TESTS_RANGE = new int[] { 21, 38 }; > } > public static Test suite() { >@@ -148,5 +148,54 @@ > JavaCore.setOptions(oldOptions); > } > } >- >+ >+ public void test005() throws JavaModelException { >+ Hashtable oldOptions = JavaCore.getOptions(); >+ try { >+ Hashtable options = new Hashtable(oldOptions); >+ options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5); >+ options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5); >+ JavaCore.setOptions(options); >+ ICompilationUnit compilationUnit = getCompilationUnit("CreateMembers", "src", "", "E2.java"); >+ assertNotNull("No compilation unit", compilationUnit); >+ IType[] types = compilationUnit.getTypes(); >+ assertNotNull("No types", types); >+ assertEquals("Wrong size", 1, types.length); >+ IType type = types[0]; >+ type.createField("int i;", null, true, null); >+ String expectedSource = >+ "public enum E2 {\n" + >+ " A, B, C;\n\n" + >+ " int i;\n" + >+ "}"; >+ assertSourceEquals("Unexpected source", expectedSource, type.getSource()); >+ } finally { >+ JavaCore.setOptions(oldOptions); >+ } >+ } >+ >+ public void test006() throws JavaModelException { >+ Hashtable oldOptions = JavaCore.getOptions(); >+ try { >+ Hashtable options = new Hashtable(oldOptions); >+ options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5); >+ options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5); >+ JavaCore.setOptions(options); >+ ICompilationUnit compilationUnit = getCompilationUnit("CreateMembers", "src", "", "E3.java"); >+ assertNotNull("No compilation unit", compilationUnit); >+ IType[] types = compilationUnit.getTypes(); >+ assertNotNull("No types", types); >+ assertEquals("Wrong size", 1, types.length); >+ IType type = types[0]; >+ type.createType("class DD {}", null, true, null); >+ String expectedSource = >+ "public enum E3 {\n" + >+ " A, B, C;\n\n" + >+ " class DD {}\n" + >+ "}"; >+ assertSourceEquals("Unexpected source", expectedSource, type.getSource()); >+ } finally { >+ JavaCore.setOptions(oldOptions); >+ } >+ } > } >Index: workspace/CreateMembers/src/E2.java >=================================================================== >RCS file: workspace/CreateMembers/src/E2.java >diff -N workspace/CreateMembers/src/E2.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ workspace/CreateMembers/src/E2.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,3 @@ >+public enum E2 { >+ A, B, C >+} >Index: workspace/CreateMembers/src/E3.java >=================================================================== >RCS file: workspace/CreateMembers/src/E3.java >diff -N workspace/CreateMembers/src/E3.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ workspace/CreateMembers/src/E3.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,3 @@ >+public enum E3 { >+ A, B, C >+}
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 95580
: 21264 |
21265