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 181269 Details for
Bug 186565
[1.5][compiler] 1.4/1.5 .class file interaction
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch under test
patch.txt (text/plain), 6.01 KB, created by
Srikanth Sankaran
on 2010-10-20 05:58:10 EDT
(
hide
)
Description:
Patch under test
Filename:
MIME Type:
Creator:
Srikanth Sankaran
Created:
2010-10-20 05:58:10 EDT
Size:
6.01 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java,v >retrieving revision 1.115 >diff -u -r1.115 ParameterizedTypeBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java 20 Oct 2010 05:46:47 -0000 1.115 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java 20 Oct 2010 09:46:44 -0000 >@@ -15,7 +15,6 @@ > import org.eclipse.jdt.core.compiler.CharOperation; > import org.eclipse.jdt.internal.compiler.ast.TypeReference; > import org.eclipse.jdt.internal.compiler.ast.Wildcard; >-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; > > /** > * A parameterized type encapsulates a type with type arguments, >@@ -858,19 +857,28 @@ > this.arguments[i] = resolveType; > this.tagBits |= resolvedType.tagBits & TagBits.ContainsNestedTypeReferences; > } >- // arity check >- TypeVariableBinding[] refTypeVariables = resolvedType.typeVariables(); >- if (refTypeVariables == Binding.NO_TYPE_VARIABLES) { // check generic >- // Below 1.5, we should have already complained about the use of type parameters. >- boolean isCompliant15 = this.environment.globalOptions.originalSourceLevel >= ClassFileConstants.JDK1_5; >- if (isCompliant15 && (resolvedType.tagBits & TagBits.HasMissingType) == 0) { >- this.environment.problemReporter.nonGenericTypeCannotBeParameterized(0, null, resolvedType, this.arguments); >- } >- return this; >- } else if (argLength != refTypeVariables.length) { // check arity >- this.environment.problemReporter.incorrectArityForParameterizedType(null, resolvedType, this.arguments); >- return this; // cannot reach here as AbortCompilation is thrown >- } >+ /* https://bugs.eclipse.org/bugs/show_bug.cgi?id=186565, Removed generic check >+ and arity check since we are dealing with binary types here and the fact that >+ the compiler produced class files for these types at all is proof positive that >+ the generic check and the arity check passed in the build environment that produced >+ these class files. Otherwise we don't handle mixed 1.5 and 1.4 projects correctly. >+ Just as with bounds check below, incremental build will propagate the change and >+ detect problems in source. >+ */ >+ >+// // arity check >+// TypeVariableBinding[] refTypeVariables = resolvedType.typeVariables(); >+// if (refTypeVariables == Binding.NO_TYPE_VARIABLES) { // check generic >+// // Below 1.5, we should have already complained about the use of type parameters. >+// boolean isCompliant15 = this.environment.globalOptions.originalSourceLevel >= ClassFileConstants.JDK1_5; >+// if (isCompliant15 && (resolvedType.tagBits & TagBits.HasMissingType) == 0) { >+// this.environment.problemReporter.nonGenericTypeCannotBeParameterized(0, null, resolvedType, this.arguments); >+// } >+// return this; >+// } else if (argLength != refTypeVariables.length) { // check arity >+// this.environment.problemReporter.incorrectArityForParameterizedType(null, resolvedType, this.arguments); >+// return this; // cannot reach here as AbortCompilation is thrown >+// } > // check argument type compatibility... REMOVED for now since incremental build will propagate change & detect in source > // for (int i = 0; i < argLength; i++) { > // TypeBinding resolvedArgument = this.arguments[i]; >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java,v >retrieving revision 1.215 >diff -u -r1.215 BatchCompilerTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java 6 Oct 2010 13:57:31 -0000 1.215 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java 20 Oct 2010 09:46:53 -0000 >@@ -11860,4 +11860,60 @@ > System.setProperty("user.dir", javaUserDir); > } > } >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=186565 >+public void test0308(){ >+ String outputDirName = OUTPUT_DIR + File.separator + "d", >+ metaInfDirName = outputDirName + File.separator + "META-INF", >+ jarFileName = outputDirName + File.separator + "classB15.jar"; >+ this.runConformTest( >+ new String[] { >+ "d/B.java", >+ "public class B<T> extends A<T> {\n" + >+ "}", >+ "d/A.java", >+ "public class A<T> {\n" + >+ "}", >+ }, >+ "\"" + outputDirName + "\"" >+ + " -1.5 -g -preserveAllLocals" >+ + " -d \"" + outputDirName + "\"", >+ "", >+ "", >+ true /* flush output directory */); >+ File outputDirectory = new File(outputDirName); >+ File metaInfDirectory = new File(metaInfDirName); >+ metaInfDirectory.mkdirs(); >+ try { >+ Util.createFile(metaInfDirName + File.separator + "MANIFEST.MF", >+ "Manifest-Version: 1.0\n" + >+ "Class-Path: ../d/classB15.jar\n"); >+ } catch (IOException e) { >+ fail("could not create manifest file"); >+ } >+ Util.delete(outputDirName + File.separator + "A.class"); >+ Util.delete(outputDirName + File.separator + "A.java"); >+ try { >+ Util.zip(outputDirectory, jarFileName); >+ } catch (IOException e) { >+ fail("could not create jar file"); >+ } >+ Util.delete(outputDirName + File.separator + "B.class"); >+ Util.delete(outputDirName + File.separator + "B.java"); >+ this.runConformTest( >+ new String[] { >+ "d/A.java", >+ "public class A {\n" + >+ "}", >+ "d/C.java", >+ "public class C extends B<String> {\n" + >+ "}", >+ }, >+ "\"" + outputDirName + "\"" >+ + " -1.5 -g -preserveAllLocals" >+ + " -cp \"" + jarFileName + "\"" >+ + " -d \"" + OUTPUT_DIR + "\"", >+ "", >+ "", >+ false /* do not flush output directory */); >+} > }
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 186565
:
181269
|
182190
|
182218