Überprüft das Todo (oder das im Objekt gesetzte) und schmeisst eine invalidTodoException, wenn ddas todo gesetzt + falsch ist
437482
protected function assertTodo($todo = NULL) {
    if (func_num_args() == 0) {
      $todo = $this->todo;
    }
    
    if ($todo != NULL && !$this->validateTodo($todo)) {
      throw new InvalidTodoException('Todo: '.Code::varInfo($todo).' ist nicht in der todoMap');
    }
  }
126545
protected void validateEntityReferentialConstraint(Object entity, DAOMode mode, DAOValidatorEvaluationTime validationTime) {

		// Obtention de la liste des annotations DAO qui sont sur la classe
		List<Annotation> daoAnnotations = DAOValidatorHelper.loadDAOValidatorAnnotations(entity);
		
		// Si la liste est vide
		if(daoAnnotations == null || daoAnnotations.size() == 0) return;
		
		// On parcours cette liste
		for (Annotation daoAnnotation : daoAnnotations) {

			// Obtention de la classe du Validateur
			Class<?> validatorClass = DAOValidatorHelper.getValidationLogicClass(daoAnnotation);

			// Le validateur
			IDAOValidator<Annotation> validator = null;
			
			try {
				
				// On instancie le validateur
				validator = (IDAOValidator<Annotation>) validatorClass.newInstance();
				
				// Initialisation du Validateur
				validator.initialize(daoAnnotation, getEntityManager(), mode, validationTime);
				
			} catch (Throwable e) {
				
				// On relance l'exception
				throw new JPersistenceToolsException("ValidatorInstanciationException.message", e);
			}
			
			// Validation des contraintes d'integrites
			validator.processValidation(entity);
		}
	}
151278
def uid(self, p_todo):
        
        try:
            return self._todo_id_map[p_todo]
        except KeyError as ex:
            raise InvalidTodoException from ex
1299099
public void doTag()
            throws JspException
    {
        // report error if there are any
        if (hasErrors()) {
            reportErrors();
            return;
        }

        PageContext pageContext = getPageContext();
        ServletContainerAdapter sa = AdapterManager.getServletContainerAdapter(pageContext.getServletContext());
        ServletRequest request = pageContext.getRequest();
        assert(sa != null);

        // check to see if we are supposed to report the error
        boolean prodMode = sa.isInProductionMode();
        if (prodMode && !_alwaysReport)
            return;

        LinkedHashMap map = (LinkedHashMap)
                InternalUtils.getBindingUpdateErrors(request);

        if (map == null)
            return;

        if (_expression != null) {
            String expr = "{" + _expression + "}";
            BindingUpdateError err = (BindingUpdateError) map.get(expr);
            if (err != null) {
                Throwable cause = err.getCause();
                String msg = (cause != null) ? cause.getMessage() : err.getMessage();
                String s = Bundle.getString("Tags_BindingUpdateError", new Object[]{_expression, msg});
                registerTagError(s, null);
                reportErrors();
            }
            return;
        }

        Iterator it = map.values().iterator();
        while (it.hasNext()) {
            BindingUpdateError err = (BindingUpdateError) it.next();
            Throwable cause = err.getCause();
            String msg = (cause != null) ? cause.getMessage() : err.getMessage();
            String s = Bundle.getString("Tags_BindingUpdateError", new Object[]{err.getExpression(), msg});
            registerTagError(s, null);
        }
        reportErrors();
    }
