-
Notifications
You must be signed in to change notification settings - Fork 227
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
Cleanup #2026
Conversation
@@ -114,7 +113,7 @@ public void close() throws IOException { | |||
} | |||
|
|||
protected DataStoreTransaction getTransaction(Object object) { | |||
return getTransaction(object.getClass()); | |||
return getTransaction(ClassType.of(object.getClass())); |
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.
@aklish this became an endless loop when
protected DataStoreTransaction getTransaction(Class<?> cls) {
became
protected DataStoreTransaction getTransaction(Type<?> cls) {
@@ -41,7 +41,7 @@ | |||
|
|||
public class CSVExportFormatterTest { | |||
public static final String FORMAT = "yyyy-MM-dd'T'HH:mm'Z'"; | |||
private static final SimpleDateFormat FORMATTER = new SimpleDateFormat(FORMAT); | |||
private static final FastDateFormat FORMATTER = FastDateFormat.getInstance(FORMAT, TimeZone.getTimeZone("GMT")); |
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.
Should we leverage the new java.time formatter instead?
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.
https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html
is not a direct replacement for DateFormat
.
Also, this is only a test. If anything it is ISO8601DateSerde
that would have to change.
elide/elide-core/src/main/java/com/yahoo/elide/core/utils/coerce/converters/ISO8601DateSerde.java
Line 27 in e2005d6
public ISO8601DateSerde(SimpleDateFormat df, Class<? extends Date> targetType) { |
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.
Will address in a separate PR.
@@ -736,7 +736,7 @@ private static String replaceNewlineWithSpace(String str) { | |||
return (str == null) ? null : NEWLINE.matcher(str).replaceAll(SPACE); | |||
} | |||
|
|||
private final class ConfigPackage implements Package { | |||
private static final class ConfigPackage implements Package { |
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.
Why static here?
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.
Bug: Should com.yahoo.elide.datastores.aggregation.dynamic.TableType$ConfigPackage be a static inner class?
This class is an inner class, but does not use its embedded reference to the object which created it. This reference makes the instances of the class larger, and may keep the reference to the creator object alive longer than necessary. If possible, the class should be made static.
Description
Cleanup compiler warnings.
Remove unnecessary nested else.
Remove unnecessary braces in single statement lambdas.
Motivation and Context
Code quality.
How Has This Been Tested?
Unit testing
License
I confirm that this contribution is made under an Apache 2.0 license and that I have the authority necessary to make this contribution on behalf of its copyright owner.