Mercurial > dive4elements > river
diff artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/util/CalculationUtils.java @ 9311:7c7f73e5e01e
Moved chart metadata line to top of chart. Minor cleanup.
author | gernotbelger |
---|---|
date | Thu, 26 Jul 2018 11:16:06 +0200 |
parents | d9dbf0b74bc2 |
children |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/util/CalculationUtils.java Thu Jul 26 11:08:11 2018 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/util/CalculationUtils.java Thu Jul 26 11:16:06 2018 +0200 @@ -18,7 +18,6 @@ */ public final class CalculationUtils { - private CalculationUtils() { throw new UnsupportedOperationException("Helper class"); } @@ -31,6 +30,17 @@ * @param context */ public static String findArtifactUser(final CallContext context, final Artifact artifact) { + + // REMARK: can't do that, because sometimes the user inside the collection is a fake user + // if (context instanceof CollectionCallContext) { + // /* avoid db access if we already know the user */ + // final CollectionCallContext ccc = (CollectionCallContext) context; + // final ArtifactCollection collection = ccc.getCollection(); + // final User user = collection.getUser(); + // if (user != null) + // return user.getName(); + // } + final ArtifactDatabase database = context.getDatabase(); return database.findArtifactUser(artifact.identifier()); }