You are viewing a plain text version of this content. The canonical link for it is here.
Posted to droids-dev@incubator.apache.org by "Eugen Paraschiv (JIRA)" <ji...@apache.org> on 2010/11/25 21:15:15 UTC

[jira] Created: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Introduce Guava (the former google collections) into the droids project
-----------------------------------------------------------------------

                 Key: DROIDS-106
                 URL: https://issues.apache.org/jira/browse/DROIDS-106
             Project: Droids
          Issue Type: Wish
          Components: core
    Affects Versions: 0.0.1
            Reporter: Eugen Paraschiv
             Fix For: 0.0.1


Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
Many other apache projects use Guava (Mahout for instance). 
Should I provide a patch for this?


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Otis Gospodnetic (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12975059#action_12975059 ] 

Otis Gospodnetic commented on DROIDS-106:
-----------------------------------------

$ mvn -version
Apache Maven 2.2.1 (rdebian-1)
Java version: 1.6.0_21
Java home: /opt/java/32/jdk1.6.0_21/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.32-26-generic" arch: "i386" Family: "unix"

Interestingly, I see Maven did install Guava in my Maven repo yesterday when I tried this.  But mvn test from droids root still fails.  BUT mvn test from droids-core PASSES.


> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-106.patch
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Richard Frovarp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12936045#action_12936045 ] 

Richard Frovarp commented on DROIDS-106:
----------------------------------------

You can find the library over here: http://code.google.com/p/guava-libraries/

I used Google Collections in my Droids implementation (was done 6 months ago and haven't had a chance to update). I'm using Guava in another project that needs to do set operations and makes good use of some of the other collection types. One of the biggest advantages that Guava has over commons-collections is that it supports generics. 

> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Bertil Chapuis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998044#comment-12998044 ] 

Bertil Chapuis commented on DROIDS-106:
---------------------------------------

I committed this patch since it introduces really good practices for the future releases. An issue has been created for 0.0.2 to take Richard's comment into account. Thanks Eugen for your work.

> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-106.patch
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Otis Gospodnetic (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12974947#action_12974947 ] 

Otis Gospodnetic commented on DROIDS-106:
-----------------------------------------

Looks like it's just CNFE:
Caused by: java.lang.ClassNotFoundException: com.google.common.base.Preconditions

Shouldn't mvn test fetch Guava?
Do we need to add an entry for the maven repo where Guava lives?


> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-106.patch
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Eugen Paraschiv (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12995999#comment-12995999 ] 

Eugen Paraschiv commented on DROIDS-106:
----------------------------------------

The reason behind the checkNotNull usage is this - my goal was to make sure that I wasn't breaking any APIs, so even if I wanted to use the checkNotNull method more often, I couldn't do that if I wanted to maintain the exact type of exception that was being thrown before the patch. Now in the case I did use checkNotNull, the exception being thrown was RuntimeException, so the fact that a NullPointerException is thrown there doesn't break the API. 
Now that being said, I would want to propose a new issue to use the check___ methods of the Guava Preconditions API to their full potential, later on. 
Hope that clarifies things a bit. 
Thanks a lot for the feedback. 

> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-106.patch
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Eugen Paraschiv (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eugen Paraschiv updated DROIDS-106:
-----------------------------------

    Description: 
Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
As far as I know, many other Apache projects use Guava (Mahout is one). 


  was:
Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
Many other apache projects use Guava (Mahout for instance). 
Should I provide a patch for this?



> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Bertil Chapuis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12994739#comment-12994739 ] 

Bertil Chapuis commented on DROIDS-106:
---------------------------------------

I tried the patch and it works well for me. I havn't used Guava yet but it seems to be a nice set of tools.

> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-106.patch
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Eugen Paraschiv (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12995737#comment-12995737 ] 

Eugen Paraschiv edited comment on DROIDS-106 at 2/17/11 9:50 AM:
-----------------------------------------------------------------

Can someone please apply this patch? Perhaps we can get the final few 0.0.1 items committed and move to a release soon. 

      was (Author: eugenparaschiv):
    Can someone please apply this patch? Perhaps we can get the final few 0.0.1 items committed and move to a realease soon. 
  
> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-106.patch
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Eugen Paraschiv (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12994552#comment-12994552 ] 

Eugen Paraschiv commented on DROIDS-106:
----------------------------------------

I have tried the patch on 2 different systems (VMs) and the build works on all both of them. Perhaps it has something to do with your current setup (the issue seems to be related to the classpath, but it's hard to guess what it may be). Can someone confirm the patch is OK? 
Thanks. 

> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-106.patch
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Eugen Paraschiv (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12994747#comment-12994747 ] 

Eugen Paraschiv commented on DROIDS-106:
----------------------------------------

Thanks for the quick answer. Next step - perhaps someone with commit rights can take a look and commit it. 

> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-106.patch
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Richard Frovarp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12995989#comment-12995989 ] 

Richard Frovarp commented on DROIDS-106:
----------------------------------------

The one thing I see here is a small bit of inconsistency. There is a checkNotNull method that is used once in the patch. Otherwise checkState and checkArgument are used to test for nullness. Reading the documentation, I think the checkArgument null checks should be replaced with checkNotNull. The patch as is works, we just might want to change some of those calls later to be more consistent. 

> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-106.patch
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Bertil Chapuis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12994751#comment-12994751 ] 

Bertil Chapuis commented on DROIDS-106:
---------------------------------------

+1

I have the commit right, but since it's quit recent I'd love to see another feedback.

> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-106.patch
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Richard Frovarp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971435#action_12971435 ] 

Richard Frovarp commented on DROIDS-106:
----------------------------------------

While I support the use of Guava, I do think that it should be introduced in a patch that makes use of the library. Otherwise we have a dependency that is never used.

> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-106_v1.patch
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Eugen Paraschiv (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971445#action_12971445 ] 

Eugen Paraschiv edited comment on DROIDS-106 at 12/14/10 5:29 PM:
------------------------------------------------------------------

I agree, this issue will be necessary for a new issue about cleaning up error checking and preconditions by using the Preconditions class provided by Guava. 

      was (Author: eugenparaschiv):
    I agree, this issue will be necessary for a new issue where about cleaning up error checking and preconditions by using the Preconditions class provided by Guava. 
  
> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-106_v1.patch
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Otis Gospodnetic (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12974846#action_12974846 ] 

Otis Gospodnetic commented on DROIDS-106:
-----------------------------------------

Let's wait for Eugen's patch for precondition checking and see.

+1 for this if it makes code cleaner.


> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-106_v1.patch
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Eugen Paraschiv (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eugen Paraschiv updated DROIDS-106:
-----------------------------------

    Attachment: DROIDS-106.patch

This patch includes the work of changing the existing precondition checking in droids-core from manual to Guava based checking. Things to note here are: I kept the exact type of exception that was being thrown in the manual checks, but later one we may want to check for null with the dedicated static methods in the Preconditions class (checkNotNull for instance). Also, there are some other parts of the code that would benefit from additional checks, but this patch only focuses on replacing the existing checks not writing more. Hope this helps to display a simple use case for the readability and general improvements that Guava brings to the code base. 


> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-106.patch
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Eugen Paraschiv (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eugen Paraschiv updated DROIDS-106:
-----------------------------------

    Attachment: DROIDS-106_v1.patch

> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-106_v1.patch
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Eugen Paraschiv (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971445#action_12971445 ] 

Eugen Paraschiv commented on DROIDS-106:
----------------------------------------

I agree, this issue will be necessary for a new issue where about cleaning up error checking and preconditions by using the Preconditions class provided by Guava. 

> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-106_v1.patch
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Eugen Paraschiv (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12974929#action_12974929 ] 

Eugen Paraschiv commented on DROIDS-106:
----------------------------------------

Well, having a consistent way of handling precondition checking and exceptions in general provides a few advantages: 
- one improvement it brings is code readability - Preconditions.checkState communicates intent more clearly than manual checking (you can now differentiate cleanly between checking state, checking argument, checking something is non-null, etc)
- then, it ensures consistency - you make sure that the underlying code will always throw the same kind of exception, as opposed to deciding what to throw on a case by case basis. 
- then, manual checking means that a method that handles some logic has to change it's level of abstraction and throw exceptions by hand, thus going against a good practice of keeping a method at the same level of abstraction; Preconditions.check___ allows the code to be at a higher level of abstraction, allowing the method to focus on the logic rather than throwing some IllegalStateException by hand. 
And finally, while I submitted this patch with precondition checking as a simple first example of the Guava functionality, this is just one of the features it has. Guava is the former Google Collections, designed by the Joshua Bloch who created the standard Java Collection API, which makes Guava very collection focused and a natural extension to the standard collection API, and seeing how Droids makes and will make use of collections in many areas, it looks like a natural fit here as well. 
Hope this has helped. 
Thanks for the feedback, it's good to see activity on Droids. 
Eugen. 


> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-106.patch
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Eugen Paraschiv (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12975042#action_12975042 ] 

Eugen Paraschiv commented on DROIDS-106:
----------------------------------------

Shouldn't be a problem, no, Guava is deployed in the main maven repo. What Maven are you using? And are you running offline?

> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-106.patch
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Bertil Chapuis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bertil Chapuis closed DROIDS-106.
---------------------------------

    Resolution: Fixed

> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-106.patch
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Eugen Paraschiv (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eugen Paraschiv updated DROIDS-106:
-----------------------------------

    Attachment:     (was: DROIDS-106_v1.patch)

> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-106.patch
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Otis Gospodnetic (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12974917#action_12974917 ] 

Otis Gospodnetic commented on DROIDS-106:
-----------------------------------------

Thanks Eugen.  I looked at the patch.  What exactly does this buy Droids? (and I don't mean this in a bad tone at all!)

Here is an example change:
-    if (ssock == null) {
-      throw new IllegalStateException("not running");
-    }
+    Preconditions.checkState(ssock != null, "not running" );

This seems about the same in terms of the amount of code or clarify/readability.

Of course, maybe there are some other ugly bits in Droids that Guava could improve?  I don't know.

> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-106.patch
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Otis Gospodnetic (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12974917#action_12974917 ] 

Otis Gospodnetic edited comment on DROIDS-106 at 12/24/10 9:26 AM:
-------------------------------------------------------------------

Thanks Eugen.  I looked at the patch.  What exactly does this buy Droids? (and I don't mean this in a bad tone at all!)

Here is an example change:
{code}
-    if (ssock == null) {
-      throw new IllegalStateException("not running");
-    }
+    Preconditions.checkState(ssock != null, "not running" );
{code}

This seems about the same in terms of the amount of code or clarify/readability.

Of course, maybe there are some other ugly bits in Droids that Guava could improve?  I don't know.

      was (Author: otis):
    Thanks Eugen.  I looked at the patch.  What exactly does this buy Droids? (and I don't mean this in a bad tone at all!)

Here is an example change:
-    if (ssock == null) {
-      throw new IllegalStateException("not running");
-    }
+    Preconditions.checkState(ssock != null, "not running" );

This seems about the same in terms of the amount of code or clarify/readability.

Of course, maybe there are some other ugly bits in Droids that Guava could improve?  I don't know.
  
> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-106.patch
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Otis Gospodnetic (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12974932#action_12974932 ] 

Otis Gospodnetic commented on DROIDS-106:
-----------------------------------------

Thanks for taking the time to explain.  I'll buy that. :)
Patch applies cleanly, but mvn test from root doesn't pass after the patch.  How about for you?


> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-106.patch
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Eugen Paraschiv (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12974945#action_12974945 ] 

Eugen Paraschiv commented on DROIDS-106:
----------------------------------------

What exactly is the error. I'm running it from root and everything passes. 

> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-106.patch
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DROIDS-106) Introduce Guava (the former google collections) into the droids project

Posted by "Eugen Paraschiv (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12995737#comment-12995737 ] 

Eugen Paraschiv commented on DROIDS-106:
----------------------------------------

Can someone please apply this patch? Perhaps we can get the final few 0.0.1 items committed and move to a realease soon. 

> Introduce Guava (the former google collections) into the droids project
> -----------------------------------------------------------------------
>
>                 Key: DROIDS-106
>                 URL: https://issues.apache.org/jira/browse/DROIDS-106
>             Project: Droids
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-106.patch
>
>
> Google Guava is becoming a standard extension to the collection framework and provides some very useful features (besides the obvious collection work which is extensive), such as Preconditions (which would standardize the way argument checking is done). 
> As far as I know, many other Apache projects use Guava (Mahout is one). 

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira