Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 500325

Summary: [1.8] Eclipse failed to compile Java 8 code against Scala library types.
Product: [Eclipse Project] JDT Reporter: Tushar Phadke <tushar_phadke>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED NOT_ECLIPSE QA Contact:
Severity: major    
Priority: P3 CC: stephan.herrmann
Version: 4.6   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard: stalebug
Attachments:
Description Flags
Project with Error using JDK8 none

Description Tushar Phadke CLA 2016-08-26 07:32:09 EDT
Created attachment 263795 [details]
Project with Error using JDK8

I have used Java 8 Streams in code using JDK 8. The code is compilable using JAVA_HOME/bin/javac but Eclipse shows error for same class. I have attached same project with this bug.
Comment 1 Stephan Herrmann CLA 2016-08-26 12:02:04 EDT
Can this problem be reproduced without scala classes?

I tried to replace those two classes with this:
//---
class IndexedSeq<T> {
	int size() { return 0; }
}
class ActorRef {}
//---

With that replacement the program was accepted alright.

There must be something within those libs that breaks type inference.

In bug 468276 we concluded that scala generates class files that could not be legally produced from Java and hence are outside JLS. Seeing scala collection types involved in both cases this could turn out to be a duplicate of the other bug, unless ...

Tushar, can you provide versions of IndexedSeq and ActorRef that are (a) legal Java and (b) trigger the problem?
Comment 2 Tushar Phadke CLA 2016-08-27 03:43:15 EDT
Hi Stephan,

We use following version of the library

Alka-Actor: 2.4.1 http://downloads.typesafe.com/akka/akka_2.11-2.4.1.zip?_ga=1.63906607.1480657454.1470547529 
Scala Library: 2.11.7 (Required for Akka) http://www.scala-lang.org/download/2.11.7.html

These JARs are also attached with this bug under lib folder. We have directly included downloaded jars in project as dependency.

- Tushar
Comment 3 Stephan Herrmann CLA 2016-08-27 12:22:39 EDT
@Tushar, I've seen the jar files. I am, however, suspecting that these jars contain classes that could not be created using only Java. That's why I asked, if you can create simplified versions of the two required classes as Java source code.

Otherwise I will assume that the bug is not in the Eclipse compiler but in those jar files.
Comment 4 Eclipse Genie CLA 2020-10-15 16:20:10 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 5 Eclipse Genie CLA 2022-11-22 12:31:39 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 6 Stephan Herrmann CLA 2022-11-22 14:39:02 EST
closing as per comment 3