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 66898 Details for
Bug 186181
1.5 compiler does not understand class files built by -target jsr14
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Regression test
patch_186181_tests.txt (text/plain), 4.32 KB, created by
Olivier Thomann
on 2007-05-11 12:31:55 EDT
(
hide
)
Description:
Regression test
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2007-05-11 12:31:55 EDT
Size:
4.32 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java,v >retrieving revision 1.53 >diff -u -r1.53 VarargsTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java 6 Mar 2007 04:42:12 -0000 1.53 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java 11 May 2007 16:30:40 -0000 >@@ -10,6 +10,17 @@ > *******************************************************************************/ > package org.eclipse.jdt.core.tests.compiler.regression; > >+import java.io.File; >+import java.util.Map; >+ >+import org.eclipse.jdt.core.ToolFactory; >+import org.eclipse.jdt.core.compiler.CharOperation; >+import org.eclipse.jdt.core.util.IClassFileAttribute; >+import org.eclipse.jdt.core.util.IClassFileReader; >+import org.eclipse.jdt.core.util.IMethodInfo; >+import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; >+import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; >+ > import junit.framework.Test; > > public class VarargsTest extends AbstractComparableTest { >@@ -22,7 +33,7 @@ > // All specified tests which does not belong to the class are skipped... > static { > // TESTS_NAMES = new String[] { "test000" }; >-// TESTS_NUMBERS = new int[] { 30 }; >+// TESTS_NUMBERS = new int[] { 60 }; > // TESTS_RANGE = new int[] { 11, -1 }; > } > public static Test suite() { >@@ -2063,5 +2074,68 @@ > " ^^^^\n" + > "Zork cannot be resolved to a type\n" + > "----------\n"); >- } >+ } >+ //https://bugs.eclipse.org/bugs/show_bug.cgi?id=186181 >+ public void test060() { >+ Map options = this.getCompilerOptions(); >+ options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5); >+ options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5); >+ options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_4); >+ this.runConformTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " public static String varargMethod( Object... objects ) {\r\n" + >+ " String s = \"\";\n" + >+ " for (Object object : objects)\n" + >+ " s += \",\" + object.toString();\n" + >+ " return s;\n" + >+ " }\n" + >+ "}", >+ }, >+ "", >+ null, >+ true, >+ null, >+ options, >+ null); >+ >+ // make sure that this file contains the varargs attribute >+ IClassFileReader reader = ToolFactory.createDefaultClassFileReader(OUTPUT_DIR + File.separator + "X.class", IClassFileReader.ALL); >+ IMethodInfo[] methodInfos = reader.getMethodInfos(); >+ assertEquals("Wrong size", 2, methodInfos.length); >+ IMethodInfo methodInfo = null; >+ if (CharOperation.equals(methodInfos[0].getName(), "varargMethod".toCharArray())) { >+ methodInfo = methodInfos[0]; >+ } else if (CharOperation.equals(methodInfos[1].getName(), "varargMethod".toCharArray())) { >+ methodInfo = methodInfos[1]; >+ } >+ assertTrue("ACC_VARARGS is not set", (methodInfo.getAccessFlags() & ClassFileConstants.AccVarargs) == 0); >+ assertNotNull("Method varargMethodshould be there", methodInfo); >+ assertEquals("2", 2, methodInfo.getAttributeCount()); >+ IClassFileAttribute[] attributes = methodInfo.getAttributes(); >+ assertTrue("varargs attribute not found", CharOperation.equals(attributes[0].getAttributeName(), "Varargs".toCharArray()) >+ || CharOperation.equals(attributes[1].getAttributeName(), "Varargs".toCharArray())); >+ >+ options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5); >+ options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5); >+ options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5); >+ this.runConformTest( >+ new String[] { >+ "UseVararg.java", >+ "public class UseVararg {\r\n" + >+ " public static void main( String[] args ) {\n" + >+ " String arg = \"SUCCESS\";\n" + >+ " String results = X.varargMethod(arg);\n" + >+ " System.out.println( results );\n" + >+ " }\r\n" + >+ "}", >+ }, >+ ",SUCCESS", >+ null, >+ false, >+ null, >+ options, >+ null); >+ } > }
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 186181
:
66492
|
66747
|
66881
| 66898