< prev index next >

src/share/classes/sun/swing/plaf/synth/DefaultSynthStyle.java

Print this page
rev 1580 : 6727661: Code improvement and warnings removing from the swing/plaf packages
Summary: Removed unnecessary castings and other warnings
Reviewed-by: alexp
Contributed-by: Florian Brunner <fbrunnerlist@gmx.ch>

*** 42,52 **** * merged into a resulting style. * * @author Scott Violet */ public class DefaultSynthStyle extends SynthStyle implements Cloneable { ! private static final Object PENDING = new String("Pending"); /** * Should the component be opaque? */ private boolean opaque; --- 42,52 ---- * merged into a resulting style. * * @author Scott Violet */ public class DefaultSynthStyle extends SynthStyle implements Cloneable { ! private static final String PENDING = "Pending"; /** * Should the component be opaque? */ private boolean opaque;
*** 688,699 **** buf.append("painter=").append(painter).append(','); StateInfo[] states = getStateInfo(); if (states != null) { buf.append("states["); ! for (int i = 0; i < states.length; i++) { ! buf.append(states[i].toString()).append(','); } buf.append(']').append(','); } // remove last newline --- 688,699 ---- buf.append("painter=").append(painter).append(','); StateInfo[] states = getStateInfo(); if (states != null) { buf.append("states["); ! for (StateInfo state : states) { ! buf.append(state.toString()).append(','); } buf.append(']').append(','); } // remove last newline
*** 886,896 **** /** * Returns the number of states that are similar between the * ComponentState this StateInfo represents and val. */ ! private final int getMatchCount(int val) { // This comes from BigInteger.bitCnt val &= state; val -= (0xaaaaaaaa & val) >>> 1; val = (val & 0x33333333) + ((val >>> 2) & 0x33333333); val = val + (val >>> 4) & 0x0f0f0f0f; --- 886,896 ---- /** * Returns the number of states that are similar between the * ComponentState this StateInfo represents and val. */ ! private int getMatchCount(int val) { // This comes from BigInteger.bitCnt val &= state; val -= (0xaaaaaaaa & val) >>> 1; val = (val & 0x33333333) + ((val >>> 2) & 0x33333333); val = val + (val >>> 4) & 0x0f0f0f0f;
< prev index next >