Buggy code:
@ InjectSupport public class BaremacionFAP { @ Inject public static GestorDocumentalService gestorDocumentalService ; public static void iniciarBaremacion ( ) { } public static void validarCEconomicos ( long idSolicitud , List < CEconomico > ceconomicos ) { } public static void validarCEconomicosCopia ( long idSolicitud , List < CEconomico > ceconomicos ) { } public static List < Documento > getDocumentosAccesibles ( Long idSolicitud , Long idEvaluacion ) { } public static void iniciarNuevasEvaluaciones ( ) { try { TipoEvaluacion tipoEvaluacion = TipoEvaluacion . all ( ) . first ( ) ; String [ ] estadosSolicitud = null ; List < String > lstEstadosSolicitud = null ; if ( ( ( FapProperties . get ( "fap.baremacion.iniciar.estados" ) ) != null ) && ( ! ( FapProperties . get ( "fap.baremacion.iniciar.estados" ) . isEmpty ( ) ) ) ) estadosSolicitud = FapProperties . get ( "fap.baremacion.iniciar.estados" ) . replaceAll ( "\\s" , "" ) . trim ( ) . split ( "," ) ; if ( estadosSolicitud != null ) lstEstadosSolicitud = Arrays . asList ( estadosSolicitud ) ; if ( ( tipoEvaluacion != null ) && ( lstEstadosSolicitud != null ) ) { <START_BUG> final String query = "select<seq2seq4repair_space>solicitud<seq2seq4repair_space>from<seq2seq4repair_space>Solicitud<seq2seq4repair_space>solicitud<seq2seq4repair_space>" + ( ( "where<seq2seq4repair_space>solicitud.estado<seq2seq4repair_space>in<seq2seq4repair_space>(:estadosSolicitud)<seq2seq4repair_space>and<seq2seq4repair_space>" + "exists<seq2seq4repair_space>(select<seq2seq4repair_space>evaluacion<seq2seq4repair_space>from<seq2seq4repair_space>Evaluacion<seq2seq4repair_space>evaluacion<seq2seq4repair_space>" ) + "where<seq2seq4repair_space>evaluacion.tipo.id=:tipoEvaluacion<seq2seq4repair_space>and<seq2seq4repair_space>evaluacion.solicitud<seq2seq4repair_space>=<seq2seq4repair_space>solicitud)" ) ; <END_BUG> List < SolicitudGenerica > solicitudesSinEvaluacion = SolicitudGenerica . find ( query ) . setParameter ( "tipoEvaluacion" , tipoEvaluacion . id ) . setParameter ( "estadosSolicitud" , lstEstadosSolicitud ) . fetch ( ) ; if ( solicitudesSinEvaluacion != null ) Logger . info ( ( ( ( "Se<seq2seq4repair_space>van<seq2seq4repair_space>a<seq2seq4repair_space>crear<seq2seq4repair_space>" + ( solicitudesSinEvaluacion . size ( ) ) ) + "<seq2seq4repair_space>nuevas<seq2seq4repair_space>evaluaciones<seq2seq4repair_space>de<seq2seq4repair_space>las<seq2seq4repair_space>solicitudes:<seq2seq4repair_space>" ) + ( solicitudesSinEvaluacion . toString ( ) ) ) ) ; for ( SolicitudGenerica solicitud : solicitudesSinEvaluacion ) { Evaluacion evaluacion = new Evaluacion ( ) ; evaluacion . init ( tipoEvaluacion ) ; evaluacion . solicitud = solicitud ; for ( CEconomico ceconomicoS : solicitud . ceconomicos ) { for ( CEconomico ceconomicoE : evaluacion . ceconomicos ) { if ( ( ceconomicoE . tipo . nombre . equals ( ceconomicoS . tipo . nombre ) ) && ( ceconomicoE . tipo . jerarquia . equals ( ceconomicoS . tipo . jerarquia ) ) ) { for ( int i = 0 ; i < ( tipoEvaluacion . duracion ) ; i ++ ) { ceconomicoE . valores . get ( i ) . valorSolicitado = ceconomicoS . valores . get ( i ) . valorSolicitado ; } break ; } } if ( ceconomicoS . tipo . tipoOtro ) { for ( CEconomicosManuales ceconomicoManual : ceconomicoS . otros ) { for ( CEconomico ceconomicoE : evaluacion . ceconomicos ) { if ( ( ceconomicoE . tipo . nombre . equals ( ceconomicoManual . tipo . nombre ) ) && ( ceconomicoE . tipo . jerarquia . equals ( ceconomicoManual . tipo . jerarquia ) ) ) { for ( int i = 0 ; i < ( tipoEvaluacion . duracion ) ; i ++ ) { ceconomicoE . valores . get ( i ) . valorSolicitado = ceconomicoManual . valores . get ( i ) . valorSolicitado ; } break ; } } } } } evaluacion . save ( ) ; } } else Logger . error ( "No<seq2seq4repair_space>se<seq2seq4repair_space>ha<seq2seq4repair_space>podido<seq2seq4repair_space>iniciar<seq2seq4repair_space>una<seq2seq4repair_space>nueva<seq2seq4repair_space>evaluacion,<seq2seq4repair_space>el<seq2seq4repair_space>tipo<seq2seq4repair_space>de<seq2seq4repair_space>evaluación<seq2seq4repair_space>o<seq2seq4repair_space>los<seq2seq4repair_space>estados<seq2seq4repair_space>de<seq2seq4repair_space>la<seq2seq4repair_space>solicitud<seq2seq4repair_space>son<seq2seq4repair_space>null" ) ; } catch ( Exception e ) { Logger . error ( ( "No<seq2seq4repair_space>se<seq2seq4repair_space>ha<seq2seq4repair_space>podido<seq2seq4repair_space>iniciar<seq2seq4repair_space>una<seq2seq4repair_space>nueva<seq2seq4repair_space>evaluacion:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } } public static void setOficialEvaluacion ( Long idSolicitud , Long idEvaluacion ) throws Exception { } public static void validarCEconomicosEvaluados ( long idSolicitud , List < CEconomico > ceconomicos ) { } public static void finalizarEvaluaciones ( ) { } public static void recalcularEvaluaciones ( ) { } public static boolean checkFinalizarEvaluacion ( Evaluacion evaluacion ) { } }

Fix:
final String query = "select<seq2seq4repair_space>solicitud<seq2seq4repair_space>from<seq2seq4repair_space>Solicitud<seq2seq4repair_space>solicitud<seq2seq4repair_space>" + ( ( "where<seq2seq4repair_space>solicitud.estado<seq2seq4repair_space>in<seq2seq4repair_space>(:estadosSolicitud)<seq2seq4repair_space>and<seq2seq4repair_space>" + "not<seq2seq4repair_space>exists<seq2seq4repair_space>(select<seq2seq4repair_space>evaluacion<seq2seq4repair_space>from<seq2seq4repair_space>Evaluacion<seq2seq4repair_space>evaluacion<seq2seq4repair_space>" ) + "where<seq2seq4repair_space>evaluacion.tipo.id=:tipoEvaluacion<seq2seq4repair_space>and<seq2seq4repair_space>evaluacion.solicitud<seq2seq4repair_space>=<seq2seq4repair_space>solicitud)" ) ;