This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 45183 - Override & Implement annotations shown at wrong position
Summary: Override & Implement annotations shown at wrong position
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Martin Matula
URL:
Keywords:
: 45995 46059 49187 51830 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-06-18 16:11 UTC by rmatous
Modified: 2007-09-26 09:14 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
see picture (15.29 KB, image/png)
2004-06-18 16:12 UTC, rmatous
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rmatous 2004-06-18 16:11:00 UTC
After a while of playing with editor there are
mentioned annotations shown on wrong position.
Comment 1 rmatous 2004-06-18 16:12:04 UTC
Created attachment 15839 [details]
see picture
Comment 2 Dusan Balek 2004-07-14 10:12:35 UTC
*** Issue 45995 has been marked as a duplicate of this issue. ***
Comment 3 Dusan Balek 2004-07-14 10:13:31 UTC
*** Issue 46059 has been marked as a duplicate of this issue. ***
Comment 4 Dusan Balek 2004-07-19 08:30:23 UTC
Fixed in [maintrunk].

Checking in OverrideAnnotation.java;
/cvs/java/src/org/netbeans/modules/java/OverrideAnnotation.java,v  <--
 OverrideAnnotation.java
new revision: 1.7; previous revision: 1.6
done
Checking in OverrideAnnotationSupport.java;
/cvs/java/src/org/netbeans/modules/java/OverrideAnnotationSupport.java,v
 <--  OverrideAnnotationSupport.java
new revision: 1.7; previous revision: 1.6
done
Comment 5 Jesse Glick 2004-07-28 19:32:31 UTC
Observed again in 040726. Have edited a class to where the main body is

// TestBase ultimately extends junit's TestCase
public class UtilTest extends TestBase {
    
    public UtilTest(String name) {
        super(name);
    }
    
    private FileObject test1Xml;
    
    protected void setUp() throws Exception {
        super.setUp();
        // some stuff...
    }
    
    public void testGetAntScriptName() throws Exception {
        
    }

}

The override annotation (belonging to setUp) is currently displayed on
the last line ("}").
Comment 6 Martin Roskanin 2004-07-29 10:40:00 UTC
Jesse, I cannot reproduce it, using your test example.
It seems it is java module problem. 
Very similar to one mentioned in issue #41630
Comment 7 Jesse Glick 2004-07-29 21:13:49 UTC
Of course you cannot reproduce it by just pasting in the text I
showed. This bug has always happened to me after (1) adding some
overrides (e.g. with Ctrl-I), (2) cutting and pasting the methods
elsewhere in the file.
Comment 8 rmatous 2004-08-04 14:55:24 UTC
Try Dev (Build 040804). Select one method with I or O annotation, copy
on clipboard, delete method and paste method back (the best is to
paste somweher else and not on original position) and after every step
watch what happens and compare with  your expectations.

I noticed :
- annotation is still present even if method is deleted
- after pasting is annotation completely at wrong position
- after pasting no symbol for code folding 


Comment 9 Tomas Hurka 2004-08-19 12:19:01 UTC
Cut&paste method will confuse override annotation, since there is no change to the 
method itself, but its position bounds are different. Martin should know how to fix it. 
Comment 10 Pavel Flaska 2004-10-28 15:03:12 UTC
*** Issue 49187 has been marked as a duplicate of this issue. ***
Comment 11 ehucka 2005-01-11 13:04:16 UTC
old target milestone, please re-evaluate
Comment 12 Jesse Glick 2005-01-14 19:49:05 UTC
Have continued to observe this bug in 4.1 dev builds.
Comment 13 Martin Matula 2005-01-20 15:40:16 UTC
*** Issue 51830 has been marked as a duplicate of this issue. ***
Comment 14 Martin Matula 2005-02-15 16:37:51 UTC
Fixed.

Checking in src/org/netbeans/modules/java/OverrideAnnotation.java;
/cvs/java/src/org/netbeans/modules/java/OverrideAnnotation.java,v  <--
 OverrideAnnotation.java
new revision: 1.9; previous revision: 1.8
done
Checking in src/org/netbeans/modules/java/OverrideAnnotationSupport.java;
/cvs/java/src/org/netbeans/modules/java/OverrideAnnotationSupport.java,v
 <--  OverrideAnnotationSupport.java
new revision: 1.17; previous revision: 1.16
done
Comment 15 rmatous 2005-02-17 12:49:55 UTC
Thanks.