726940
function captureException(E $e, $data=null, $logger=null, $vars=null) {
        if (in_array(get_class($e), $this->exclude)) {
            return null;
        }
        if ($data === null) {
            $data = [];
        }
        $eOriginal = $e; /** @var E $eOriginal */
        do {
			$isDFE = $e instanceof DFE;
            $exc_data = [
            	'type' => $isDFE ? $e->sentryType() : get_class($e)
				,'value' => $this->serializer->serialize($isDFE ? $e->messageSentry() : $e->getMessage())
			];
            /**'exception'
             * Exception::getTrace doesn't store the point at where the exception
             * was thrown, so we have to stuff it in ourselves. Ugh.
             */
            $trace = $e->getTrace();
            /**
			 * 2016-12-22
			 * Убираем @see \Magento\Framework\App\ErrorHandler
			 * 2016-12-23
			 * И @see Breadcrumbs\ErrorHandler тоже убираем.
			 */
            /** @var bool $needAddFaceFrame */
            $needAddFakeFrame = !self::needSkipFrame($trace[0]);
			while (self::needSkipFrame($trace[0])) {
				array_shift($trace);
			}
            if ($needAddFakeFrame) {
				$frame_where_exception_thrown = array(
					'file' => $e->getFile(),
					'line' => $e->getLine(),
				);
				array_unshift($trace, $frame_where_exception_thrown);
			}
            $exc_data['stacktrace'] = array(
                'frames' => Stacktrace::get_stack_info(
                    $trace, $this->trace, $vars, $this->message_limit, $this->prefixes,
                    $this->app_path, $this->excluded_app_paths, $this->serializer, $this->reprSerializer
                ),
            );
            $exceptions[] = $exc_data;
        } while ($e = $e->getPrevious());
        $data['exception'] = array('values' => array_reverse($exceptions),);
        if ($logger !== null) {
            $data['logger'] = $logger;
        }
        if (empty($data['level'])) {
            if (method_exists($eOriginal, 'getSeverity')) {
                $data['level'] = $this->translateSeverity($eOriginal->getSeverity());
            }
            else {
                $data['level'] = self::ERROR;
            }
        }
        return $this->capture($data, $trace, $vars);
    }
1140687
public void error(String domain, String key, XMLParseException exception)
			throws XNIException {
		schemaParsingErrors.add("[xs-error] " + exception.getMessage());
	}
1290829
public void doTag()
            throws JspException
    {
        JspTag parentTag = SimpleTagSupport.findAncestorWithClass(this, IFormattable.class);

        // if there are errors we need to either add these to the parent AbstractBastTag or report an error.
        if (hasErrors()) {
            if (parentTag instanceof IFormattable) {
                IFormattable parent = (IFormattable) parentTag;
                parent.formatterHasError();
            }
            reportErrors();
            return;
        }

        if (parentTag instanceof IFormattable) {
            StringFormatter formatter = new StringFormatter();
            formatter.setPattern(_pattern);
            formatter.setTruncate(truncate);
            IFormattable parent = (IFormattable) parentTag;
            parent.addFormatter(formatter);
        }
        else {
            String s = Bundle.getString("Tags_FormattableParentRequired");
            registerTagError(s, null);
            reportErrors();
        }
    }
181488
@Override
	public void executeTemplate(String templateName, Map<String, Object> properties, String workDir) {
		// Pobieranie definicji szablonu do użycia:
		Template<?> template = templateProvider.get(templateName, null, null, null);
		if(template == null) {
			throw new RuntimeException("Nie znaleziono szablonu " + templateName);
		}
		if(template.isAbstract()) {
			throw new AbstractTemplateException(templateName);
		}

		// Weryfikowanie definicji szablonu, szablonu nadrzędnego i wszystkich
		// szablonów używanych. Sprawdzanie dostępność klas silników generatorów.
		templateVerifier.verifyTemplate(template, templateProvider);

		MapStack<String, Object> propertiesStack = new SimpleMapStack<String,Object>();
		propertiesStack.push(new HashMap<String, Object>(properties));
		doExecuteTemplate(template, propertiesStack, workDir);
		propertiesStack.pop();
	}
578100
public static Fix deleteExceptions(
      MethodTree tree, final VisitorState state, List<ExpressionTree> toDelete) {
    List<? extends ExpressionTree> trees = tree.getThrows();
    if (toDelete.size() == trees.size()) {
      return SuggestedFix.replace(
          getThrowsPosition(tree, state) - 1, state.getEndPosition(getLast(trees)), "");
    }
    String replacement =
        FluentIterable.from(tree.getThrows())
            .filter(Predicates.not(Predicates.in(toDelete)))
            .transform(
                new Function<ExpressionTree, String>() {
                  @Override
                  @Nullable
                  public String apply(ExpressionTree input) {
                    return state.getSourceForNode(input);
                  }
                })
            .join(Joiner.on(", "));
    return SuggestedFix.replace(
        ((JCTree) tree.getThrows().get(0)).getStartPosition(),
        state.getEndPosition(getLast(tree.getThrows())),
        replacement);
  }
