Program: 188120
Project: 188120
Buggy source:
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int measuredWidth=0;
  int measuredHeight=0;
  int widthMode=MeasureSpec.getMode(widthMeasureSpec);
  int widthSize=MeasureSpec.getSize(widthMeasureSpec);
switch (widthMode) {
case MeasureSpec.AT_MOST:
case MeasureSpec.EXACTLY:
    measuredWidth=widthSize;
  break;
case MeasureSpec.UNSPECIFIED:
measuredWidth=getSuggestedMinimumWidth();
break;
}
scoreText=VotingArrows.getScoreText(score + likes);
VotingArrows.measureScoreText(scoreText,scoreBounds);
int titleWidth;
int detailsWidth;
CharSequence detailsText;
if (thingBodyWidth > 0) {
titleWidth=Math.min(measuredWidth,thingBodyWidth) - PADDING * 2;
int remainingWidth=measuredWidth - thingBodyWidth - PADDING * 2;
if (remainingWidth > MAX_DETAILS_WIDTH) {
detailsWidth=MAX_DETAILS_WIDTH;
detailsText="String_Node_Str";
}
 else if (remainingWidth > MIN_DETAILS_WIDTH) {
detailsWidth=MIN_DETAILS_WIDTH;
detailsText=domain;
}
 else {
detailsWidth=0;
detailsText="String_Node_Str";
}
}
 else {
titleWidth=measuredWidth - PADDING * 2;
detailsWidth=0;
detailsText="String_Node_Str";
}
int width=VotingArrows.getWidth();
if (!TextUtils.isEmpty(thumbnailUrl)) {
width+=PADDING + Thumbnail.getWidth();
}
width+=PADDING;
titleWidth-=width;
int statusWidth=measuredWidth - PADDING * 2;
statusWidth-=width;
if (detailsWidth > 0) {
statusWidth-=detailsWidth + PADDING;
titleWidth-=width;
}
titleWidth=Math.max(0,titleWidth);
statusWidth=Math.max(0,statusWidth);
detailsWidth=Math.max(0,detailsWidth);
titleLayout=makeTitleLayout(titleWidth);
statusLayout=makeLayout(TEXT_STATUS,makeStatusText(),statusWidth,Alignment.ALIGN_NORMAL);
if (detailsWidth > 0) {
detailsLayout=makeLayout(TEXT_STATUS,detailsText,detailsWidth,Alignment.ALIGN_OPPOSITE);
}
 else {
detailsLayout=null;
}
int leftHeight=VotingArrows.getHeight();
rightHeight=titleLayout.getHeight() + ELEMENT_PADDING + statusLayout.getHeight();
minHeight=PADDING + Math.max(leftHeight,rightHeight) + PADDING;
int heightMode=MeasureSpec.getMode(heightMeasureSpec);
int heightSize=MeasureSpec.getSize(heightMeasureSpec);
switch (heightMode) {
case MeasureSpec.AT_MOST:
case MeasureSpec.EXACTLY:
measuredHeight=heightSize;
break;
case MeasureSpec.UNSPECIFIED:
measuredHeight=minHeight;
break;
}
setMeasuredDimension(measuredWidth,measuredHeight);
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int measuredWidth=0;
  int measuredHeight=0;
  int widthMode=MeasureSpec.getMode(widthMeasureSpec);
  int widthSize=MeasureSpec.getSize(widthMeasureSpec);
switch (widthMode) {
case MeasureSpec.AT_MOST:
case MeasureSpec.EXACTLY:
    measuredWidth=widthSize;
  break;
case MeasureSpec.UNSPECIFIED:
measuredWidth=getSuggestedMinimumWidth();
break;
}
scoreText=VotingArrows.getScoreText(score + likes);
VotingArrows.measureScoreText(scoreText,scoreBounds);
int titleWidth;
int detailsWidth;
CharSequence detailsText;
if (thingBodyWidth > 0) {
titleWidth=Math.min(measuredWidth,thingBodyWidth) - PADDING * 2;
int remainingWidth=measuredWidth - thingBodyWidth - PADDING * 2;
if (remainingWidth > MAX_DETAILS_WIDTH) {
detailsWidth=MAX_DETAILS_WIDTH;
detailsText="String_Node_Str";
}
 else if (remainingWidth > MIN_DETAILS_WIDTH) {
detailsWidth=MIN_DETAILS_WIDTH;
detailsText=domain;
}
 else {
detailsWidth=0;
detailsText="String_Node_Str";
}
}
 else {
titleWidth=measuredWidth - PADDING * 2;
detailsWidth=0;
detailsText="String_Node_Str";
}
int width=VotingArrows.getWidth() + PADDING;
if (!TextUtils.isEmpty(thumbnailUrl)) {
width+=PADDING + Thumbnail.getWidth();
}
titleWidth-=width;
int statusWidth=measuredWidth - PADDING * 2;
statusWidth-=width;
if (detailsWidth > 0) {
statusWidth-=detailsWidth + PADDING;
}
titleWidth=Math.max(0,titleWidth);
statusWidth=Math.max(0,statusWidth);
detailsWidth=Math.max(0,detailsWidth);
titleLayout=makeTitleLayout(titleWidth);
statusLayout=makeLayout(TEXT_STATUS,makeStatusText(),statusWidth,Alignment.ALIGN_NORMAL);
if (detailsWidth > 0) {
detailsLayout=makeLayout(TEXT_STATUS,detailsText,detailsWidth,Alignment.ALIGN_OPPOSITE);
}
 else {
detailsLayout=null;
}
int leftHeight=VotingArrows.getHeight();
rightHeight=titleLayout.getHeight() + ELEMENT_PADDING + statusLayout.getHeight();
minHeight=PADDING + Math.max(leftHeight,rightHeight) + PADDING;
int heightMode=MeasureSpec.getMode(heightMeasureSpec);
int heightSize=MeasureSpec.getSize(heightMeasureSpec);
switch (heightMode) {
case MeasureSpec.AT_MOST:
case MeasureSpec.EXACTLY:
measuredHeight=heightSize;
break;
case MeasureSpec.UNSPECIFIED:
measuredHeight=minHeight;
break;
}
setMeasuredDimension(measuredWidth,measuredHeight);
}