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

Bug 231432

Summary: Copy and paste of type from one file to another does not respect the package of the type
Product: [Eclipse Project] JDT Reporter: Ulli Hafner <Knut.Friedhelm>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, jerome_lanneluc
Version: 3.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Ulli Hafner CLA 2008-05-10 11:04:11 EDT
When copying an annotation with the same name but different package from one file into another then the existing annotations are not checked.

Setup:
----------------------------------------------------------- File 1 --------------------------------------
package hudson.plugins.pmd.util.model;

import edu.umd.cs.findbugs.annotations.SuppressWarnings;

@SuppressWarnings("SIC")
public class Foo1 {

}

----------------------------------------------------------- File 2 --------------------------------------

package hudson.plugins.pmd.util.model;

@SuppressWarnings("all")
public class Foo2 {

}

==========================================================
 
Steps to reproduce: 
1. Select @SuppressWarnings("SIC") and CTRL-C in Foo1
2. Put Cursor before public in Foo2
3. CTRL-V

Actual Result:
--------------------------------------------------------------------------------------------------------
package hudson.plugins.pmd.util.model;

import edu.umd.cs.findbugs.annotations.SuppressWarnings;

@SuppressWarnings("all")
@SuppressWarnings("SIC")
public class Foo2 {

}

Expected Result:
--------------------------------------------------------------------------------------------------------
package hudson.plugins.pmd.util.model;

@SuppressWarnings("all")
@edu.umd.cs.findbugs.annotations.SuppressWarningsSuppressWarnings("SIC")
public class Foo2 {

}
Comment 1 Jerome Lanneluc CLA 2008-05-12 11:43:47 EDT
Moving to JDT/Text
Comment 2 Dani Megert CLA 2008-05-13 03:42:15 EDT

*** This bug has been marked as a duplicate of bug 114340 ***