Examples of ResolutionException


Examples of com.tuenti.supernanny.repo.exceptions.ResolutionException

    for (Requirement requirement : artifact.getRequirements()) {
      boolean matched = false;
      for (Artifact a : chosenArtifacts) {
        if (requirement.getName().equals(a.getName())) {
          if (!requirement.matches(a.getName(), a.getVersion())) {
            throw new ResolutionException("Requirement conflict: "
                + artifact.toShortString() + " depends on " + requirement + " but "
                + a.toShortString() + " is already selected.");
          } else {
            // check if the major version is different to throw a
            // warning
View Full Code Here

Examples of com.tuenti.supernanny.repo.exceptions.ResolutionException

          return a;
        }
      }
    }
   
    throw new ResolutionException("No artifact found for " + req);
  }
View Full Code Here

Examples of com.tuenti.supernanny.repo.exceptions.ResolutionException

    List<Requirement> reqs = new LinkedList<Requirement>();
    if (depFile.exists()) {
      try {
        reqs = dparser.parseDepsFile(depFile);
      } catch (Exception e) {
        throw new ResolutionException(e);
      }
    }
    List<Artifact> artifacts = new ArrayList<Artifact>();
    // return artifact with wildcard version so it matches everything
    artifacts.add(new Artifact(req.getName(), new Version("*"), this, reqs));
View Full Code Here

Examples of com.tuenti.supernanny.repo.exceptions.ResolutionException

        ri.changeset = getStrategy().resolveReference(uri, ri.refname);
        return ri;
      }
    }
   
    throw new ResolutionException("Can't find artifact for " + req);
  }
View Full Code Here

Examples of com.tuenti.supernanny.repo.exceptions.ResolutionException

      }
      List<Artifact> artifacts = new ArrayList<Artifact>();
      artifacts.add(new DVCSArtifact(req.getName(), ri.reqVersion, this, ri.changeset, subDir, reqs));
      return artifacts;
    } catch (Exception e) {
      throw new ResolutionException(e);
    }
  }
View Full Code Here

Examples of fr.imag.adele.apam.ResolutionException

      /*
       * If no exception is specified throw ResolutionException
       */
      String exceptionName = relToResolve.getMissingException();
      if (exceptionName == null) {
        throw new ResolutionException();
      }

      /*
       * Try to find the component declaring the relation that specified
       * the Exception to throw
       *
       * TODO BUG : the class should be loaded using the bundle context of
       * the component where the relation is declared. This can be either
       * the specification, or the implementation of the source component,
       * or a composite in the case of contextual dependencies. The
       * current implementation may not handle every case.
       *
       * The best solution is to modify relationDeclaration to load the
       * exception class, but this is not possible at compile time, so we
       * can not change the signature of
       * relationDeclaration.getMissingException.
       *
       * A possible solution is to move this method to relationDeclaration
       * and make it work only at runtime, but we need to consider merge
       * of contextual dependencies and use the correct bundle context.
       *
       * Evaluate changes to relationDeclaration, relation,
       * CoreMetadataParser and computeEffectiverelation
       */
      Component declaringComponent = source;
      while (declaringComponent != null) {

        RelationDeclaration declaration = declaringComponent.getDeclaration().getRelation(relToResolve.getName());
        if (declaration != null && declaration.getMissingException() != null && declaration.getMissingException().equals(exceptionName)) {
          break;
        }

        declaringComponent = declaringComponent.getGroup();
      }

      if (declaringComponent == null && source instanceof Instance) {
        declaringComponent = ((Instance) source).getComposite().getCompType();
      }

      if (declaringComponent == null) {
        throw new ResolutionException();
      }

      /*
       * throw the specified exception
       */

      Class<?> exceptionClass = declaringComponent.getApformComponent().getBundle().loadClass(exceptionName);
      Exception exception = Exception.class.cast(exceptionClass.newInstance());

      FailedResolutionManager.<RuntimeException> doThrow(exception);

    } catch (ClassNotFoundException e) {
      throw new ResolutionException(e);
    } catch (InstantiationException e) {
      throw new ResolutionException(e);
    } catch (IllegalAccessException e) {
      throw new ResolutionException(e);
    }

  }
View Full Code Here

Examples of javax.enterprise.inject.ResolutionException

    throws ResolutionException
    {
        Set<Bean<?>> beans = getBeanManager().getBeans(type, qualifiers);
        if (beans == null || beans.isEmpty())
        {
            throw new ResolutionException("cannot find beans for class " + type.getCanonicalName());
        }

        if (beans.size() > 1)
        {
            throw new AmbiguousResolutionException("cannot find beans for class " + type.getCanonicalName());
View Full Code Here

Examples of lombok.ast.ResolutionException

    String packageName = null;
    if (value instanceof Select) {
      List<String> chain = unwrapSelectChain((Select) value);
      switch (chain.size()) {
      case 0:
        throw new ResolutionException(value, "empty");
      default:
        packageName = Joiner.on('.').join(chain.subList(0, chain.size() - 2));
      case 2:
        typeName = chain.get(chain.size() - 2);
      case 1:
        enumName = chain.get(chain.size() - 1);
      }
     
      boolean unexpectedType = false;
      if (packageName != null) {
        Package p = enumClass.getPackage();
        unexpectedType = p != null && !p.getName().equals(packageName);
      }
      unexpectedType |= (typeName != null && !enumClass.getSimpleName().equals(typeName));
     
      if (unexpectedType) throw new ResolutionException(value, "Expected " + enumClass.getName() + " and not " + packageName + "." + typeName);
    }
   
    for (E enumConstant : enumClass.getEnumConstants()) {
      String target = enumConstant.name();
      if (target.equals(enumName)) return enumConstant;
    }
   
    throw new ResolutionException(value, "Not a valid value for enum " + enumClass.getSimpleName() + ": " + enumName);
  }
View Full Code Here

Examples of org.apache.felix.sigil.common.repository.ResolutionException

            resolution.setSuccess(valid);
        }

        public ResolutionException newResolutionException()
        {
            return new ResolutionException(root,
                requirements.toArray(new IModelElement[requirements.size()]));
        }
View Full Code Here

Examples of org.jboss.gravia.resolver.ResolutionException

                state.getResult().put(res, wires);
                return space;
            }
        }

        ResolutionException resex = rescan.getResolutionException();
        if (resex != null) {
            throw resex;
        }

        if (spaces.getResourceSpace(res) == null) {
            List<Requirement> manreqs = res.getRequirements(null);
            Iterator<Requirement> itreqs = manreqs.iterator();
            while (itreqs.hasNext()) {
                if (itreqs.next().isOptional()) {
                    itreqs.remove();
                }
            }
            throw new ResolutionException("Requirements map to candidates in disconnetced spaces", null, manreqs);
        }
        return null;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.