Bug 421017 - Change jdt.core execution environment to JavaSE-1.6
Summary: Change jdt.core execution environment to JavaSE-1.6
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.4   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 4.4 M4   Edit
Assignee: Jay Arthanareeswaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 421101 421120
  Show dependency tree
 
Reported: 2013-11-04 14:55 EST by John Glassmyer CLA
Modified: 2013-12-10 06:05 EST (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Glassmyer CLA 2013-11-04 14:55:57 EST
Change the minimum execution environment for org.eclipse.jdt.core from J2SE-1.4 to JavaSE-1.6.  This will allow the use of Java 1.5 and 1.6 language features in ongoing development and in the refactoring of internal jdt.core classes.

Note that this bug neither requires nor suggests any changes to public API classes of jdt.core or migration of existing jdt.core code; it is assumed that those things would be proposed and tracked separately if and when they were deemed appropriate.

This bug simply allows the use of generics, enums, and other language features introduced since 1.4 to facilitate development and avoid the accumulation of technical debt within internal jdt.core code.
Comment 1 John Glassmyer CLA 2013-11-04 16:14:27 EST
Change is at https://git.eclipse.org/r/18054.
Comment 2 Srikanth Sankaran CLA 2013-11-04 21:04:48 EST
Interesting that you should raise this bug now. Just last week, we discussed
this and decide to move to either 1.6 or 1.7 for development for JDT/Core.
(of course we will still continue to support projects built with lower levels
as we do today.)

Out of curiosity, what is your interest in this ?

Jay, let us do this for M4 and cherry pick to JAVA8 branch as soon as possible
please. TIA.
Comment 3 Dani Megert CLA 2013-11-05 02:36:01 EST
(In reply to Srikanth Sankaran from comment #2)
> Interesting that you should raise this bug now. Just last week, we discussed
> this and decide to move to either 1.6 or 1.7 for development for JDT/Core.

At the end we decided that 1.7 is too eager, but 1.6 is fine. When doing the switch, please make sure that the corresponding compiler settings/warnings are correctly adjusted for 1.6.
Comment 4 John Glassmyer CLA 2013-11-05 09:46:42 EST
(In reply to Srikanth Sankaran from comment #2)
> Out of curiosity, what is your interest in this ?

I am looking at rewriting parts of ImportRewriteAnalyzer and wouldn't want to do so without generics.  Also, a co-worker has been doing work on the formatter and would like to use generics and enums there.
Comment 5 Markus Keller CLA 2013-11-05 13:19:56 EST
Sounds good. I just wanted to stress again that this is only for

> internal jdt.core code

As we all know, APIs usually cannot be generified piecewise, so we should not start projects like bug 421101 for now and keep APIs raw until we have time to do this right.
Comment 6 Jay Arthanareeswaran CLA 2013-11-15 02:48:10 EST
(In reply to John Glassmyer from comment #1)
> Change is at https://git.eclipse.org/r/18054.

This needs adjustments in compiler error preferences. With the patch, even after ignoring 'Unchecked generic type' and 'Usage or raw type', there are quite a few extra warnings. These need to be taken care of as part of the fix.
Comment 7 John Glassmyer CLA 2013-11-21 15:31:15 EST
Thanks, Jayaprakash.  I have updated the patch:

- Included all the changes to org.eclipse.jdt.core.prefs which get applied automatically when switching execution environment 1.4 -> 1.6, except:
-- Set "Unchecked generic type operation" to "Ignore".
-- Set "Usage of a raw type" to "Ignore".
- Fixed warnings related to unnecessary casts and ambiguity in varargs array arguments.

Please let me know if this is appropriate.
Comment 8 Jay Arthanareeswaran CLA 2013-11-22 06:39:51 EST
(In reply to John Glassmyer from comment #7)
> Thanks, Jayaprakash.  I have updated the patch:
> Please let me know if this is appropriate.

Changes look good to me.

Just to make sure that everyone here understands, this will mean that from now on, ECJ can't be used with a JRE < 1.6. If anyone sees any problem with that, please raise your concern.
Comment 9 Srikanth Sankaran CLA 2013-11-22 07:13:15 EST
(In reply to Jayaprakash Arthanareeswaran from comment #8)
> (In reply to John Glassmyer from comment #7)
> > Thanks, Jayaprakash.  I have updated the patch:
> > Please let me know if this is appropriate.
> 
> Changes look good to me.
> 
> Just to make sure that everyone here understands, this will mean that from
> now on, ECJ can't be used with a JRE < 1.6. If anyone sees any problem with
> that, please raise your concern.

Dani, is there a need to send a blastogram via eclipse-dev and/or jdt-dev to
alert folks ?
Comment 10 Dani Megert CLA 2013-11-25 03:58:48 EST
(In reply to Srikanth Sankaran from comment #9)
> (In reply to Jayaprakash Arthanareeswaran from comment #8)
> > (In reply to John Glassmyer from comment #7)
> > > Thanks, Jayaprakash.  I have updated the patch:
> > > Please let me know if this is appropriate.
> > 
> > Changes look good to me.
> > 
> > Just to make sure that everyone here understands, this will mean that from
> > now on, ECJ can't be used with a JRE < 1.6. If anyone sees any problem with
> > that, please raise your concern.
> 
> Dani, is there a need to send a blastogram via eclipse-dev and/or jdt-dev to
> alert folks ?

I don't think this is needed. Java SE 5 is EOL for the public since October 2009.
Comment 11 Jay Arthanareeswaran CLA 2013-11-25 10:15:47 EST
I have looked at the patch and found it to be good. 

Stephan, can you take a look at the null analysis related preferences and see if you are fine with them? Once you approve we can release the patch.
Comment 12 Olivier Thomann CLA 2013-11-25 10:23:14 EST
(In reply to Jayaprakash Arthanareeswaran from comment #8)
> (In reply to John Glassmyer from comment #7)
> > Thanks, Jayaprakash.  I have updated the patch:
> > Please let me know if this is appropriate.
> 
> Changes look good to me.
> 
> Just to make sure that everyone here understands, this will mean that from
> now on, ECJ can't be used with a JRE < 1.6. If anyone sees any problem with
> that, please raise your concern.
We should check with Tomcat if they are still using ecj and require a 1.4 VM. We had that requirement a long time ago. Maybe this is no longer the case.
Comment 13 Markus Keller CLA 2013-11-25 13:31:38 EST
http://tomcat.apache.org/whichversion.html says:
- Tomcat 7.x (latest stable release) requires Java 1.6
- Tomcat 6.x (earlier stable release) requires Java 1.5

=> I wouldn't expect a maintenance release to update to ecj from Luna, so that should not keep us away from 1.6 (whose EOL for public updates was Feb 2013).
Comment 14 Jay Arthanareeswaran CLA 2013-11-28 04:54:07 EST
(In reply to Markus Keller from comment #13)
> http://tomcat.apache.org/whichversion.html says:
> - Tomcat 7.x (latest stable release) requires Java 1.6
> - Tomcat 6.x (earlier stable release) requires Java 1.5

The last tomcat 6 release (6.0.37) is dated 2012-10-01. I supposed they won't have another release after all, will they? I have done a bit of testing and everything work as expected and I will push the changes now.
Comment 16 Jay Arthanareeswaran CLA 2013-11-28 08:08:42 EST
Stephan, I went ahead and released this so we could test for any issues early enough. Feel free to adjust any preferences which you think necessary.
Comment 17 Manoj N Palat CLA 2013-12-10 06:05:54 EST
 Verified for Eclipse Luna (4.4M4) Build id: I20131209-2000