This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 423025 - Move org.eclipse.ui.ide to Java 1.6
Summary: Move org.eclipse.ui.ide to Java 1.6
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 4.3   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.4 M7   Edit
Assignee: Lars Vogel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-03 05:30 EST by Lars Vogel CLA
Modified: 2014-04-22 08:54 EDT (History)
4 users (show)

See Also:


Attachments
ProblemsView (91.04 KB, image/png)
2013-12-04 06:54 EST, Lars Vogel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2013-12-03 05:30:09 EST
Most of the platform components have moved or are in the process to move to Java 1.5 or Java 1.6.

I suggest to move org.eclipse.ui.ide also to Java 1.6 (or at least to Java 1.5).
Comment 1 Lars Vogel CLA 2013-12-03 05:32:41 EST
Advantages are the typical ones:

1.) Use annotations
2.) Use enhancement for loop
3.) ....
Comment 2 Lars Vogel CLA 2013-12-03 05:35:36 EST
https://git.eclipse.org/r/#/c/19243/
Comment 3 Dani Megert CLA 2013-12-03 05:44:07 EST
If we move, I suggest to move to the same level as the other UI bundles, which is currently 1.5, I think.

Also, I'd expect that we don't get any warnings in the official build.
Comment 4 Lars Vogel CLA 2013-12-03 05:52:04 EST
(In reply to Dani Megert from comment #3)
> If we move, I suggest to move to the same level as the other UI bundles,
> which is currently 1.5, I think.
> 
> Also, I'd expect that we don't get any warnings in the official build.

Agree to 1.5, I update to the Gerrit review. With regards to warnings, there are already warnings in the official build if I see it correctly. For example "Missing Javadoc" in GotoActionGroup or "Deprecated" warnings.
Comment 5 Dani Megert CLA 2013-12-03 05:56:24 EST
(In reply to Lars Vogel from comment #4)
> With regards to warnings, there
> are already warnings in the official build if I see it correctly.

No, there are only warnings in the *.e4.* bundles (which should get fixed too ;-). See e.g.
http://download.eclipse.org/eclipse/downloads/drops4/N20131202-2000/testResults.php
Comment 6 Lars Vogel CLA 2013-12-03 06:31:52 EST
> No, there are only warnings in the *.e4.* bundles (which should get fixed
> too ;-). See e.g.
> http://download.eclipse.org/eclipse/downloads/drops4/N20131202-2000/
> testResults.php

This would be the equivalent of the "Problems" view, right? I also don't see any warnings here (also after the change to Java 1.5). But the Package Explorer shows warnings, examples see https://bugs.eclipse.org/bugs/show_bug.cgi?id=423025#c4
Comment 7 Dani Megert CLA 2013-12-03 06:39:41 EST
(In reply to Lars Vogel from comment #6)
> > No, there are only warnings in the *.e4.* bundles (which should get fixed
> > too ;-). See e.g.
> > http://download.eclipse.org/eclipse/downloads/drops4/N20131202-2000/
> > testResults.php
> 
> This would be the equivalent of the "Problems" view, right?

No. By default the official build applies its own global rules, so that all projects are measured with same rules. Projects can override them for the IDE/workbench via project specific settings, usually to see more warnings than in the build. A project can also change the settings for the official build via pom, but that should be the exception.


> I also don't see
> any warnings here (also after the change to Java 1.5). But the Package
> Explorer shows warnings, examples see
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=423025#c4

Then you probably have some filter enabled in your 'Problems' view.
Comment 8 Lars Vogel CLA 2013-12-04 06:54:22 EST
Created attachment 238002 [details]
ProblemsView

> Then you probably have some filter enabled in your 'Problems' view.

I think I have set the filters correctly, see attachement. This should show all warnings in the currently selected project, I think.
Comment 9 Dani Megert CLA 2013-12-04 07:05:40 EST
(In reply to Lars Vogel from comment #8)
> Created attachment 238002 [details]
> ProblemsView
> 
> > Then you probably have some filter enabled in your 'Problems' view.
> 
> I think I have set the filters correctly, see attachement. This should show
> all warnings in the currently selected project, I think.

I see 1373 warnings on ui.ide in my 'Problems' view with the settings shown in your picture. No idea, why they don't show up in your workspace.
Comment 10 Lars Vogel CLA 2014-03-05 15:31:40 EST
Several platform plug-in have updated to Java 1.6 to surpress the type warnings in their build. I really like this approach, this way we can upgrade the classes gradually.
Comment 11 Dani Megert CLA 2014-04-08 04:11:19 EDT
It looks like this was now done, but now causes 11 warnings in our official build:
http://download.eclipse.org/eclipse/downloads/drops4/N20140408-0015/compilelogs/plugins/org.eclipse.ui.ide_3.10.0.N20140408-0015/@dot.html

Lars, please fix them ASAP or revert the change. Thanks.
Comment 12 Markus Keller CLA 2014-04-08 05:30:01 EDT
(In reply to Dani Megert from comment #11)
> It looks like this was now done, but now causes 11 warnings in our official
> build:

And the right fix is not to cast something, but to remove the
"new String[] {...}" and perform a varargs invocation. For the methods passing "null", you have to check if it's OK to just remove the "null" and perform a varargs invocation with zero additional args.
Comment 13 Lars Vogel CLA 2014-04-08 05:40:50 EDT
(In reply to Dani Megert from comment #11)
> It looks like this was now done, but now causes 11 warnings in our official
> build:
> http://download.eclipse.org/eclipse/downloads/drops4/N20140408-0015/
> compilelogs/plugins/org.eclipse.ui.ide_3.10.0.N20140408-0015/@dot.html
> 
> Lars, please fix them ASAP or revert the change. Thanks.

I see 17 warnings, but I think the discourage access was there before. I have a look tonight and try to fix them. Thanks Markus for the pointer.
Comment 14 Lars Vogel CLA 2014-04-08 14:06:44 EDT
(In reply to Markus Keller from comment #12)
> And the right fix is not to cast something, but to remove the
> "new String[] {...}" and perform a varargs invocation. For the methods
> passing "null", you have to check if it's OK to just remove the "null" and
> perform a varargs invocation with zero additional args.

I was able to follow your advice for the EditorAssociationOverrideDescriptor and IDEResourceInfoUtils but for ExtendedMarkersView I had to add an explicit cast. I tested this cast and it should be fine IMHO. 

But as you explicit said I should not do this, I did not want to commit it, without your feedback.Can you have a look and tell me if there is a better way of getting rid of this warning?

https://git.eclipse.org/r/#/c/24658/
Comment 15 Dani Megert CLA 2014-04-09 05:05:41 EDT
(In reply to Lars Vogel from comment #14)
> for ExtendedMarkersView I had to add an explicit cast.

The cast is not needed:
MarkerMessages.errorsAndWarningsSummaryBreakdown, counts[0], counts[1], counts[2] + counts[3]);
Comment 16 Lars Vogel CLA 2014-04-09 05:41:30 EDT
(In reply to Dani Megert from comment #15)
> (In reply to Lars Vogel from comment #14)
> > for ExtendedMarkersView I had to add an explicit cast.
> 
> The cast is not needed:
> MarkerMessages.errorsAndWarningsSummaryBreakdown, counts[0], counts[1],
> counts[2] + counts[3]);

I can do that, but that replicates the logic; assume it changes later you have to remember to change it twice. Why is the cast bad?
Comment 17 Lars Vogel CLA 2014-04-09 06:02:57 EDT
(In reply to Lars Vogel from comment #16)
> I can do that, but that replicates the logic; assume it changes later you
> have to remember to change it twice. Why is the cast bad?

Gerrit review adjusted as requested. Thanks for the feedback.
Comment 18 Lars Vogel CLA 2014-04-09 07:34:01 EDT
(In reply to Lars Vogel from comment #17)
> (In reply to Lars Vogel from comment #16)
> > I can do that, but that replicates the logic; assume it changes later you
> > have to remember to change it twice. Why is the cast bad?
> 
> Gerrit review adjusted as requested. Thanks for the feedback.

Dani applied the review with https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=37981c487563d3945d0a168c46af66b0f58e0700
Comment 19 Dani Megert CLA 2014-04-09 07:50:33 EDT
I overlooked that the code that reassigns 'counts' has not been removed. Without that, the new code will run into AIOOBE. I also fixed the code duplication.

Fixed with http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=f57ff125d5c0d604482906cb90f9dd0712e9cfa5


> Why is the cast bad?

Casts should always be avoided if possible.
Comment 20 Lars Vogel CLA 2014-04-22 08:54:45 EDT
Verified in Git