318873
public function byIdentifierList($list, $sep = ',', $idname = 'id', $checkCardinality = TRUE, &$parsed = NULL, &$found = NULL) {
    if ($list == NULL) {
      return array();
    }
    
    if (is_array($list)) {
      $identifiers = $list;
    } else {
      $identifiers = explode($sep, trim($list));
    }
    $identifiers = array_map('trim',$identifiers);
    $identifiers = array_filter($identifiers, function ($identifier) {
      return !empty($identifier); // schließt auch 0 aus
    });
    
    $parsed = count($identifiers);
    if (count($identifiers) == 0) return array();
    $result = $this->getRepository()->findAllByIds($identifiers, $idname);
    
    $found = count($result);
    
    if ($checkCardinality && ($parsed != $found)) {
      throw new \Psc\Exception('Es konnten nicht alle identifier aus der Liste hydriert werden! Gefunden aus '.$list.': '.Code::varInfo($identifiers).' in der DB gefunden #'.count($result));
    }
    
    return $result;
  }
1330605
int delValueSet(int type, Object id) {
        final String methodName = "delValueSet()";
        int returnCode = NO_EXCEPTION;
        Exception diskException = null;
        HashtableOnDisk cache_instance = null;
        HashtableOnDisk vshtod = null;
        try {
            rwLock.writeLock().lock();
            if (type == DEP_ID_DATA) {
                cache_instance = dependency_cache;
            } else {
                cache_instance = template_cache;
            }
            //if (this.testException) {
            //    throw new FileManagerException("*** Generate filemanager exception");
            //}
            Long vsinstid = (Long) cache_instance.get(id);
            if (vsinstid != null) {
                //
                // Existing instance.  Get it and clear it.  Can't think of a better way to do this.
                //
                long vsinstance = vsinstid.longValue();
                FileManager filemgr = cache_instance.getFileManager();
                if (vsinstance != -1) {
                    vshtod = HashtableOnDisk.getInstance(filemgr, valueset_rehash, vsinstance, !HashtableOnDisk.HAS_CACHE_VALUE, this);
                    vshtod.clear();
                    vshtod.close();
                    vshtod = null;
                    HashtableOnDisk.destroyInstance(filemgr, vsinstance);
                }
                cache_instance.remove(id);
            }
        } catch (FileManagerException ex) {
            this.diskCacheException = ex;
            diskException = ex;
            returnCode = DISK_EXCEPTION;
        } catch (HashtableOnDiskException ex) {
            this.diskCacheException = ex;
            diskException = ex;
            returnCode = DISK_EXCEPTION;
        } catch (IOException ex) {
            this.diskCacheException = ex;
            diskException = ex;
            returnCode = DISK_EXCEPTION;
        } catch (Exception ex) {
            returnCode = OTHER_EXCEPTION;
            diskException = ex;
        } finally {
            if (returnCode != NO_EXCEPTION) {
                if (tc.isDebugEnabled())
                    Tr.debug(tc, methodName, "cacheName=" + this.cacheName + "\n Exception: " + ExceptionUtility.getStackTrace(diskException));
            }
            if (returnCode == DISK_EXCEPTION || returnCode == OTHER_EXCEPTION) {
                com.ibm.ws.ffdc.FFDCFilter.processException(diskException, "com.ibm.ws.cache.HTODDynacache.delValueSet", "1811", this);
            }
            try {
                if (vshtod != null) {
                    vshtod.close();
                }
            } catch (Exception ex) {
                com.ibm.ws.ffdc.FFDCFilter.processException(ex, "com.ibm.ws.cache.HTODDynacache.delValueSet", "1818", this);
            }
            rwLock.writeLock().unlock();
        }

        return returnCode;
    }
221131
public void execute() throws DevFailed {
        GroupCmdReplyList replies;
        if (isArginVoid()) {
            replies = group.command_inout(commandName, true);
        } else {
            replies = group.command_inout(commandName, inData, true);
        }
        if (replies.has_failed()) {
            // get data to throw e
            for (final Object obj : replies) {
                ((GroupCmdReply) obj).get_data();
            }
        }
    }
466316
@Override
    public String[] invalidateCacheIDs(String cacheInstance, String pattern, boolean waitOnInvalidation) throws javax.management.AttributeNotFoundException {

        // Get the cache for this cacheInstance
        DCache cache1 = getCache(cacheInstance);

        //Check to see if request is to clear the cache
        if (pattern.equals("*")) {
            cache1.clear();
            if (tc.isDebugEnabled())
                Tr.debug(tc, "invalidateCacheIDs: Exiting. Cleared memory and disk cache since input pattern is *");
            return new String[] { "*" };
        }

        // Check that the input pattern is a valid regular expression
        Pattern cpattern = checkPattern(pattern);

        // Get union of matches in memory and on disk
        Collection<String> invalidateSet = new ArrayList<String>();

        // Call mbeans to get matches in memory and on disk.
        String[] memoryMatches = getCacheIDsInMemory(cacheInstance, pattern);
        if (null != memoryMatches) {
            for (int i = 0; i < memoryMatches.length; i++) {
                invalidateSet.add(memoryMatches[i]);
            }
        }
        if (cache1.getSwapToDisk()) {
            String[] diskMatches = getCacheIDsOnDisk(cacheInstance, pattern);
            if (null != diskMatches) {
                for (int i = 0; i < diskMatches.length; i++) {
                    invalidateSet.add(diskMatches[i]);
                }
            }
        }

        Iterator invalidates = invalidateSet.iterator();
        // Invalidate the set of cache ids matched to the pattern and all
        // entries dependent on the matched entry
        while (invalidates.hasNext()) {
            Object cacheID = invalidates.next();
            cache1.invalidateById(cacheID, waitOnInvalidation);
        }

        if (tc.isDebugEnabled())
            Tr.debug(tc, "invalidateCacheIDs: Exiting. Number of matches found = " + invalidateSet.size());

        //need to convert to string array before return.
        //Allocate output array #entries matched 
        String[] cids = invalidateSet.toArray(new String[invalidateSet.size()]);
        return cids;
    }
1132077
public boolean propagateValue(String destPath, String value, boolean tryToCreate, boolean allowOverwrite) {
        boolean ret = false;

        if (destPath.equals(getPath())) {
            if (value != null && value.equals("requested"))
                this.haveRequestTag = true;
            else
                throw new HBCI_Exception(HBCIUtils.getLocMsg("EXCMSG_INVVALUE", new Object[]{destPath, value}));
            ret = true;
        } else {
            // damit überspringen wir gleich elemente, bei denen es mit
            // sicherheit nicht funktionieren kann
            if (destPath.startsWith(getPath())) {
                for (MultipleSyntaxElements l : childContainers) {
                    if (l.propagateValue(destPath, value, tryToCreate, allowOverwrite)) {
                        ret = true;
                        break;
                    }
                }

                if (!ret && tryToCreate) {
                    // der Wert konnte nicht gesetzt werden -> möglicherweise
                    // existiert ja nur der entsprechende child-container noch
                    // nicht
                    log.trace(getPath() + ": could not set value for " + destPath);

                    // Namen des fehlenden Elementes ermitteln
                    String subPath = destPath.substring(getPath().length() + 1);
                    log.trace("  subpath is " + subPath);
                    int dotPos = subPath.indexOf('.');
                    if (dotPos == -1) {
                        dotPos = subPath.length();
                    }
                    String subType = subPath.substring(0, dotPos);
                    log.trace("  subname is " + subType);
                    int counterPos = subType.indexOf('_');
                    if (counterPos != -1) {
                        subType = subType.substring(0, counterPos);
                    }
                    log.trace("  subType is " + subType);

                    // hier überprüfen, ob es wirklich noch keinen child-container
                    // mit diesem Namen gibt. Wenn z.B. der pfad msg.gv.ueb.kik.blz
                    // gesucht wird und msg.gv schon existiert, wird diese methode
                    // hier in msg.gv ausgeführt. wenn sie fehlschlägt (z.b. weil
                    // tatsächlich kein .ueb.kik.blz angelegt werden kann), wird false
                    // ("can not propagate") zurückgegeben. im übergeordneten modul
                    // (msg) soll dann nicht versucht werden, das nächste sub-element
                    // (gv) anzulegen - dieser test merkt, dass es "gv" schon gibt
                    boolean found = false;
                    for (MultipleSyntaxElements c : childContainers) {
                        if (c.getName().equals(subType)) {
                            found = true;
                            break;
                        }
                    }

                    if (!found) {
                        // jetzt durch alle child-elemente des definierenden XML-Knotens
                        // loopen und den ref-Knoten suchen, der das fehlende Element
                        // beschreibt
                        int newChildIdx = 0;
                        Node ref;
                        found = false;
                        for (ref = def.getFirstChild(); ref != null; ref = ref.getNextSibling()) {
                            if (ref.getNodeType() == Node.ELEMENT_NODE) {
                                String type = ((Element) ref).getAttribute("type");
                                String name = ((Element) ref).getAttribute("name");
                                if (name.length() == 0) {
                                    name = type;
                                }
                                if (name.equals(subType)) {
                                    found = true;
                                    break;
                                }
                                newChildIdx++;
                            }
                        }

                        if (found) {
                            // entsprechenden child-container erzeugen
                            MultipleSyntaxElements child = createNewChildContainer(ref, document);
                            child.setParent(this);
                            child.setSyntaxIdx(newChildIdx);

                            if (getElementTypeName().equals("MSG"))
                                log.trace("child container " + child.getPath() + " has syntaxIdx=" + child.getSyntaxIdx());

                            // aktuelle child-container-liste durchlaufen und den neu
                            // erzeugten child-container dort richtig einsortieren
                            int newPosi = 0;
                            for (MultipleSyntaxElements c : childContainers) {
                                if (c.getSyntaxIdx() > newChildIdx) {
                                    // der gerade betrachtete child-container hat einen idx
                                    // gröÃer als den des einzufügenden elementes, also wird
                                    // sich diese position gemerkt und das element hier eingefügt
                                    break;
                                }
                                newPosi++;
                            }
                            log.trace("  inserting child container with syntaxIdx " + newChildIdx + " at position " + newPosi);
                            childContainers.add(newPosi, child);

                            // now try to propagate the value to the newly created child
                            ret = child.propagateValue(destPath, value, tryToCreate, allowOverwrite);
                        }
                    } else {
                        log.trace("  subtype " + subType + " already existing - will not try to create");
                    }
                }
            }
        }

        return ret;
    }
106789
public function synchronizeCollectionNormal($entity, $field, $toCollection, Type $type) {
    if (!$this->dc) {
      throw new \RuntimeException('DCPackage muss für synchronizeCollectionNormal gesetzt sein');
    }
    
    $entityMeta = $this->dc->getEntityMeta($entity->getEntityName());
    $entityClassMeta = $entityMeta->getClassMetadata();
    $entityAssoc = $entityClassMeta->getAssociationMapping($field);
    $fromCollection = $entity->callGetter($field);
    
    if (!$entityClassMeta->isCollectionValuedAssociation($field)) {
      throw new \RuntimeException('Das Property '.$entity->getEntityName().'->'.$field.' ist keine Collection und kann somit nicht synchronisiert werden');
    }
      
    $adder = $remover = NULL;
    
    if ($entityClassMeta->isAssociationInverseSide($field)) {
      $otherMeta = $this->dc->getEntityMeta($entityAssoc['targetEntity']);
      $otherMetaClass = $otherMeta->getClassMetadata();
      $otherProperty = $entityAssoc['mappedBy'];
      $otherIsCollection = $otherMetaClass->isCollectionValuedAssociation($otherProperty);
      
      $addOrSet = $otherIsCollection
              ? 'add'.ucfirst($otherProperty)
              : 'set'.ucfirst($otherProperty);
      
      // da der CollectionSynchronizer nur die owningSide automatisch pflegt, injecten wir hier den adder und remover um die inverse Side zu pflegen
      $adder = function ($entity, $toEntity, $repository) use ($addOrSet) {
        $repository->persist($toEntity);
        $toEntity->$addOrSet($entity);
      };

      if ($otherIsCollection) {
        $remove = 'remove'.ucfirst($otherProperty);
        $remover = function ($entity, $toEntity, $repository) use ($remove) {
          $repository->persist($toEntity);
          $toEntity->$remove($entity);
        };
      } else {
        $set = 'set'.ucfirst($otherProperty);
        $remover = function ($entity, $toEntity, $repository) use ($set) {
          $repository->persist($toEntity);
          $toEntity->$set(NULL);
        };
      }
    }
    
    $synchronizer = CollectionSynchronizer::createFor($entity->getEntityName(), $field, $this->dc);
    $synchronizer->init($entity, $adder, $remover);
    return $synchronizer->process($fromCollection, $toCollection);
  }
