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 182018 Details for
Bug 328689
[1.4][compiler] "Incompatible conditional operand types Class and Class"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch with test
patch.txt (text/plain), 3.16 KB, created by
Srikanth Sankaran
on 2010-10-29 04:15:22 EDT
(
hide
)
Description:
Patch with test
Filename:
MIME Type:
Creator:
Srikanth Sankaran
Created:
2010-10-29 04:15:22 EDT
Size:
3.16 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java,v >retrieving revision 1.52 >diff -u -r1.52 ClassLiteralAccess.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java 1 Oct 2010 21:09:58 -0000 1.52 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java 29 Oct 2010 08:13:39 -0000 >@@ -101,7 +101,8 @@ > scope.problemReporter().illegalClassLiteralForTypeVariable((TypeVariableBinding)this.targetType, this); > } > ReferenceBinding classType = scope.getJavaLangClass(); >- if (classType.isGenericType()) { >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=328689 >+ if (scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) { > // Integer.class --> Class<Integer>, perform boxing of base types (int.class --> Class<Integer>) > TypeBinding boxedType = null; > if (this.targetType.id == T_void) { >#P org.eclipse.jdt.core.tests.model >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.158 >diff -u -r1.158 ReconcilerTests.java >--- src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java 23 Oct 2010 00:18:36 -0000 1.158 >+++ src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java 29 Oct 2010 08:13:45 -0000 >@@ -5145,4 +5145,43 @@ > deleteProject(project15); > } > } >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=328775 >+public void test14ProjectWith15JRE() throws CoreException, IOException { >+ IJavaProject project14 = null; >+ try { >+ project14 = createJavaProject("Reconciler1415", new String[] {"src"}, new String[] {"JCL15_LIB"}, "bin"); >+ project14.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_4); >+ project14.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4); >+ project14.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_4); >+ >+ createFolder("/Reconciler1415/src/p1"); >+ String source = >+ "package p1;\n" + >+ "public class X {\n" + >+ " int a;\n" + >+ " private Class c = a == 1 ? int.class : long.class;\n" + >+ "}\n"; >+ createFile( >+ "/Reconciler1415/src/p1/X.java", >+ source >+ ); >+ >+ this.workingCopies = new ICompilationUnit[1]; >+ char[] sourceChars = source.toCharArray(); >+ this.problemRequestor.initialize(sourceChars); >+ this.workingCopies[0] = getCompilationUnit("/Reconciler1415/src/p1/X.java").getWorkingCopy(this.wcOwner, null); >+ assertProblems( >+ "Unexpected problems", >+ "----------\n" + >+ "1. WARNING in /Reconciler1415/src/p1/X.java (at line 4)\n" + >+ " private Class c = a == 1 ? int.class : long.class;\n" + >+ " ^\n" + >+ "The value of the field X.c is not used\n" + >+ "----------\n" >+ ); >+ } finally { >+ if (project14 != null) >+ deleteProject(project14); >+ } >+} > }
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 328689
:
181953
| 182018