Program: 9205
Project: 9205
Buggy source:
public boolean match(Shadow shadow,World world){
  if (super.match(shadow,world)) {
    if (shadow.getKind() == Shadow.ExceptionHandler) {
      if (kind.isAfter() || kind == AdviceKind.Around) {
        world.showMessage(IMessage.WARNING,WeaverMessages.format(WeaverMessages.ONLY_BEFORE_ON_HANDLER),getSourceLocation(),shadow.getSourceLocation());
        return false;
      }
    }
    if (shadow.getKind() == Shadow.SynchronizationLock || shadow.getKind() == Shadow.SynchronizationUnlock) {
      if (kind == AdviceKind.Around) {
        world.showMessage(IMessage.WARNING,WeaverMessages.format(WeaverMessages.NO_AROUND_ON_SYNCHRONIZATION),getSourceLocation(),shadow.getSourceLocation());
        return false;
      }
    }
    if (hasExtraParameter() && kind == AdviceKind.AfterReturning) {
      ResolvedType resolvedExtraParameterType=getExtraParameterType().resolve(world);
      ResolvedType shadowReturnType=shadow.getReturnType().resolve(world);
      boolean matches=(resolvedExtraParameterType.isConvertableFrom(shadowReturnType) && shadow.getKind().hasReturnValue());
      if (matches && resolvedExtraParameterType.isParameterizedType()) {
        maybeIssueUncheckedMatchWarning(resolvedExtraParameterType,shadowReturnType,shadow,world);
      }
      return matches;
    }
 else     if (hasExtraParameter() && kind == AdviceKind.AfterThrowing) {
      ResolvedType exceptionType=getExtraParameterType().resolve(world);
      if (!exceptionType.isCheckedException())       return true;
      UnresolvedType[] shadowThrows=shadow.getSignature().getExceptions(world);
      boolean matches=false;
      for (int i=0; i < shadowThrows.length && !matches; i++) {
        ResolvedType type=shadowThrows[i].resolve(world);
        if (exceptionType.isAssignableFrom(type))         matches=true;
      }
      return matches;
    }
 else     if (kind == AdviceKind.PerTargetEntry) {
      return shadow.hasTarget();
    }
 else     if (kind == AdviceKind.PerThisEntry) {
      return shadow.hasThis();
    }
 else     if (kind == AdviceKind.Around) {
      if (shadow.getKind() == Shadow.PreInitialization) {
        world.showMessage(IMessage.ERROR,WeaverMessages.format(WeaverMessages.AROUND_ON_PREINIT),getSourceLocation(),shadow.getSourceLocation());
        return false;
      }
 else       if (shadow.getKind() == Shadow.Initialization) {
        world.showMessage(IMessage.ERROR,WeaverMessages.format(WeaverMessages.AROUND_ON_INIT),getSourceLocation(),shadow.getSourceLocation());
        return false;
      }
 else       if (shadow.getKind() == Shadow.StaticInitialization && shadow.getEnclosingType().resolve(world).isInterface()) {
        world.showMessage(IMessage.ERROR,WeaverMessages.format(WeaverMessages.AROUND_ON_INTERFACE_STATICINIT,shadow.getEnclosingType().getName()),getSourceLocation(),shadow.getSourceLocation());
        return false;
      }
 else {
        if (getSignature().getReturnType() == ResolvedType.VOID) {
          if (shadow.getReturnType() != ResolvedType.VOID) {
            world.showMessage(IMessage.ERROR,WeaverMessages.format(WeaverMessages.NON_VOID_RETURN,shadow),getSourceLocation(),shadow.getSourceLocation());
            return false;
          }
        }
 else         if (getSignature().getReturnType().equals(UnresolvedType.OBJECT)) {
          return true;
        }
 else {
          ResolvedType shadowReturnType=shadow.getReturnType().resolve(world);
          ResolvedType adviceReturnType=getSignature().getGenericReturnType().resolve(world);
          if (shadowReturnType.isParameterizedType() && adviceReturnType.isRawType()) {
            ResolvedType shadowReturnGenericType=shadowReturnType.getGenericType();
            ResolvedType adviceReturnGenericType=adviceReturnType.getGenericType();
            if (shadowReturnGenericType.isAssignableFrom(adviceReturnGenericType) && world.getLint().uncheckedAdviceConversion.isEnabled()) {
              world.getLint().uncheckedAdviceConversion.signal(new String[]{shadow.toString(),shadowReturnType.getName(),adviceReturnType.getName()},shadow.getSourceLocation(),new ISourceLocation[]{getSourceLocation()});
            }
          }
 else           if (!shadowReturnType.isAssignableFrom(adviceReturnType)) {
            world.showMessage(IMessage.ERROR,WeaverMessages.format(WeaverMessages.INCOMPATIBLE_RETURN_TYPE,shadow),getSourceLocation(),shadow.getSourceLocation());
            return false;
          }
        }
      }
    }
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
public boolean match(Shadow shadow,World world){
  if (super.match(shadow,world)) {
    if (shadow.getKind() == Shadow.ExceptionHandler) {
      if (kind.isAfter() || kind == AdviceKind.Around) {
        world.showMessage(IMessage.WARNING,WeaverMessages.format(WeaverMessages.ONLY_BEFORE_ON_HANDLER),getSourceLocation(),shadow.getSourceLocation());
        return false;
      }
    }
    if (shadow.getKind() == Shadow.SynchronizationLock || shadow.getKind() == Shadow.SynchronizationUnlock) {
      if (kind == AdviceKind.Around) {
        world.showMessage(IMessage.WARNING,WeaverMessages.format(WeaverMessages.NO_AROUND_ON_SYNCHRONIZATION),getSourceLocation(),shadow.getSourceLocation());
        return false;
      }
    }
    if (hasExtraParameter() && kind == AdviceKind.AfterReturning) {
      ResolvedType resolvedExtraParameterType=getExtraParameterType().resolve(world);
      ResolvedType shadowReturnType=shadow.getReturnType().resolve(world);
      boolean matches=(resolvedExtraParameterType.isConvertableFrom(shadowReturnType) && shadow.getKind().hasReturnValue());
      if (matches && resolvedExtraParameterType.isParameterizedType()) {
        maybeIssueUncheckedMatchWarning(resolvedExtraParameterType,shadowReturnType,shadow,world);
      }
      return matches;
    }
 else     if (hasExtraParameter() && kind == AdviceKind.AfterThrowing) {
      ResolvedType exceptionType=getExtraParameterType().resolve(world);
      if (!exceptionType.isCheckedException())       return true;
      UnresolvedType[] shadowThrows=shadow.getSignature().getExceptions(world);
      boolean matches=false;
      for (int i=0; i < shadowThrows.length && !matches; i++) {
        ResolvedType type=shadowThrows[i].resolve(world);
        if (exceptionType.isAssignableFrom(type))         matches=true;
      }
      return matches;
    }
 else     if (kind == AdviceKind.PerTargetEntry) {
      return shadow.hasTarget();
    }
 else     if (kind == AdviceKind.PerThisEntry) {
      return shadow.hasThis();
    }
 else     if (kind == AdviceKind.Around) {
      if (shadow.getKind() == Shadow.PreInitialization) {
        world.showMessage(IMessage.WARNING,WeaverMessages.format(WeaverMessages.AROUND_ON_PREINIT),getSourceLocation(),shadow.getSourceLocation());
        return false;
      }
 else       if (shadow.getKind() == Shadow.Initialization) {
        world.showMessage(IMessage.WARNING,WeaverMessages.format(WeaverMessages.AROUND_ON_INIT),getSourceLocation(),shadow.getSourceLocation());
        return false;
      }
 else       if (shadow.getKind() == Shadow.StaticInitialization && shadow.getEnclosingType().resolve(world).isInterface()) {
        world.showMessage(IMessage.ERROR,WeaverMessages.format(WeaverMessages.AROUND_ON_INTERFACE_STATICINIT,shadow.getEnclosingType().getName()),getSourceLocation(),shadow.getSourceLocation());
        return false;
      }
 else {
        if (getSignature().getReturnType() == ResolvedType.VOID) {
          if (shadow.getReturnType() != ResolvedType.VOID) {
            world.showMessage(IMessage.ERROR,WeaverMessages.format(WeaverMessages.NON_VOID_RETURN,shadow),getSourceLocation(),shadow.getSourceLocation());
            return false;
          }
        }
 else         if (getSignature().getReturnType().equals(UnresolvedType.OBJECT)) {
          return true;
        }
 else {
          ResolvedType shadowReturnType=shadow.getReturnType().resolve(world);
          ResolvedType adviceReturnType=getSignature().getGenericReturnType().resolve(world);
          if (shadowReturnType.isParameterizedType() && adviceReturnType.isRawType()) {
            ResolvedType shadowReturnGenericType=shadowReturnType.getGenericType();
            ResolvedType adviceReturnGenericType=adviceReturnType.getGenericType();
            if (shadowReturnGenericType.isAssignableFrom(adviceReturnGenericType) && world.getLint().uncheckedAdviceConversion.isEnabled()) {
              world.getLint().uncheckedAdviceConversion.signal(new String[]{shadow.toString(),shadowReturnType.getName(),adviceReturnType.getName()},shadow.getSourceLocation(),new ISourceLocation[]{getSourceLocation()});
            }
          }
 else           if (!shadowReturnType.isAssignableFrom(adviceReturnType)) {
            world.showMessage(IMessage.ERROR,WeaverMessages.format(WeaverMessages.INCOMPATIBLE_RETURN_TYPE,shadow),getSourceLocation(),shadow.getSourceLocation());
            return false;
          }
        }
      }
    }
    return true;
  }
 else {
    return false;
  }
}