private String compoundProduce( JavaFileManager.Location location, Set<ITypeManifold> sps, String fqn, DiagnosticListener<JavaFileObject> errorHandler )
  {
    ITypeManifold found = null;
    String result = "";
    for( ITypeManifold sp: sps )
    {
      if( sp.getContributorKind() == Primary ||
          sp.getContributorKind() == Partial )
      {
        if( found != null && (found.getContributorKind() == Primary || sp.getContributorKind() == Primary) )
        {
          //## todo: use location to select more specifically (in Java 9+ with the location's module)
          List<IFile> files = sp.findFilesForType( fqn );
          JavaFileObject file = new SourceJavaFileObject( files.get( 0 ).toURI() );
          errorHandler.report( new JavacDiagnostic( file, Diagnostic.Kind.ERROR, 0, 1, 1,
            "The type, " + fqn + ", has conflicting type manifolds:\n" +
            "'" + found.getClass().getName() + "' and '" + sp.getClass().getName() + "'.\n" +
            "Either two or more resource files have the same base name or the project depends on two or more type manifolds that target the same resource type.\n" +
            "If the former, consider renaming one or more of the resource files.\n" +
            "If the latter, you must remove one or more of the type manifold libraries." ) );
        }
        else
        {
          found = sp;
          result = sp.contribute( location, fqn, false, result, errorHandler );
        }
      }
    }
    for( ITypeManifold sp: sps )
    {
      if( sp.getContributorKind() == ContributorKind.Supplemental )
      {
        result = sp.contribute( location, fqn, false, result, errorHandler );
      }
    }
    return result;
  }
private String compoundProduce( JavaFileManager.Location location, Set<ITypeManifold> sps, String fqn, DiagnosticListener<JavaFileObject> errorHandler )
  {
    ITypeManifold found = null;
    String result = "";
    for( ITypeManifold sp: sps )
    {
      if( sp.getContributorKind() == Primary ||
          sp.getContributorKind() == Partial )
      {
        if( found != null && (found.getContributorKind() == Primary || sp.getContributorKind() == Primary) )
        {
         
          List<IFile> files = sp.findFilesForType( fqn );
          JavaFileObject file = new SourceJavaFileObject( files.get( 0 ).toURI() );
          errorHandler.report( new JavacDiagnostic( file, Diagnostic.Kind.ERROR, 0, 1, 1,
            "The type, " + fqn + ", has conflicting type manifolds:\n" +
            "'" + found.getClass().getName() + "' and '" + sp.getClass().getName() + "'.\n" +
            "Either two or more resource files have the same base name or the project depends on two or more type manifolds that target the same resource type.\n" +
            "If the former, consider renaming one or more of the resource files.\n" +
            "If the latter, you must remove one or more of the type manifold libraries." ) );
        }
        else
        {
          found = sp;
          result = sp.contribute( location, fqn, false, result, errorHandler );
        }
      }
    }
    for( ITypeManifold sp: sps )
    {
      if( sp.getContributorKind() == ContributorKind.Supplemental )
      {
        result = sp.contribute( location, fqn, false, result, errorHandler );
      }
    }
    return result;
  }
private string compoundproduce( javafilemanager.location location, set<itypemanifold> sps, string fqn, diagnosticlistener<javafileobject> errorhandler ) { itypemanifold found = null; string result = ""; for( itypemanifold sp: sps ) { if( sp.getcontributorkind() == primary || sp.getcontributorkind() == partial ) { if( found != null && (found.getcontributorkind() == primary || sp.getcontributorkind() == primary) ) { list<ifile> files = sp.findfilesfortype( fqn ); javafileobject file = new sourcejavafileobject( files.get( 0 ).touri() ); errorhandler.report( new javacdiagnostic( file, diagnostic.kind.error, 0, 1, 1, "the type, " + fqn + ", has conflicting type manifolds:\n" + "'" + found.getclass().getname() + "' and '" + sp.getclass().getname() + "'.\n" + "either two or more resource files have the same base name or the project depends on two or more type manifolds that target the same resource type.\n" + "if the former, consider renaming one or more of the resource files.\n" + "if the latter, you must remove one or more of the type manifold libraries." ) ); } else { found = sp; result = sp.contribute( location, fqn, false, result, errorhandler ); } } } for( itypemanifold sp: sps ) { if( sp.getcontributorkind() == contributorkind.supplemental ) { result = sp.contribute( location, fqn, false, result, errorhandler ); } } return result; }