-
Notifications
You must be signed in to change notification settings - Fork 10
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
Refactorings #58
Refactorings #58
Conversation
… in JSONiq, the default mode)
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.
LGTM... just asked a few questions since I'm new.
@@ -62,7 +62,6 @@ private String toGcmpString(Cmp cmp) { | |||
case gt -> ">"; | |||
case le -> "<="; | |||
case lt -> "<"; | |||
default -> ">="; |
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.
Seems unlikely, but I wonder if there is any value in having some sort of RuntimeException here in case a future version of Cmp could represent something other than one of the enumerated switch values (in the case where Cmp was updated but this switch wasn't)?
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.
As Cmp
is an enum we should provide a String getValue()
method or something like this and call cmp.getValue()
instead.
public TableJoinCursor(Cursor lc, int lSize, int pad) { | ||
this.lc = lc; | ||
this.lSize = lSize; | ||
public TableJoinCursor(Cursor cursor, int size, int pad) { |
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.
As a newbie who has been reading the code lately, I appreciate these reader-friendly name refactorings :-)
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.
It was short for left cursor I assume. However, the hash table should be built on the operator with the lower tuple size, so it can be either the cursor over the right or left operator tuples. I hope I got this right.
@@ -818,6 +818,7 @@ private AST optionDecl() throws TokenizerException { | |||
decl.addChild(stringLiteral); | |||
|
|||
if ("jn:jsoniq-boolean-and-null-literals".equals(eqnameLiteral.getStringValue())) { | |||
assert stringLiteral != null; |
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.
I'm curious (being a newbie here), do you leave assertions on for the released code? Do you have strong opinions on assert
vs. Objects.requireNonNull()
?
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.
Usually I'd leave them on, but regarding a DBS query engine I'm not sure. But I guess over her assertions are better as they can be disabled.
No description provided.