Skip to content

Commit

Permalink
Merge branch '__rultor'
Browse files Browse the repository at this point in the history
  • Loading branch information
rultor committed Sep 20, 2018
2 parents a2a51f4 + 63ee642 commit 5c2b766
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
14 changes: 0 additions & 14 deletions src/main/java/org/cactoos/func/TimedFunc.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,12 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.cactoos.Func;
import org.cactoos.Proc;

/**
* Function that gets interrupted after a certain time has passed.
* @param <X> Type of input
* @param <Y> Type of output
* @since 0.29.3
* @todo #861:30min Avoid usage of null value in ctor(Proc, long) which is
* against design principles.
* Perhaps in creating TimedProc?
* Please take a look on #551 and #843 for more details.
*/
public final class TimedFunc<X, Y> implements Func<X, Y> {

Expand All @@ -52,15 +47,6 @@ public final class TimedFunc<X, Y> implements Func<X, Y> {
*/
private final long time;

/**
* Ctor.
* @param proc Proc
* @param milliseconds Milliseconds
*/
public TimedFunc(final Proc<X> proc, final long milliseconds) {
this(new FuncOf<>(proc, null), milliseconds);
}

/**
* Ctor.
* @param function Origin function
Expand Down
13 changes: 0 additions & 13 deletions src/test/java/org/cactoos/func/TimedFuncTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,6 @@ public void functionGetsInterrupted() throws Exception {
).apply(true);
}

@Test(expected = TimeoutException.class)
public void procGetsInterrupted() throws Exception {
final long period = 100L;
new TimedFunc<Boolean, Boolean>(
input -> {
new And(
new Endless<>(() -> input)
).value();
},
period
).apply(true);
}

@Test
@SuppressWarnings("PMD.AvoidCatchingGenericException")
public void futureTaskIsCancelled() {
Expand Down

1 comment on commit 5c2b766

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on 5c2b766 Sep 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 861-703fedf3 disappeared from src/main/java/org/cactoos/func/TimedFunc.java, that's why I closed #887. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.

Please sign in to comment.