Bug 573261

Summary: OpenJDK javac can't build IDEA
Product: [Fedora] Fedora Reporter: Lubomir Rintel <lkundrak>
Component: java-1.6.0-openjdkAssignee: Deepak Bhole <dbhole>
Status: CLOSED DEFERRED QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: dbhole, langel, lkundrak, mjw, mmatejov
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: F13FeatureIDEA
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-14 14:21:15 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
6638712: Inference with wildcard types causes selection of inapplicable method
none
6650759: Inference of formal type parameter (unused in formal parameters) is not performed
none
6638712: Inference with wildcard types causes selection of inapplicable method
none
6638712: Inference with widcard types causes selection of inapplicable method
none
399889: 6650759: Inference of formal type parameter (unused in formal parameters) is not performed none

Description Lubomir Rintel 2010-03-13 20:09:17 UTC
Created attachment 399888 [details]
6638712: Inference with wildcard types causes selection of inapplicable method

Description of problem:

Compilation of IntelliJ IDEA Community Edition with OpenJDK 6 terminates with an error message (see below). Compilation with OpenJDK 7 tip and Sun JDK 6 works fine though.

I could not authorize to checkout Sun JDK 6 to see how is it different, but managed to isolated fixed from JDK 7. Attaching the patches.  

Steps to Reproduce:

A small reproducer with binaries of dependencies is provided here for convenience: http://v3.sk/~lkundrak/idea-openjdk/
  
Actual results:

     [java]     [javac] /home/lkundrak/src/idea/java/java-impl/src/com/intellij/codeInspection/ex/GlobalJavaInspectionContextImpl.java:223: forEach(com.intellij.util.Processor<com.intellij.psi.PsiClass>) in com.intellij.util.Query<com.intellij.psi.PsiClass> cannot be applied to (com.intellij.psi.search.PsiElementProcessorAdapter<com.intellij.psi.PsiMember>)
     [java]     [javac]           .forEach(createMembersProcessor(processors, scope));
     [java]     [javac]           ^
     [java]     [javac] /home/lkundrak/src/idea/java/java-impl/src/com/intellij/codeInspection/ex/GlobalJavaInspectionContextImpl.java:240: forEach(com.intellij.util.Processor<com.intellij.psi.PsiMethod>) in com.intellij.util.Query<com.intellij.psi.PsiMethod> cannot be applied to (com.intellij.psi.search.PsiElementProcessorAdapter<com.intellij.psi.PsiMember>)
     [java]     [javac]           .forEach(createMembersProcessor(processors, scope));
     [java]     [javac]           ^

Expected results:


Additional info:

Attaching the backported fixes from OpenJDK 7.
I'm currently running jtreg to test the changes, I'll post the results here once if finishes.

Comment 1 Lubomir Rintel 2010-03-13 20:10:18 UTC
Created attachment 399889 [details]
6650759: Inference of formal type parameter (unused in formal parameters) is not performed

Apply this on top of the first changeset.

Comment 2 Lubomir Rintel 2010-03-13 23:14:35 UTC
Created attachment 399919 [details]
6638712: Inference with wildcard types causes selection of inapplicable method

Comment 3 Lubomir Rintel 2010-03-13 23:18:18 UTC
Created attachment 399920 [details]
6638712: Inference with widcard types causes selection of inapplicable method

Comment 4 Lubomir Rintel 2010-03-13 23:19:31 UTC
Created attachment 399921 [details]
399889: 6650759: Inference of formal type parameter (unused in formal parameters) is not performed

Fixed up regression tests.

Comment 5 Lubomir Rintel 2010-03-14 14:20:16 UTC
Please ignore this. With these patches applied (as well as with JDK7), CollectUtil can not be compiled. I'm going to report this upstream instead.

Comment 6 Lubomir Rintel 2010-03-14 14:21:15 UTC
Closing this, will compile those classes with GCJ for now.