Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 07AA0200D63 for ; Thu, 7 Dec 2017 06:39:09 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id F0FC3160C1D; Thu, 7 Dec 2017 05:39:08 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 40056160C0A for ; Thu, 7 Dec 2017 06:39:08 +0100 (CET) Received: (qmail 37488 invoked by uid 500); 7 Dec 2017 05:39:07 -0000 Mailing-List: contact dev-help@ranger.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ranger.apache.org Delivered-To: mailing list dev@ranger.apache.org Received: (qmail 37475 invoked by uid 99); 7 Dec 2017 05:39:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Dec 2017 05:39:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 8C37AC46DF for ; Thu, 7 Dec 2017 05:39:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.011 X-Spam-Level: X-Spam-Status: No, score=-100.011 tagged_above=-999 required=6.31 tests=[SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id kvxXBrIKguj3 for ; Thu, 7 Dec 2017 05:39:05 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id A88675F253 for ; Thu, 7 Dec 2017 05:39:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id D1B65E0012 for ; Thu, 7 Dec 2017 05:39:03 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 7BBCD255BF for ; Thu, 7 Dec 2017 05:39:00 +0000 (UTC) Date: Thu, 7 Dec 2017 05:39:00 +0000 (UTC) From: "peng.jianhua (JIRA)" To: dev@ranger.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (RANGER-1918) Optimize logic and remove unnecessary temporary variables in YarnClient.class MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 07 Dec 2017 05:39:09 -0000 peng.jianhua created RANGER-1918: ------------------------------------ Summary: Optimize logic and remove unnecessary temporary variables in YarnClient.class Key: RANGER-1918 URL: https://issues.apache.org/jira/browse/RANGER-1918 Project: Ranger Issue Type: Improvement Components: plugins Affects Versions: master Reporter: peng.jianhua Assignee: peng.jianhua Fix For: master 1.We have already determined the logic of the response! = Null and response.getStatus ()! = 200 in the getQueueResponse method, and do not need to be evaluated in the run method of the getQueueResponse method. Move "response.close ();" into the getQueueResponse method. 2.There is no necessary to create so many useless temporary variables "String errMsg = errMessage;" just use errMessage is better practice. -- This message was sent by Atlassian JIRA (v6.4.14#64029)