//## todo: use location to select more specifically (in Java 9+ with the location's module)
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;
  }
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() );
{
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
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 )
{