Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 394692 - [quick fix] Fix several visibility issues
Summary: [quick fix] Fix several visibility issues
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.3 M6   Edit
Assignee: rgra Missing name CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 65876 87239 94152 94755 216898 341209 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-11-20 12:35 EST by rgra Missing name CLA
Modified: 2013-03-13 04:08 EDT (History)
6 users (show)

See Also:


Attachments
Patch for all dependent bugs (29.60 KB, patch)
2012-11-20 14:14 EST, rgra Missing name CLA
no flags Details | Diff
Picture of formatter setting (52.04 KB, image/png)
2013-02-25 04:47 EST, Dani Megert CLA
no flags Details
Revision of Patch (30.43 KB, patch)
2013-03-02 08:16 EST, rgra Missing name CLA
daniel_megert: review-
Details | Diff
2nd Revision of Patch (33.42 KB, patch)
2013-03-11 17:05 EDT, rgra Missing name CLA
daniel_megert: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description rgra Missing name CLA 2012-11-20 12:35:19 EST
Top-Level Bug for several quick-fix visibility bugs which can be fixed in one go.
Comment 1 rgra Missing name CLA 2012-11-20 14:14:32 EST
Created attachment 223770 [details]
Patch for all dependent bugs

This patch resolves all of the dependent bugs. Please review and comment.

I had to introduce a new method Bindings.findOverriddenMethods and only used it in one place. I think it should be used in favor of 
Bindings.findOverriddenMethod in several other places too.
Comment 2 Dani Megert CLA 2012-12-10 10:48:38 EST
Sorry, I ran out of time. I'll review it early M5.
Comment 3 Dani Megert CLA 2013-01-29 05:01:09 EST
(In reply to comment #2)
> Sorry, I ran out of time. I'll review it early M5.

M6, I promise.
Comment 4 rgra Missing name CLA 2013-01-29 13:29:56 EST
No problem :) Do you need a reminder? ;)
Comment 5 Dani Megert CLA 2013-01-30 02:49:23 EST
(In reply to comment #4)
> No problem :) Do you need a reminder? ;)

No, I feel guilty every day ;-)
Comment 6 Dani Megert CLA 2013-02-21 11:45:14 EST
For your info: I started with the review. All our tests pass.

Is it on purpose that the newly added ModifierCorrectionsQuickFixTest#testInvalidVisabilityOverrideMethod() passes even without your patch to the "real" code?
Comment 7 Dani Megert CLA 2013-02-22 11:50:44 EST
The patch is really good! I verified that it fixes all dependent bugs (and the duplicates mentioned in there).

I only have a few trivial polish items that need to be addressed:

- don't add findOverriddenMethods(IMethodBinding, boolean) - just call the 
  method with 3 arguments)
