Program: 154210
Project: 154210
Buggy source:
private Integer maxScore(Role role,MachineState state,int alpha,int beta,int depth) throws GoalDefinitionException, MoveDefinitionException, TransitionDefinitionException {
  if (stateMachine.isTerminal(state)) {
    numStatesExpanded++;
    return stateMachine.getGoal(state,role);
  }
  String stateString=Canonicalizer.stateString(state);
  Integer cacheValue;
  if (externalCache != null && (cacheValue=externalCache.get(stateString)) != null) {
    extCacheHit++;
    return cacheValue;
  }
  String alphaBetaStateString=Canonicalizer.stateStringAlphaBeta(stateString,alpha,beta);
  if (useCaching && (cacheValue=maxStateScores.get(alphaBetaStateString)) != null) {
    maxCacheHit++;
    return cacheValue;
  }
  numStatesExpanded++;
  int bestValue=Integer.MIN_VALUE;
  boolean heuristicUsed=false, nullValueReturned=false;
  List<Move> moves=stateMachine.getLegalMoves(state,role);
  if (depth > maxDepth) {
    heuristicUsed=true;
    if (heuristic != null && moves.size() > 1) {
      Integer value=heuristic.getScore(state,role);
      if (value != null)       return -value;
      return null;
    }
 else {
      return null;
    }
  }
 else {
    for (    Move move : moves) {
      if (stopExecution) {
        break;
      }
      Integer value=minScore(role,move,state,alpha,beta,depth);
      if (value != null) {
        int testValue=value;
        if (value < 0) {
          testValue=-testValue;
          heuristicUsed=true;
        }
        if (testValue > bestValue)         bestValue=testValue;
        alpha=Math.max(alpha,bestValue);
        if (alpha >= beta) {
          bestValue=alpha;
          break;
        }
      }
 else {
        nullValueReturned=true;
      }
    }
    if (bestValue == 0 && nullValueReturned)     return null;
    if (bestValue == Integer.MIN_VALUE)     return null;
    if (!stopExecution && !heuristicUsed)     maxStateScores.put(alphaBetaStateString,bestValue);
    return heuristicUsed ? -bestValue : bestValue;
  }
}

Fixed version (ground truth):
private Integer maxScore(Role role,MachineState state,int alpha,int beta,int depth) throws GoalDefinitionException, MoveDefinitionException, TransitionDefinitionException {
  if (stateMachine.isTerminal(state)) {
    numStatesExpanded++;
    return stateMachine.getGoal(state,role);
  }
  String stateString=Canonicalizer.stateString(state);
  Integer cacheValue;
  if (externalCache != null && (cacheValue=externalCache.get(stateString)) != null) {
    extCacheHit++;
    return cacheValue;
  }
  String alphaBetaStateString=Canonicalizer.stateStringAlphaBeta(stateString,alpha,beta);
  if (useCaching && (cacheValue=maxStateScores.get(alphaBetaStateString)) != null) {
    maxCacheHit++;
    return cacheValue;
  }
  numStatesExpanded++;
  int bestValue=Integer.MIN_VALUE;
  boolean heuristicUsed=false, nullValueReturned=false;
  List<Move> moves=stateMachine.getLegalMoves(state,role);
  if (depth > maxDepth) {
    heuristicUsed=true;
    if (heuristic != null) {
      Integer value=heuristic.getScore(state,role);
      if (value != null)       return -value;
      return null;
    }
 else {
      return null;
    }
  }
 else {
    for (    Move move : moves) {
      if (stopExecution) {
        break;
      }
      Integer value=minScore(role,move,state,alpha,beta,depth);
      if (value != null) {
        int testValue=value;
        if (value < 0) {
          testValue=-testValue;
          heuristicUsed=true;
        }
        if (testValue > bestValue)         bestValue=testValue;
        alpha=Math.max(alpha,bestValue);
        if (alpha >= beta) {
          bestValue=alpha;
          break;
        }
      }
 else {
        nullValueReturned=true;
      }
    }
    if (bestValue == 0 && nullValueReturned)     return null;
    if (bestValue == Integer.MIN_VALUE)     return null;
    if (!stopExecution && !heuristicUsed)     maxStateScores.put(alphaBetaStateString,bestValue);
    return heuristicUsed ? -bestValue : bestValue;
  }
}