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 238051 - [Encapsulate Field] breakes semantic if super class contains getters/seters fith same name
Summary: [Encapsulate Field] breakes semantic if super class contains getters/seters f...
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-06 13:28 UTC by ssazonov
Modified: 2016-07-07 07:18 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Dialog (36.62 KB, image/png)
2013-11-06 13:28 UTC, ssazonov
Details
Broken Semantic (71.16 KB, image/png)
2013-11-06 13:28 UTC, ssazonov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ssazonov 2013-11-06 13:28:20 UTC
Created attachment 141901 [details]
Dialog

1. Create new simple java class

package test;

public class Test {

	public class ClassA {

		public int f1 = 10;

		public int getF1(){
			return f1;
		}

		public void setF1(int f1){
			this.f1 = f1;
		}
	}

	public class ClassB extends ClassA {

		public int f1 = 5;

		public void m1(){
			System.out.println(getF1());
		}
	}
}

2. Right click into body of ClassB, from pop-up menu select Refactor > Encapsulate Field...

3. Select dialog according attached image and press Reafctor

>> Without any warning Refactor breaks semantic of code (see attached image)
Comment 1 ssazonov 2013-11-06 13:28:42 UTC
Created attachment 141902 [details]
Broken Semantic
Comment 2 Martin Balin 2016-07-07 07:18:46 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss