private static boolean processDependencies(
      List<Decoder> decoders,
      Definition definition,
      Map<CharSequence, Definition> definitionMap,
      String[] singleStringArray)
      throws DecoderException {
    // set before to prevent stack overflow for crossed dependencies
    definition.resolved = ResolvedState.YES;

    final String[] dependencies;
    if (definition.dependency == null) {
      dependencies = definition.dependencies;
    } else {
      dependencies = singleStringArray;
      dependencies[0] = definition.dependency;
    }

    for (String dependencyId : dependencies) {
      final Definition dependency = definitionMap.get(dependencyId);
      if (dependency == null
          || dependency.resolved == ResolvedState.NO
          || (dependency.resolved == ResolvedState.UNKNOWN
              && !processDependencies(decoders, dependency, definitionMap, singleStringArray))) {
        definition.markAsUnresolved();
        // System.out.print("Mark " + definition.name + " as unresolved due to missed " +
        // dependencyId + "\n");
        definition.resolved = ResolvedState.NO;
        return false;
      }

      if (dependency.doAbcData != null) {
        decoders.add(createDecoder(dependency));
      }
    }

    return true;
  }
 private static Decoder createDecoder(Definition definition) {
   final Decoder decoder = new Decoder(definition.doAbcData, definition.doAbcData.abcModifier);
   definition.doAbcData = null;
   return decoder;
 }