-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#473 Refactoring Request-Line validation #484
Conversation
@davvd Please proceed with code review. |
@xupyprmv Many thanks, I will find someone to review it before we merge |
@dmzaytsev review this one, please |
@xupyprmv pull request description explains the solution proposed and contains a link to the original ticket it is related to |
* | ||
* @author Vladimir Maksimenko (xupypr@xupypr.com) | ||
* @version $Id$ | ||
* @since 1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xupyprmv 0.30
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dmzaytsev I take version 1.0 from pom.xml
file. Please, can you explain where I can get information about next version. That helps me not to do the same mistake in future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xupyprmv I add 0.0.1 to the last release usually
https://github.com/yegor256/takes/releases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xupyprmv so it will be 0.29.1
@xupyprmv please see a few comments above |
@dmzaytsev Thank you for CR. I refactored code according to your remarks. Please, proceed with CR. |
* @author Piotr Pradzynski (prondzyn@gmail.com) | ||
* @version $Id$ | ||
*/ | ||
public final class BkReuse extends BkWrap { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xupyprmv why did you remove this class?
@xupyprmv just two questions above |
@dmzaytsev I rollback removing of |
@xupyprmv no problem |
@rultor merge |
@dmzaytsev Thanks for your request. @yegor256 Please confirm this. |
/** | ||
* HTTP Request-line pattern. | ||
* [!-~] is for method or extension-method token (octets 33 - 126). | ||
* @see <a href="http://www |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xupyprmv this won't work with JavaDoc. just put it all in one long line, checkstyle won't complain
@yegor256 Thanks for advises. I refactored code according to your review. Please proceed with CR. |
public String header() throws IOException { | ||
final String line = this.line(); | ||
this.matcher(line); | ||
return line; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xupyprmv read this one again: http://www.yegor256.com/2015/12/08/temporal-coupling-between-method-calls.html Your code here should look like this:
public String header() {
return this.validated(this.line());
}
See the idea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xupyprmv maybe I'm wrong with this exact example, but this.matcher(line)
is a code smell. You should never use functions as procedures, ignoring their returns.
@xupyprmv see my comments above, I don't like the design of private methods. they are very "procedural" |
@yegor256 I refactored code. It is more "functional" now. The reason why I used "procedural" approach before is to avoid "copy-paste style". Because I need |
@rultor try to merge |
@xupyprmv looks good now, thanks |
@elenavolokhova please, review this ticket for compliance with our QA rules |
@rultor deploy |
@davvd Looks good! |
@elenavolokhova thank you |
@dmzaytsev just added 10 mins to @elenavolokhova (for QA), payment ID is |
Refactoring for #473
RqHref.java:83-86: RqMethod already validates Request-Line and... #473
I created RqRequestLine interface that 2 methods:
String requestLineHeader() throws IOException; // returns valid Request-line
String requestLineHeaderToken(Token token) throws IOException; // returns specified token from Request-Line
Also I added class that implements RqRequestLine interface and provides Request-Line validation.