Bug 21198

Summary: On JavaEditor dont use == in the isActivePart() method but instead use .equals(Object)
Product: [Eclipse Project] JDT Reporter: Joe Winchester <Winchest>
Component: UIAssignee: Kai-Uwe Maetzel <kai-uwe_maetzel>
Status: VERIFIED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: dirk_baeumer, Kevin_Haaland
Version: 2.0   
Target Milestone: 2.0.1   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Joe Winchester CLA 2002-07-03 05:44:58 EDT
The class JavaEditor does an == check inside isActivePart().  This means that if 
the part is embedded inside another one then the check fails.  Rather than this 
can it use .equals instead and dispatch this to the other part that can 
specialize accordingly, e.g. instead of the current method

	protected boolean isActivePart() {
		IWorkbenchWindow window= getSite().getWorkbenchWindow();
		IPartService service= window.getPartService();
		return (this == service.getActivePart());
	}

it could have the last line as
                return (service.getActivePart().equals(this));
Comment 1 Erich Gamma CLA 2002-07-15 08:21:12 EDT
Kai pls comment, this bug is on a fix wish list. To me it would be OK to 
consider for 2.1 but for 2.0.1 it is questionable.
Comment 2 Kai-Uwe Maetzel CLA 2002-07-16 13:16:51 EDT
This code change is no problem for us. However, just for the record, this is 
not a blessing of embedding the editor into another part. There might be more 
problems when doing this.
Comment 3 Kai-Uwe Maetzel CLA 2002-08-12 06:26:36 EDT
Change released to 2.0.1 and 2.1 stream.
Comment 4 Martin Aeschlimann CLA 2002-08-22 06:29:37 EDT
verified in code (2.0.1 - 20020821)