Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6690036
Votes 0
Synopsis some code cleanup for insets-related code
Category java:classes_awt
Reported Against
Release Fixed 7(b27)
State 10-Fix Delivered, bug
Priority: 4-Low
Related Bugs
Submit Date 17-APR-2008
Description
reading insets-related code I've noticed some minor issues which should be corrected to make the code a little bit
clearer.

- XDialogPeer and XFramePeer overrides guessInsets() to separatly handle undecorated case.
  but recently isTargetUndecorated() has been moved to XDecoratedPeer, so this special case can be also moved 
  to XDecoratedPeer.

- XWindowPeer has field wm_set_insets and several methods to work with it.  But it doesn't use this field,
  only XDecoratedPeer uses.  It looks like the only reason why we do have this field in XWindowPeer is that
  XWindowPeer had overriden handlePropertyNotify(XEvent) method at the time the field was added.
  So, I've moved this field and all methods which work with it to XDecoratedPeer.

- XWindowPeer has field insets, but it only initialize it to (0, 0, 0, 0) and create copy of it in getInsets()
  only XDecoratedPeer uses this field.  So we can safely move the field to XDecoratedPeer.

- after moving insets field to XDecoratedPeer I've noticed that there is another field "currentInsets" which keeps
  the same value as insets.  So I've removed insets (because it is easier to fined currentInsets :)

- as code clean up I've made private as many insets-related methods as possible (also I've mode some of them  
  static)

- also in handleCorrectInsets() I've noticed strange comment:

 340                 /*
 341                  * Actual insets account for menubar/warning label,
 342                  * so we can't assign directly but must adjust them.
 343                  */

but actually we do keep just insets (w/o menubar and warnign label)
So, I've removed it and simplified the code (now we can just assign insets instead of adjusting them)

- (this one is not about insets, but about unused code)
  I've noticed atom resize_request (_SUN_AWT_RESIZE_REQUEST) which is used in handleClientMessage()
  but we do not send such message at all.  According the history it was added in early days of XAWT and
  in those days we sent the message.  But sending message had been removed long time ago, it looks like
  it is a  customer  time to reome rest of that stuff.
Posted Date : 2008-04-17 09:35:11.0
Work Around
N/A
Evaluation
see description
Posted Date : 2008-04-17 12:13:14.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang