Buggy code:
public class ColorPickerView extends View { private static final int PANEL_SAT_VAL = 0 ; private static final int PANEL_HUE = 1 ; private static final int PANEL_ALPHA = 2 ; private static final float BORDER_WIDTH_PX = 1 ; private float HUE_PANEL_WIDTH = 30.0F ; private float ALPHA_PANEL_HEIGHT = 20.0F ; private float PANEL_SPACING = 10.0F ; private float PALETTE_CIRCLE_TRACKER_RADIUS = 5.0F ; private float RECTANGLE_TRACKER_OFFSET = 2.0F ; private float mDensity = 1.0F ; private ColorPickerView . OnColorChangedListener mListener ; private Paint mSatValPaint ; private Paint mSatValTrackerPaint ; private Paint mHuePaint ; private Paint mHueTrackerPaint ; private Paint mAlphaPaint ; private Paint mAlphaTextPaint ; private Paint mBorderPaint ; private Shader mValShader ; private Shader mSatShader ; private Shader mHueShader ; private Shader mAlphaShader ; private int mAlpha = 255 ; private float mHue = 360.0F ; private float mSat = 0.0F ; private float mVal = 0.0F ; private String mAlphaSliderText = "" ; private int mSliderTrackerColor = - 14935012 ; private int mBorderColor = - 9539986 ; private boolean mShowAlphaPanel = false ; private int mLastTouchedPanel = ColorPickerView . PANEL_SAT_VAL ; private float mDrawingOffset ; private RectF mDrawingRect ; private RectF mSatValRect ; private RectF mHueRect ; private RectF mAlphaRect ; private AlphaPatternDrawable mAlphaPattern ; private Point mStartTouchPoint = null ; public interface OnColorChangedListener { public void onColorChanged ( int color ) { } } public ColorPickerView ( Context context ) { } public ColorPickerView ( Context context , AttributeSet attrs ) { } public ColorPickerView ( Context context , AttributeSet attrs , int defStyle ) { } private void init ( ) { } private void initPaintTools ( ) { } private float calculateRequiredOffset ( ) { } private int [ ] buildHueColorArray ( ) { } @ Override protected void onDraw ( Canvas canvas ) { } private void drawSatValPanel ( Canvas canvas ) { } private void drawHuePanel ( Canvas canvas ) { } private void drawAlphaPanel ( Canvas canvas ) { if ( ( ( ! ( mShowAlphaPanel ) ) || ( ( mAlphaRect ) == null ) ) || ( ( mAlphaPattern ) == null ) ) return ; final RectF rect = mAlphaRect ; if ( ( ColorPickerView . BORDER_WIDTH_PX ) > 0 ) { mBorderPaint . setColor ( mBorderColor ) ; canvas . drawRect ( ( ( rect . left ) - ( ColorPickerView . BORDER_WIDTH_PX ) ) , ( ( rect . top ) - ( ColorPickerView . BORDER_WIDTH_PX ) ) , ( ( rect . right ) + ( ColorPickerView . BORDER_WIDTH_PX ) ) , ( ( rect . bottom ) + ( ColorPickerView . BORDER_WIDTH_PX ) ) , mBorderPaint ) ; } mAlphaPattern . draw ( canvas ) ; float [ ] hsv = new float [ ] { mHue , mSat , mVal } ; int color = Color . HSVToColor ( hsv ) ; int acolor = Color . HSVToColor ( 0 , hsv ) ; mAlphaShader = new android . graphics . LinearGradient ( rect . left , rect . top , rect . right , rect . top , color , acolor , TileMode . CLAMP ) ; mAlphaPaint . setShader ( mAlphaShader ) ; canvas . drawRect ( rect , mAlphaPaint ) ; <START_BUG> if ( ( ( mAlphaSliderText ) != null ) && ( ( mAlphaSliderText ) != "" ) ) { <END_BUG> canvas . drawText ( mAlphaSliderText , rect . centerX ( ) , ( ( rect . centerY ( ) ) + ( 4 * ( mDensity ) ) ) , mAlphaTextPaint ) ; } float rectWidth = ( 4 * ( mDensity ) ) // 2 ; Point p = alphaToPoint ( mAlpha ) ; RectF r = new RectF ( ) ; r . left = ( p . x ) - rectWidth ; r . right = ( p . x ) + rectWidth ; r . top = ( rect . top ) - ( RECTANGLE_TRACKER_OFFSET ) ; r . bottom = ( rect . bottom ) + ( RECTANGLE_TRACKER_OFFSET ) ; canvas . drawRoundRect ( r , 2 , 2 , mHueTrackerPaint ) ; } private Point hueToPoint ( float hue ) { } private Point satValToPoint ( float sat , float val ) { } private Point alphaToPoint ( int alpha ) { } private float [ ] pointToSatVal ( float x , float y ) { } private float pointToHue ( float y ) { } private int pointToAlpha ( int x ) { } @ Override public boolean onTrackballEvent ( MotionEvent event ) { } @ Override public boolean onTouchEvent ( MotionEvent event ) { } private boolean moveTrackersIfNeeded ( MotionEvent event ) { } @ Override protected void onMeasure ( int widthMeasureSpec , int heightMeasureSpec ) { } private int chooseWidth ( int mode , int size ) { } private int chooseHeight ( int mode , int size ) { } private int getPrefferedWidth ( ) { } private int getPrefferedHeight ( ) { } @ Override protected void onSizeChanged ( int w , int h , int oldw , int oldh ) { } private void setUpSatValRect ( ) { } private void setUpHueRect ( ) { } private void setUpAlphaRect ( ) { } public void setOnColorChangedListener ( ColorPickerView . OnColorChangedListener listener ) { } public void setBorderColor ( int color ) { } public int getBorderColor ( ) { } public int getColor ( ) { } public void setColor ( int color ) { } public void setColor ( int color , boolean callback ) { } public float getDrawingOffset ( ) { } public void setAlphaSliderVisible ( boolean visible ) { } public void setSliderTrackerColor ( int color ) { } public int getSliderTrackerColor ( ) { } public void setAlphaSliderText ( int res ) { } public void setAlphaSliderText ( String text ) { } public String getAlphaSliderText ( ) { } No newline ; at end ; of file ; }

Fix:
if ( ( ( mAlphaSliderText ) != null ) && ( ! ( mAlphaSliderText . equals ( "" ) ) ) ) {