You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/08/23 10:09:58 UTC

[GitHub] [iotdb] jixuan1989 commented on a diff in pull request #7058: [ISSUE-7014]Replace the usage of the "instanceof" operator by a catch block.

jixuan1989 commented on code in PR #7058:
URL: https://github.com/apache/iotdb/pull/7058#discussion_r952419296


##########
server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/AnalyzeVisitor.java:
##########
@@ -253,12 +253,11 @@ public Analysis visitQuery(QueryStatement queryStatement, MPPQueryContext contex
                           false)
                       .stream()
                       .collect(Collectors.toSet()));
+            } catch (MeasurementNotExistException mne) {
+              logger.warn(mne.getMessage());
+              measurementNotExistDevices.add(device);
+              continue;
             } catch (SemanticException e) {
-              if (e instanceof MeasurementNotExistException) {
-                logger.warn(e.getMessage());
-                measurementNotExistDevices.add(device);
-                continue;
-              }
               throw e;

Review Comment:
   after the change,  catch SemanticException and `throw e` can be removed, right? As by default, the exception will be thrown.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org