You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by OleHornischer <gi...@git.apache.org> on 2016/11/25 09:42:47 UTC

[GitHub] commons-fileupload pull request #5: Update DiskFileItem.java: Avoiding NPE w...

GitHub user OleHornischer opened a pull request:

    https://github.com/apache/commons-fileupload/pull/5

    Update DiskFileItem.java: Avoiding NPE when not explicitely initializ\u2026

    \u2026ing the outputstream
    
    When accessing e.g. getSize() on a DiskFileItem before having called getOutputStream() a NullPointerException would be thrown. Consequent use of the "intelligent" getter already in place avoids this issue.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/OleHornischer/commons-fileupload trunk

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/commons-fileupload/pull/5.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #5
    
----
commit 07b66bb1ebf9ab6b1077c453895e4f0dd62163d7
Author: OleHornischer <ol...@gmail.com>
Date:   2016-11-25T09:40:06Z

    Update DiskFileItem.java: Avoiding NPE when not explicitely initializing the outputstream
    
    When accessing e.g. getSize() on a DiskFileItem before having called getOutputStream() a NullPointerException would be thrown. Consequent use of the "intelligent" getter already in place avoids this issue.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-fileupload issue #5: Update DiskFileItem.java: Avoiding NPE when not...

Posted by OleHornischer <gi...@git.apache.org>.
Github user OleHornischer commented on the issue:

    https://github.com/apache/commons-fileupload/pull/5
  
    Hi @garydgregory 
    I created a Unit test illustrating the issue. However, since this is my first pull request, I am not sure what you mean by updating the patch. I forked the trunk and changed only the files required for my change. 
    Do I rather need to create a branch in your repository instead?
    
    Ole


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-fileupload issue #5: Update DiskFileItem.java: Avoiding NPE when not...

Posted by garydgregory <gi...@git.apache.org>.
Github user garydgregory commented on the issue:

    https://github.com/apache/commons-fileupload/pull/5
  
    Hi @OleHornischer,
    
    1) Can you update your patch based on our Git master.
    2) Can you provide a unit test that shows the bug in action before if your patch is not applied.
    
    Gary


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-fileupload issue #5: Update DiskFileItem.java: Avoiding NPE when not...

Posted by garydgregory <gi...@git.apache.org>.
Github user garydgregory commented on the issue:

    https://github.com/apache/commons-fileupload/pull/5
  
    Don't you still get an NPE if you call DiskFileItem.isInMemory()?
    
    You should really have one @Test method for each DiskFileItem method you modified to show where NPEs have been fixed. 
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-fileupload issue #5: Update DiskFileItem.java: Avoiding NPE when not...

Posted by OleHornischer <gi...@git.apache.org>.
Github user OleHornischer commented on the issue:

    https://github.com/apache/commons-fileupload/pull/5
  
    Hi @garydgregory,
    yes, that potential NullPointerException I also addressed in my fix, as well as others. 
    I updated the sources now to handle exceptions and fixed a few compile errors. The test now includes a test for all methods that have been fixed.
    
    Ole


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-fileupload issue #5: Update DiskFileItem.java: Avoiding NPE when not...

Posted by OleHornischer <gi...@git.apache.org>.
Github user OleHornischer commented on the issue:

    https://github.com/apache/commons-fileupload/pull/5
  
    Thanks for the tip. I updated my repository in accordance to the script on the linked blog post.
    Hope things are in order now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-fileupload issue #5: Update DiskFileItem.java: Avoiding NPE when not...

Posted by garydgregory <gi...@git.apache.org>.
Github user garydgregory commented on the issue:

    https://github.com/apache/commons-fileupload/pull/5
  
    You might have to catch up your fork to the HEAD of the master branch. See https://garygregory.wordpress.com/2016/11/10/how-to-catch-up-my-git-fork-to-master/


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-fileupload pull request #5: Update DiskFileItem.java: Avoiding NPE w...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/commons-fileupload/pull/5


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org