Skip to content

Commit

Permalink
(yegor256#1011) Fixed violations
Browse files Browse the repository at this point in the history
  • Loading branch information
fanifieiev committed Feb 26, 2020
1 parent 2da848e commit 3dc442c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 29 deletions.
9 changes: 4 additions & 5 deletions src/main/java/org/takes/facets/auth/PsToken.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,10 @@ public Opt<Identity> enter(final Request req) throws IOException {
Opt<Identity> user = new Opt.Empty<>();
final UncheckedText head = new Unchecked<>(
new FirstOf<>(
text ->
new StartsWith(
new Trimmed(text),
new TextOf("Bearer")
).value(),
text -> new StartsWith(
new Trimmed(text),
new TextOf("Bearer")
).value(),
new Mapped<>(
UncheckedText::new,
new RqHeaders.Base(req).header(this.header)
Expand Down
17 changes: 8 additions & 9 deletions src/main/java/org/takes/rq/RqWithoutHeader.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,15 @@ public RqWithoutHeader(final Request req, final CharSequence name) {
// @checkstyle AnonInnerLengthCheck (50 lines)
new RequestOf(
() -> new Filtered<>(
header ->
new Not(
new StartsWith(
new Lowered(header),
new FormattedText(
"%s:",
new Lowered(name.toString())
)
header -> new Not(
new StartsWith(
new Lowered(header),
new FormattedText(
"%s:",
new Lowered(name.toString())
)
).value(),
)
).value(),
req.head()
),
req::body
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/takes/rq/multipart/RqMtBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
@lombok.EqualsAndHashCode(of = "origin")
@SuppressWarnings("PMD.ExcessiveImports")
public final class RqMtBase implements RqMultipart {
/**
* The encoding used to create the request.
Expand Down
27 changes: 12 additions & 15 deletions src/main/java/org/takes/rs/RsWithoutHeader.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,18 @@ public final class RsWithoutHeader extends RsWrap {
public RsWithoutHeader(final Response res, final CharSequence name) {
super(
new ResponseOf(
() -> {
return new Filtered<>(
header ->
new Not(
new StartsWith(
new Lowered(header),
new FormattedText(
"%s:",
new Lowered(name.toString())
)
)
).value(),
res.head()
);
},
() -> new Filtered<>(
header -> new Not(
new StartsWith(
new Lowered(header),
new FormattedText(
"%s:",
new Lowered(name.toString())
)
)
).value(),
res.head()
),
res::body
)
);
Expand Down

0 comments on commit 3dc442c

Please sign in to comment.