- always return a list (i.e. not 'null' from findOverriddenMethods(...), so that
  we don't need the null-checks in the clients
- add Javadoc to findOverriddenMethods(...)
- new members with Javadoc should get a @since 3.9 tag
- space between "if" and "("
- space between "for" and "("
- space between ")" and "{"
- "f.e." ==> "e.g." and with a space in front
- copyright date needs to be 2013 in all touched files
- improve the entry in the copyright (better summary and smaller URL):
 [quick fix] Visibility Several - https://bugs.eclipse.org/bugs/show_bug.cgi?id=394692
==>
[quick fix] Fix several visibility issues - https://bugs.eclipse.org/394692
Comment 8 rgra Missing name CLA 2013-02-22 12:31:22 EST
Thx for doing the review. 

Will fix the stuff you mentioned on the weekend.
Comment 9 rgra Missing name CLA 2013-02-23 12:00:08 EST
Hi Dani,

some additional comments:
- The test cases don't need a @since tag I guess?
- ModifierCorrectionsQuickFixTest#testInvalidVisabilityOverrideMethod() passes without my patches, but if I recall correctly I introduced an error with one of the fixes which broke the tested scenario. That's why I used this test case to verify it will keep working.
- Which formatter are you using? I didn't find a formatter on the project level and the eclipse default formatter changed too much. Fixed the formatting problems by hand now.
Comment 10 Dani Megert CLA 2013-02-25 04:46:30 EST
(In reply to comment #9)
> Hi Dani,
> 
> some additional comments:
> - The test cases don't need a @since tag I guess?

No, except when some Javadoc is added. Then we also add the @since tag.


> - ModifierCorrectionsQuickFixTest#testInvalidVisabilityOverrideMethod()
> passes without my patches, but if I recall correctly I introduced an error
> with one of the fixes which broke the tested scenario. That's why I used
> this test case to verify it will keep working.

k.


> - Which formatter are you using? I didn't find a formatter on the project
> level.

There is a formatter profile set and when I start a new workspace, clone the jdt.ui repo and import jdt.ui, I do get the formatter on the project (see attached screenshot).

Note that you can enable to format just the changed lines on save (see 'Save Actions' preference page; not enabled on the project itself).
Comment 11 Dani Megert CLA 2013-02-25 04:47:18 EST
Created attachment 227529 [details]
Picture of formatter setting
Comment 12 rgra Missing name CLA 2013-03-02 08:16:49 EST
Created attachment 227842 [details]
Revision of Patch

I've changed all the points mentioned in Daniels review.
Comment 13 Dani Megert CLA 2013-03-11 12:04:24 EDT
Comment on attachment 227842 [details]
Revision of Patch

UnresolvedVariablesQuickFixTest.testVarParameterAccess() now fails when I apply the patch on 'master'. It looks like you broke something in UnresolvedElementsSubProcessor.


Some other trivial issues:
- there's a typo:
  Get's the higher visibility of the given parameters.
  ==>
  Gets the higher visibility of the given parameters.
- the Javadoc should have an empty line before the tags start


In order to catch the M6 bus, I'd need to have a new patch by EOD tomorrow.
Comment 14 rgra Missing name CLA 2013-03-11 17:05:47 EDT
Created attachment 228227 [details]
2nd Revision of Patch

I'm really sorry, my last patch didn't include any changes in the UnresolvedElementsSubProcessor. EGit just ignored it and didn't make a patch entry and I didn't check if everything is included.... Still learning to use Git, and not feeling comfortable yet.

I hope everything is okay now.
Comment 15 Dani Megert CLA 2013-03-12 08:24:57 EDT
(In reply to comment #14)
> Created attachment 228227 [details] [diff]
> 2nd Revision of Patch
...
> I hope everything is okay now.

That patch does not cleanly apply on 'master'. I've fixed that, so that we can proceed.

> - the Javadoc should have an empty line before the tags start
But not between each tag. I've fixed that.

Also tweaked some of the Javadoc.

I've committed the tweaked patch with http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=0e8156a0ee59f04b2e265d8bdbdea1497f47fee3
Comment 16 Dani Megert CLA 2013-03-12 08:25:40 EDT
*** Bug 65876 has been marked as a duplicate of this bug. ***
Comment 17 Dani Megert CLA 2013-03-12 08:26:32 EDT
*** Bug 87239 has been marked as a duplicate of this bug. ***
Comment 18 Dani Megert CLA 2013-03-12 08:26:56 EDT
*** Bug 94152 has been marked as a duplicate of this bug. ***
Comment 19 Dani Megert CLA 2013-03-12 08:27:07 EDT
*** Bug 94755 has been marked as a duplicate of this bug. ***
Comment 20 Dani Megert CLA 2013-03-12 08:27:27 EDT
*** Bug 216898 has been marked as a duplicate of this bug. ***
Comment 21 Dani Megert CLA 2013-03-12 08:27:40 EDT
*** Bug 341209 has been marked as a duplicate of this bug. ***
Comment 22 rgra Missing name CLA 2013-03-12 13:55:13 EDT
Thanks for your review and help Dani! Hope to provide a better patch at the first try next time.
Comment 23 Dani Megert CLA 2013-03-13 04:08:48 EDT
(In reply to comment #22)
> Thanks for your review and help Dani! Hope to provide a better patch at the
> first try next time.

Don't worry, the first try was already actually pretty good. Thanks again.