Skip to content

Commit

Permalink
Issue #5129 - Resource.fromReferences no longer needs DefaultFactory
Browse files Browse the repository at this point in the history
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
  • Loading branch information
joakime committed Aug 10, 2020
1 parent e809898 commit 52f5218
Showing 1 changed file with 2 additions and 13 deletions.
Expand Up @@ -1006,7 +1006,7 @@ public interface Factory
* Create a new Resource from the factory's point of view.
* <p>
* This is different then {@link ResourceFactory} in that
* it must return a {@link Resource} or throw an Exception,
* it must return a {@link Resource} or throw an IOException,
* never null.
* </p>
*
Expand All @@ -1017,17 +1017,6 @@ public interface Factory
Resource newResource(String reference) throws IOException;
}

private static class DefaultFactory implements Factory
{
public static final Factory INSTANCE = new DefaultFactory();

@Override
public Resource newResource(String reference) throws IOException
{
return Resource.newResource(reference);
}
}

/**
* Parse a delimited String of resource references and
* return the List of Resources instances it represents.
Expand All @@ -1043,7 +1032,7 @@ public Resource newResource(String reference) throws IOException
*/
public static List<Resource> fromReferences(String delimitedReferences) throws IOException
{
return fromReferences(delimitedReferences, DefaultFactory.INSTANCE);
return fromReferences(delimitedReferences, Resource::newResource);
}

/**
Expand Down

0 comments on commit 52f5218

Please sign in to comment.