[ https://issues.apache.org/jira/browse/HIVE-23638?focusedWorklogId=452324&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-452324 ]
ASF GitHub Bot logged work on HIVE-23638: ----------------------------------------- Author: ASF GitHub Bot Created on: 29/Jun/20 13:52 Start Date: 29/Jun/20 13:52 Worklog Time Spent: 10m Work Description: belugabehr commented on a change in pull request #1161: URL: https://github.com/apache/hive/pull/1161#discussion_r446983489 ########## File path: common/src/java/org/apache/hadoop/hive/common/FileUtils.java ########## @@ -483,12 +483,6 @@ public static boolean isActionPermittedForFileHierarchy(FileSystem fs, FileStatu String userName, FsAction action, boolean recurse) throws Exception { boolean isDir = fileStatus.isDir(); - FsAction dirActionNeeded = action; - if (isDir) { - // for dirs user needs execute privileges as well - dirActionNeeded.and(FsAction.EXECUTE); - } - Review comment: So, I understand why this would be removed from a find-bugs perspective (this is a no-op), but this is actually an all around bug. This should be: ``` // for dirs user needs execute privileges as well FsAction dirActionNeeded = (isDir) ? action.and(FsAction.EXECUTE) : action; ``` ########## File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java ########## @@ -6475,17 +6477,17 @@ private static boolean isAllowed(Configuration conf, ConfVars setting) { } public static String getNonMrEngines() { - String result = StringUtils.EMPTY; + StringBuffer result = new StringBuffer(); for (String s : ConfVars.HIVE_EXECUTION_ENGINE.getValidStringValues()) { if ("mr".equals(s)) { continue; } - if (!result.isEmpty()) { - result += ", "; + if (result.length() != 0) { + result.append(", "); } - result += s; + result.append(s); } - return result; + return result.toString(); Review comment: Please change this to just use String#join and more human friendly. ``` Set<String> engines = new HashSet<>(ConfVars.HIVE_EXECUTION_ENGINE.getValidStringValues()); boolean removedMR = engines.remove("mr"); LOG.debug("Found and removed MapReduce engine from list of valid execution engines: {}", removedMR); return String.join(", ", engines); ``` ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 452324) Time Spent: 40m (was: 0.5h) > Fix FindBug issues in hive-common > --------------------------------- > > Key: HIVE-23638 > URL: https://issues.apache.org/jira/browse/HIVE-23638 > Project: Hive > Issue Type: Sub-task > Reporter: Panagiotis Garefalakis > Assignee: Panagiotis Garefalakis > Priority: Major > Labels: pull-request-available > Attachments: spotbugsXml.xml > > Time Spent: 40m > Remaining Estimate: 0h > > mvn -Pspotbugs > -Dorg.slf4j.simpleLogger.log.org.apache.maven.plugin.surefire.SurefirePlugin=INFO > -pl :hive-common test-compile > com.github.spotbugs:spotbugs-maven-plugin:4.0.0:check -- This message was sent by Atlassian Jira (v8.3.4#803005)