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

Bug 326832

Summary: [pull up] Pull Up the method to super interface, but the method's javadoc are not copied
Product: [Eclipse Project] JDT Reporter: WILL Mising name <linwaie0529>
Component: UIAssignee: Kenneth Styrberg <kenneth>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, deepakazad, kenneth, linwaie0529, markus.kell.r, Olivier_Thomann, stephan.herrmann
Version: 3.7   
Target Milestone: 4.15 M1   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=103287
https://git.eclipse.org/r/137749
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=1107bf99fbab160f6fdd6f3f9feae49050b6b7f6
Whiteboard:

Description WILL Mising name CLA 2010-10-02 02:20:16 EDT
Build Identifier: 20100917-0705

for example:
in Galileo

public class Test1Class implements Test1Inf{
  /**
  *This is test1
  *@param s1 param s1
  */
  public void test1(String s1){
    
  }
}

after Pull up ....
public interface Test1Inf{
  /**
  *This is test1
  *@param s1 param s1
  */
  public void test1(String s1);
}

but in Helios ....
public interface Test1Inf{
  public abstract void test1(String s1);
}


in addition,
how can I to change the method's java doc in super interface automatically when i chaging the method's java doc in the implementing class?


Reproducible: Always
Comment 1 Olivier Thomann CLA 2010-10-02 10:35:59 EDT
Move to JDT/UI
Comment 2 Deepak Azad CLA 2010-10-04 01:22:09 EDT
> but in Helios ....
> public interface Test1Inf{
>   public abstract void test1(String s1);
> }
Indeed.

...and the original method now seems to have an unnecessary @override annotation resulting in a compile error - "The method test1(String) of type Test1Class must override a superclass method"

> in addition,
> how can I to change the method's java doc in super interface automatically when
> i chaging the method's java doc in the implementing class?
Correct way is to use @see tag. We should probably fix Bug 191863 as well with this.
Comment 3 Deepak Azad CLA 2012-08-21 23:39:39 EDT
*** Bug 387670 has been marked as a duplicate of this bug. ***
Comment 4 Hans-Peter Störr CLA 2012-08-22 03:41:30 EDT
Additionally, the redundant modifiers public abstract should be removed.

If you pull up the method to a superclass but set the action to "declare abstract in destination" you get similar problems (except that the public abstract modifiers are really needed in this case.)

I would also prefer that the Javadoc of Test1Class.test1 should be changed to something like the usual

  /* (non-Javadoc)
   * @see whereever.Test1Class#test1(String)
   */

Otherwise there would be duplication of the comments, which usually leads to inconsistency over time.
Comment 5 Eclipse Genie CLA 2019-01-17 15:13: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 Dani Megert CLA 2019-01-18 10:30:31 EST
Still broken.
Comment 7 Eclipse Genie CLA 2019-02-27 13:54:48 EST
New Gerrit change created: https://git.eclipse.org/r/137749
Comment 8 Stephan Herrmann CLA 2019-06-20 12:14:16 EDT
(In reply to Eclipse Genie from comment #7)
> New Gerrit change created: https://git.eclipse.org/r/137749

Lifting two design questions from gerrit to the bug for better visibility:

(1) If a method has no javadoc, should creating a super method add an empty default javadoc? (I personally would consider this as useless annoyance).

(2) If (1) is voted as 'yes' than I'd expect this to be restricted to public methods only, since javadoc on non-public methods is uncommon.
Comment 10 Kenneth Styrberg CLA 2020-01-07 14:14:26 EST
verified for 4.15 M1 using I20200107-0600 build