Program: 195694
Project: 195694
Buggy source:
/** 
 * Updates the   {@link Paint} object used with the current layer (used only if the currentlayer type is not set to  {@link #LAYER_TYPE_NONE}). Changed properties of the Paint provided to   {@link #setLayerType(int,android.graphics.Paint)} will be used the next timethe View is redrawn, but  {@link #setLayerPaint(android.graphics.Paint)} must be called toensure that the view gets redrawn immediately. <p>A layer is associated with an optional  {@link android.graphics.Paint}instance that controls how the layer is composed on screen. The following properties of the paint are taken into account when composing the layer:</p> <ul> <li>  {@link android.graphics.Paint#getAlpha() Translucency (alpha)}</li> <li>  {@link android.graphics.Paint#getXfermode() Blending mode}</li> <li>  {@link android.graphics.Paint#getColorFilter() Color filter}</li> </ul> <p>If this view has an alpha value set to < 1.0 by calling   {@link #setAlpha(float)}, the alpha value of the layer's paint is superceded by this view's alpha value.</p>
 * @param paint The paint used to compose the layer. This argument is optionaland can be null. It is ignored when the layer type is {@link #LAYER_TYPE_NONE}
 * @see #setLayerType(int,android.graphics.Paint)
 */
public void setLayerPaint(Paint paint){
  int layerType=getLayerType();
  if (layerType != LAYER_TYPE_NONE) {
    mLayerPaint=paint == null ? new Paint() : paint;
    if (layerType == LAYER_TYPE_HARDWARE) {
      if (mRenderNode.setLayerPaint(mLayerPaint)) {
        invalidateViewProperty(false,false);
      }
    }
 else {
      invalidate();
    }
  }
}

Fixed version (ground truth):
/** 
 * Updates the   {@link Paint} object used with the current layer (used only if the currentlayer type is not set to  {@link #LAYER_TYPE_NONE}). Changed properties of the Paint provided to   {@link #setLayerType(int,android.graphics.Paint)} will be used the next timethe View is redrawn, but  {@link #setLayerPaint(android.graphics.Paint)} must be called toensure that the view gets redrawn immediately. <p>A layer is associated with an optional  {@link android.graphics.Paint}instance that controls how the layer is composed on screen. The following properties of the paint are taken into account when composing the layer:</p> <ul> <li>  {@link android.graphics.Paint#getAlpha() Translucency (alpha)}</li> <li>  {@link android.graphics.Paint#getXfermode() Blending mode}</li> <li>  {@link android.graphics.Paint#getColorFilter() Color filter}</li> </ul> <p>If this view has an alpha value set to < 1.0 by calling   {@link #setAlpha(float)}, the alpha value of the layer's paint is superseded by this view's alpha value.</p>
 * @param paint The paint used to compose the layer. This argument is optionaland can be null. It is ignored when the layer type is {@link #LAYER_TYPE_NONE}
 * @see #setLayerType(int,android.graphics.Paint)
 */
public void setLayerPaint(Paint paint){
  int layerType=getLayerType();
  if (layerType != LAYER_TYPE_NONE) {
    mLayerPaint=paint == null ? new Paint() : paint;
    if (layerType == LAYER_TYPE_HARDWARE) {
      if (mRenderNode.setLayerPaint(mLayerPaint)) {
        invalidateViewProperty(false,false);
      }
    }
 else {
      invalidate();
    }
  }
}