Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
Operation.java
protected final void assertState(List<OperationState> states) throws HiveSQLException { if (!states.contains(state)) { throw new HiveSQLException("Expected states: " + states.toString() + ", but found " + this.state); } this.lastAccessTime = System.currentTimeMillis(); } /*********************/ public void someMethod() { assertState(new ArrayList<OperationState>(Arrays.asList(OperationState.FINISHED))); }
By allowing assertState to accept a Collection, one can save an allocation and simplify the code:
assertState(Collections.singleton(OperationState.FINISHED));
Attachments
Attachments
Issue Links
- relates to
-
HIVE-23099 Improve Logger for Operation Child Classes
- Closed