755744
public final void mDigits() throws RecognitionException {
		try {
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1323:7: ( Digit ( ( DigitOrUnderscore )* Digit )? )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1323:9: Digit ( ( DigitOrUnderscore )* Digit )?
			{
			mDigit(); 

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1323:15: ( ( DigitOrUnderscore )* Digit )?
			int alt18=2;
			int LA18_0 = input.LA(1);
			if ( ((LA18_0 >= '0' && LA18_0 <= '9')||LA18_0=='_') ) {
				alt18=1;
			}
			switch (alt18) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1323:16: ( DigitOrUnderscore )* Digit
					{
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1323:16: ( DigitOrUnderscore )*
					loop17:
					while (true) {
						int alt17=2;
						int LA17_0 = input.LA(1);
						if ( ((LA17_0 >= '0' && LA17_0 <= '9')) ) {
							int LA17_1 = input.LA(2);
							if ( ((LA17_1 >= '0' && LA17_1 <= '9')||LA17_1=='_') ) {
								alt17=1;
							}

						}
						else if ( (LA17_0=='_') ) {
							alt17=1;
						}

						switch (alt17) {
						case 1 :
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:
							{
							if ( (input.LA(1) >= '0' && input.LA(1) <= '9')||input.LA(1)=='_' ) {
								input.consume();
							}
							else {
								MismatchedSetException mse = new MismatchedSetException(null,input);
								recover(mse);
								throw mse;
							}
							}
							break;

						default :
							break loop17;
						}
					}

					mDigit(); 

					}
					break;

			}

			}

		}
		finally {
			// do for sure before leaving
		}
	}
206618
static MolgenisValidationException translateInvalidIntegerException(PSQLException pSqlException) {
    ServerErrorMessage serverErrorMessage = pSqlException.getServerErrorMessage();
    String message = serverErrorMessage.getMessage();
    Matcher matcher =
        Pattern.compile("invalid input syntax for \\b(?:type )?\\b(.+?): \"(.*?)\"")
            .matcher(message);
    boolean matches = matcher.matches();
    if (!matches) {
      throw new RuntimeException(ERROR_TRANSLATING_EXCEPTION_MSG, pSqlException);
    }
    String postgreSqlType = matcher.group(1);

    // convert PostgreSQL data type to attribute type:
    String type;
    switch (postgreSqlType) {
      case "boolean":
        type = BOOL.toString();
        break;
      case "date":
        type = DATE.toString();
        break;
      case "timestamp with time zone":
        type = DATE_TIME.toString();
        break;
      case "double precision":
        type = DECIMAL.toString();
        break;
      case "integer":
        type = INT.toString() + " or " + LONG.toString();
        break;
      default:
        type = postgreSqlType;
        break;
    }
    String value = matcher.group(2);

    ConstraintViolation constraintViolation =
        new ConstraintViolation(
            format("Value [%s] of this entity attribute is not of type [%s].", value, type), null);
    return new MolgenisValidationException(singleton(constraintViolation));
  }