You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Raghu Angadi (JIRA)" <ji...@apache.org> on 2007/05/18 23:46:16 UTC
[jira] Created: (HADOOP-1392) FindBugs : Fix some correctness bugs
reported in DFS, FS, etc.
FindBugs : Fix some correctness bugs reported in DFS, FS, etc.
--------------------------------------------------------------
Key: HADOOP-1392
URL: https://issues.apache.org/jira/browse/HADOOP-1392
Project: Hadoop
Issue Type: Bug
Affects Versions: 0.12.3
Reporter: Raghu Angadi
Assigned To: Raghu Angadi
Fix For: 0.14.0
Fix some correctness bugs reported by FindBugs in DFS, FS, IO, NET, etc packages.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HADOOP-1392) FindBugs : Fix some correctness bugs
reported in DFS, FS, etc.
Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-1392?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Raghu Angadi updated HADOOP-1392:
---------------------------------
Attachment: HADOOP-1394-01.patch
Re-attaching the same patch with ASF licence.
> FindBugs : Fix some correctness bugs reported in DFS, FS, etc.
> --------------------------------------------------------------
>
> Key: HADOOP-1392
> URL: https://issues.apache.org/jira/browse/HADOOP-1392
> Project: Hadoop
> Issue Type: Bug
> Affects Versions: 0.12.3
> Reporter: Raghu Angadi
> Assigned To: Raghu Angadi
> Fix For: 0.14.0
>
> Attachments: HADOOP-1394-01.patch
>
>
> Fix some correctness bugs reported by FindBugs in DFS, FS, IO, NET, etc packages.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HADOOP-1392) FindBugs : Fix some correctness bugs
reported in DFS, FS, etc.
Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-1392?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Raghu Angadi updated HADOOP-1392:
---------------------------------
Attachment: (was: HADOOP-1392-01.patch)
> FindBugs : Fix some correctness bugs reported in DFS, FS, etc.
> --------------------------------------------------------------
>
> Key: HADOOP-1392
> URL: https://issues.apache.org/jira/browse/HADOOP-1392
> Project: Hadoop
> Issue Type: Bug
> Affects Versions: 0.12.3
> Reporter: Raghu Angadi
> Assigned To: Raghu Angadi
> Fix For: 0.14.0
>
> Attachments: HADOOP-1394-01.patch
>
>
> Fix some correctness bugs reported by FindBugs in DFS, FS, IO, NET, etc packages.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HADOOP-1392) FindBugs : Fix some correctness bugs
reported in DFS, FS, etc.
Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-1392?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Raghu Angadi updated HADOOP-1392:
---------------------------------
Attachment: HADOOP-1392-02.patch
Latest patch includes changes for Hairong's suggestion and for merging with the latest trunk.
> FindBugs : Fix some correctness bugs reported in DFS, FS, etc.
> --------------------------------------------------------------
>
> Key: HADOOP-1392
> URL: https://issues.apache.org/jira/browse/HADOOP-1392
> Project: Hadoop
> Issue Type: Bug
> Affects Versions: 0.12.3
> Reporter: Raghu Angadi
> Assignee: Raghu Angadi
> Fix For: 0.14.0
>
> Attachments: HADOOP-1392-01.patch, HADOOP-1392-02.patch
>
>
> Fix some correctness bugs reported by FindBugs in DFS, FS, IO, NET, etc packages.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HADOOP-1392) FindBugs : Fix some correctness bugs
reported in DFS, FS, etc.
Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-1392?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Raghu Angadi updated HADOOP-1392:
---------------------------------
Attachment: HADOOP-1392-01.patch
Attached the right patch now. Thanks Hairong.
> FindBugs : Fix some correctness bugs reported in DFS, FS, etc.
> --------------------------------------------------------------
>
> Key: HADOOP-1392
> URL: https://issues.apache.org/jira/browse/HADOOP-1392
> Project: Hadoop
> Issue Type: Bug
> Affects Versions: 0.12.3
> Reporter: Raghu Angadi
> Assigned To: Raghu Angadi
> Fix For: 0.14.0
>
> Attachments: HADOOP-1392-01.patch
>
>
> Fix some correctness bugs reported by FindBugs in DFS, FS, IO, NET, etc packages.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HADOOP-1392) FindBugs : Fix some correctness bugs
reported in DFS, FS, etc.
Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-1392?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Raghu Angadi updated HADOOP-1392:
---------------------------------
Attachment: (was: HADOOP-1394-01.patch)
> FindBugs : Fix some correctness bugs reported in DFS, FS, etc.
> --------------------------------------------------------------
>
> Key: HADOOP-1392
> URL: https://issues.apache.org/jira/browse/HADOOP-1392
> Project: Hadoop
> Issue Type: Bug
> Affects Versions: 0.12.3
> Reporter: Raghu Angadi
> Assigned To: Raghu Angadi
> Fix For: 0.14.0
>
> Attachments: HADOOP-1392-01.patch
>
>
> Fix some correctness bugs reported by FindBugs in DFS, FS, IO, NET, etc packages.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HADOOP-1392) FindBugs : Fix some correctness
bugs reported in DFS, FS, etc.
Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-1392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12503918 ]
Hadoop QA commented on HADOOP-1392:
-----------------------------------
Integrated in Hadoop-Nightly #119 (See [http://lucene.zones.apache.org:8080/hudson/job/Hadoop-Nightly/119/])
> FindBugs : Fix some correctness bugs reported in DFS, FS, etc.
> --------------------------------------------------------------
>
> Key: HADOOP-1392
> URL: https://issues.apache.org/jira/browse/HADOOP-1392
> Project: Hadoop
> Issue Type: Bug
> Affects Versions: 0.12.3
> Reporter: Raghu Angadi
> Assignee: Raghu Angadi
> Fix For: 0.14.0
>
> Attachments: HADOOP-1392-01.patch, HADOOP-1392-02.patch
>
>
> Fix some correctness bugs reported by FindBugs in DFS, FS, IO, NET, etc packages.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HADOOP-1392) FindBugs : Fix some correctness bugs
reported in DFS, FS, etc.
Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-1392?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Raghu Angadi updated HADOOP-1392:
---------------------------------
Status: Patch Available (was: Open)
> FindBugs : Fix some correctness bugs reported in DFS, FS, etc.
> --------------------------------------------------------------
>
> Key: HADOOP-1392
> URL: https://issues.apache.org/jira/browse/HADOOP-1392
> Project: Hadoop
> Issue Type: Bug
> Affects Versions: 0.12.3
> Reporter: Raghu Angadi
> Assignee: Raghu Angadi
> Fix For: 0.14.0
>
> Attachments: HADOOP-1392-01.patch, HADOOP-1392-02.patch
>
>
> Fix some correctness bugs reported by FindBugs in DFS, FS, IO, NET, etc packages.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HADOOP-1392) FindBugs : Fix some correctness
bugs reported in DFS, FS, etc.
Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-1392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12500008 ]
Hadoop QA commented on HADOOP-1392:
-----------------------------------
+1
http://issues.apache.org/jira/secure/attachment/12358490/HADOOP-1392-02.patch applied and successfully tested against trunk revision r542595.
Test results: http://lucene.zones.apache.org:8080/hudson/job/Hadoop-Patch/215/testReport/
Console output: http://lucene.zones.apache.org:8080/hudson/job/Hadoop-Patch/215/console
> FindBugs : Fix some correctness bugs reported in DFS, FS, etc.
> --------------------------------------------------------------
>
> Key: HADOOP-1392
> URL: https://issues.apache.org/jira/browse/HADOOP-1392
> Project: Hadoop
> Issue Type: Bug
> Affects Versions: 0.12.3
> Reporter: Raghu Angadi
> Assignee: Raghu Angadi
> Fix For: 0.14.0
>
> Attachments: HADOOP-1392-01.patch, HADOOP-1392-02.patch
>
>
> Fix some correctness bugs reported by FindBugs in DFS, FS, IO, NET, etc packages.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HADOOP-1392) FindBugs : Fix some correctness bugs
reported in DFS, FS, etc.
Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-1392?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Doug Cutting updated HADOOP-1392:
---------------------------------
Resolution: Fixed
Status: Resolved (was: Patch Available)
I just committed this. Thanks, Raghu!
> FindBugs : Fix some correctness bugs reported in DFS, FS, etc.
> --------------------------------------------------------------
>
> Key: HADOOP-1392
> URL: https://issues.apache.org/jira/browse/HADOOP-1392
> Project: Hadoop
> Issue Type: Bug
> Affects Versions: 0.12.3
> Reporter: Raghu Angadi
> Assignee: Raghu Angadi
> Fix For: 0.14.0
>
> Attachments: HADOOP-1392-01.patch, HADOOP-1392-02.patch
>
>
> Fix some correctness bugs reported by FindBugs in DFS, FS, IO, NET, etc packages.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HADOOP-1392) FindBugs : Fix some correctness
bugs reported in DFS, FS, etc.
Posted by "Hairong Kuang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-1392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12499881 ]
Hairong Kuang commented on HADOOP-1392:
---------------------------------------
One minor suggestion. For the following fix for NamenodeFsck.java,
chosenNode = nodes[r.nextInt(Integer.MAX_VALUE) % nodes.length]
I would prefer
chosenNode = nodes[r.nextInt(nodes.length)]
> FindBugs : Fix some correctness bugs reported in DFS, FS, etc.
> --------------------------------------------------------------
>
> Key: HADOOP-1392
> URL: https://issues.apache.org/jira/browse/HADOOP-1392
> Project: Hadoop
> Issue Type: Bug
> Affects Versions: 0.12.3
> Reporter: Raghu Angadi
> Assignee: Raghu Angadi
> Fix For: 0.14.0
>
> Attachments: HADOOP-1392-01.patch
>
>
> Fix some correctness bugs reported by FindBugs in DFS, FS, IO, NET, etc packages.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HADOOP-1392) FindBugs : Fix some correctness bugs
reported in DFS, FS, etc.
Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-1392?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Raghu Angadi updated HADOOP-1392:
---------------------------------
Attachment: HADOOP-1392-01.patch
Attached patch fixes some of the correctness issues reported. FindBugs is pretty good. The following are some of the bugs fixed in this patch (findBugs' explation is after the affected code):
{code:title=NamenodeFsck.java:421}
chosenNode = nodes[Math.abs(r.nextInt()) % nodes.length];
{code} (!) *Bad attempt to compute absolute value of signed 32-bit random integer* :
This code generates a random signed integer and then computes the absolute value of that random integer. If the number returned by the random number generator is Integer.MIN_VALUE, then the result will be negative as well (since Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE).
{code:title=FSImage.java:571}
isUpgradeFinalized &= !sd.getPreviousDir().exists();
{code} (!) *Potentially dangerous use of non-short-circuit logic* :
This code seems to be using non-short-circuit logic (e.g., & or |) rather than short-circuit logic (&& or ||). In addition, it seem possible that, depending on the value of the left hand side, you might not want to evaluate the right hand side (because it would have side effects, could cause an exception or could be expensive.
Non-short-circuit logic causes both sides of the expression to be evaluated even when the result can be inferred from knowing the left-hand side. This can be less efficient and can result in errors if the left-hand side guards cases when evaluating the right-hand side can generate an error.
See the Java Language Specification for details.
{code:title=FileSystem.java:227}
if (!(this.getUri().getScheme().equals(uri.getScheme()) &&
(thisAuthority == null && thatAuthority == null)
|| thisAuthority.equals(thatAuthority)))
throw new IllegalArgumentException("Wrong FS: "+path+
", expected: "+this.getUri());
{code} (!) *Possible null pointer dereference* :
A reference value dereferenced here might be null at runtime. This may lead to a NullPointerException when the code is executed.
> FindBugs : Fix some correctness bugs reported in DFS, FS, etc.
> --------------------------------------------------------------
>
> Key: HADOOP-1392
> URL: https://issues.apache.org/jira/browse/HADOOP-1392
> Project: Hadoop
> Issue Type: Bug
> Affects Versions: 0.12.3
> Reporter: Raghu Angadi
> Assigned To: Raghu Angadi
> Fix For: 0.14.0
>
> Attachments: HADOOP-1392-01.patch
>
>
> Fix some correctness bugs reported by FindBugs in DFS, FS, IO, NET, etc packages.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HADOOP-1392) FindBugs : Fix some correctness
bugs reported in DFS, FS, etc.
Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-1392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12499932 ]
Raghu Angadi commented on HADOOP-1392:
--------------------------------------
Right. Thats better. will attach a new patch.
> FindBugs : Fix some correctness bugs reported in DFS, FS, etc.
> --------------------------------------------------------------
>
> Key: HADOOP-1392
> URL: https://issues.apache.org/jira/browse/HADOOP-1392
> Project: Hadoop
> Issue Type: Bug
> Affects Versions: 0.12.3
> Reporter: Raghu Angadi
> Assignee: Raghu Angadi
> Fix For: 0.14.0
>
> Attachments: HADOOP-1392-01.patch
>
>
> Fix some correctness bugs reported by FindBugs in DFS, FS, IO, NET, etc packages.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.