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

Bug 312880

Summary: same alias for different namespace
Product: z_Archived Reporter: Zhongwei Zhao <zhaozhongwei>
Component: PDTAssignee: xu jiaxi <legend7z>
Status: CLOSED FIXED QA Contact: Ilina Stefanova <ilina.s>
Severity: normal    
Priority: P3 CC: ilina.s
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch none

Description Zhongwei Zhao CLA 2010-05-14 05:05:35 EDT
php code:
<?php
namespace ns1\ns11\ns111 {
      class c1 {  }
}
namespace ns1\ns11\ns112 {
      class c1 {  }
}
namespace ns2\n21 {
      $a = new c1|      //| is cursor position
}

Then choose \ns1\ns11\ns111\c1,we will get:
<?php
namespace ns1\ns11\ns111 {
      class c1 {  }
}
namespace ns1\ns11\ns112 {
      class c1 {  }
}
namespace ns2\n21 {
      use ns1\ns11\ns111\c1;

      $a = new c1()
}
then type $a = new c1,we get:
namespace ns1\ns11\ns111 {
      class c1 {  }
}
namespace ns1\ns11\ns112 {
      class c1 {  }
}
namespace ns2\n21 {
      use ns1\ns11\ns111\c1;

      $a = new ns111\c1();
      $a = new c1|      //| is cursor position
}

Then choose \ns1\ns11\ns112\c1,we will get:
<?php
namespace ns1\ns11\ns111 {
      class c1 {  }
}
namespace ns1\ns11\ns112 {
      class c1 {  }
}
namespace ns2\n21 {
      use ns1\ns11\ns111\c1;

      use ns1\ns11\ns112\c1;

      $a = new c1();
      $a = new c1()
}

now 
      use ns1\ns11\ns111\c1;

      use ns1\ns11\ns112\c1;
have the same alias.


So we need use namespace alias or full qualified class name for \ns1\ns11\ns112\c1.
Comment 1 xu jiaxi CLA 2010-11-11 03:14:16 EST
Created attachment 182884 [details]
patch

I will try to attach unit tests later if possible
Comment 2 Zhongwei Zhao CLA 2011-05-23 01:58:25 EDT
applied the patch,thanks!
Comment 3 Ilina Stefanova CLA 2011-07-27 03:57:32 EDT
Verified