From 57f7045bd9656aa23644d8ccbe76c0cecb34e4a3 Mon Sep 17 00:00:00 2001 From: yegor256 Date: Thu, 20 Jul 2017 13:26:26 +0300 Subject: [PATCH] #37 guava replaced with cactoos --- pom.xml | 8 ++++---- src/main/java/io/jare/cached/CdBase.java | 6 +++--- src/main/java/io/jare/tk/TkRelay.java | 8 +++++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/pom.xml b/pom.xml index 721e44e..fe3eda7 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ com.jcabi parent - 0.47 + 0.48.5 io.jare web @@ -111,9 +111,9 @@ 0.22 - com.google.guava - guava - 19.0 + org.cactoos + cactoos + 0.11.4 org.hamcrest diff --git a/src/main/java/io/jare/cached/CdBase.java b/src/main/java/io/jare/cached/CdBase.java index 703503c..104d039 100644 --- a/src/main/java/io/jare/cached/CdBase.java +++ b/src/main/java/io/jare/cached/CdBase.java @@ -22,7 +22,6 @@ */ package io.jare.cached; -import com.google.common.collect.Iterables; import com.jcabi.aspects.Cacheable; import io.jare.model.Base; import io.jare.model.Domain; @@ -30,6 +29,7 @@ import java.util.concurrent.TimeUnit; import lombok.EqualsAndHashCode; import lombok.ToString; +import org.cactoos.list.MappedIterable; /** * Cached Base. @@ -64,7 +64,7 @@ public User user(final String name) { @Override @Cacheable(lifetime = 1, unit = TimeUnit.MINUTES) public Iterable domain(final String name) { - return Iterables.transform( + return new MappedIterable<>( this.origin.domain(name), CdDomain::new ); @@ -73,7 +73,7 @@ public Iterable domain(final String name) { @Override @Cacheable(unit = TimeUnit.HOURS, lifetime = 1) public Iterable all() { - return Iterables.transform( + return new MappedIterable<>( this.origin.all(), CdDomain::new ); diff --git a/src/main/java/io/jare/tk/TkRelay.java b/src/main/java/io/jare/tk/TkRelay.java index 18f1b08..5b89ae1 100644 --- a/src/main/java/io/jare/tk/TkRelay.java +++ b/src/main/java/io/jare/tk/TkRelay.java @@ -22,7 +22,6 @@ */ package io.jare.tk; -import com.google.common.collect.Iterables; import io.jare.model.Base; import io.jare.model.Domain; import java.io.IOException; @@ -33,6 +32,8 @@ import java.util.Iterator; import java.util.Locale; import java.util.regex.Pattern; +import org.cactoos.list.ConcatIterable; +import org.cactoos.list.SkippedIterable; import org.takes.HttpException; import org.takes.Request; import org.takes.Response; @@ -48,6 +49,7 @@ * @author Yegor Bugayenko (yegor256@gmail.com) * @version $Id$ * @since 1.0 + * @checkstyle ClassDataAbstractionCouplingCheck (500 lines) */ final class TkRelay implements Take { @@ -150,14 +152,14 @@ private static Request request(final Request req, final String path) { return new Request() { @Override public Iterable head() throws IOException { - return Iterables.concat( + return new ConcatIterable( Collections.singleton( String.format( "GET %s HTTP/1.1", path ) ), - Iterables.skip(req.head(), 1) + new SkippedIterable<>(req.head(), 1) ); } @Override