You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by "Rashmi Paliwal (JIRA)" <ji...@apache.org> on 2010/04/16 10:45:28 UTC

[jira] Created: (MAHOUT-380) IllegalArgumentException from AbstractJDBCDataModel constructor which is extended by AbstractBooleanPrefJDBCDataModel

IllegalArgumentException from AbstractJDBCDataModel constructor which is extended by AbstractBooleanPrefJDBCDataModel
---------------------------------------------------------------------------------------------------------------------

                 Key: MAHOUT-380
                 URL: https://issues.apache.org/jira/browse/MAHOUT-380
             Project: Mahout
          Issue Type: Bug
    Affects Versions: 0.3
         Environment: Eclipse 
            Reporter: Rashmi Paliwal


AbstractBooleanPrefJDBCDataModel extends the AbstractJDBCDataModel. It calls the super.constructor by intentionally setting the last two argument value as null because AbstractBooleanPrefJDBCDataModel is meant where we don' have the preference value. Below is the code snippet:

protected AbstractBooleanPrefJDBCDataModel(DataSource dataSource,
                                             String preferenceTable,
                                             String userIDColumn,
                                             String itemIDColumn,
                                             String preferenceColumn,
                                             String getPreferenceSQL,
                                             String getUserSQL,
                                             String getAllUsersSQL,
                                             String getNumItemsSQL,
                                             String getNumUsersSQL,
                                             String setPreferenceSQL,
                                             String removePreferenceSQL,
                                             String getUsersSQL,
                                             String getItemsSQL,
                                             String getPrefsForItemSQL,
                                             String getNumPreferenceForItemSQL,
                                             String getNumPreferenceForItemsSQL) {
    super(dataSource, preferenceTable, userIDColumn, itemIDColumn, preferenceColumn, getPreferenceSQL,
        getUserSQL, getAllUsersSQL, getNumItemsSQL, getNumUsersSQL, setPreferenceSQL, removePreferenceSQL,
        getUsersSQL, getItemsSQL, getPrefsForItemSQL, getNumPreferenceForItemSQL, getNumPreferenceForItemsSQL,
        null, null);
    this.setPreferenceSQL = setPreferenceSQL;
  }

AbstractJDBCDataModel is checking for the null arguments and throwing the IlllegalArgumentException. Here is the code 

AbstractJDBCComponent.checkNotNullAndLog("getMaxPreferenceSQL", getMaxPreferenceSQL);
AbstractJDBCComponent.checkNotNullAndLog("getMinPreferenceSQL", getMinPreferenceSQL);

For this case getMaxPreferenceSQL and getMinPreferenceSQL value is null as set in the AbstractBooleanPrefJDBCDataModel class.

Fix for this would be a great help.

Thanks,
Rashmi

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (MAHOUT-380) IllegalArgumentException from AbstractJDBCDataModel constructor which is extended by AbstractBooleanPrefJDBCDataModel

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

Sean Owen resolved MAHOUT-380.
------------------------------

         Assignee: Sean Owen
    Fix Version/s: 0.4
       Resolution: Fixed

Oops! fixed

> IllegalArgumentException from AbstractJDBCDataModel constructor which is extended by AbstractBooleanPrefJDBCDataModel
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: MAHOUT-380
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-380
>             Project: Mahout
>          Issue Type: Bug
>    Affects Versions: 0.3
>         Environment: Eclipse 
>            Reporter: Rashmi Paliwal
>            Assignee: Sean Owen
>             Fix For: 0.4
>
>
> AbstractBooleanPrefJDBCDataModel extends the AbstractJDBCDataModel. It calls the super.constructor by intentionally setting the last two argument value as null because AbstractBooleanPrefJDBCDataModel is meant where we don' have the preference value. Below is the code snippet:
> protected AbstractBooleanPrefJDBCDataModel(DataSource dataSource,
>                                              String preferenceTable,
>                                              String userIDColumn,
>                                              String itemIDColumn,
>                                              String preferenceColumn,
>                                              String getPreferenceSQL,
>                                              String getUserSQL,
>                                              String getAllUsersSQL,
>                                              String getNumItemsSQL,
>                                              String getNumUsersSQL,
>                                              String setPreferenceSQL,
>                                              String removePreferenceSQL,
>                                              String getUsersSQL,
>                                              String getItemsSQL,
>                                              String getPrefsForItemSQL,
>                                              String getNumPreferenceForItemSQL,
>                                              String getNumPreferenceForItemsSQL) {
>     super(dataSource, preferenceTable, userIDColumn, itemIDColumn, preferenceColumn, getPreferenceSQL,
>         getUserSQL, getAllUsersSQL, getNumItemsSQL, getNumUsersSQL, setPreferenceSQL, removePreferenceSQL,
>         getUsersSQL, getItemsSQL, getPrefsForItemSQL, getNumPreferenceForItemSQL, getNumPreferenceForItemsSQL,
>         null, null);
>     this.setPreferenceSQL = setPreferenceSQL;
>   }
> AbstractJDBCDataModel is checking for the null arguments and throwing the IlllegalArgumentException. Here is the code 
> AbstractJDBCComponent.checkNotNullAndLog("getMaxPreferenceSQL", getMaxPreferenceSQL);
> AbstractJDBCComponent.checkNotNullAndLog("getMinPreferenceSQL", getMinPreferenceSQL);
> For this case getMaxPreferenceSQL and getMinPreferenceSQL value is null as set in the AbstractBooleanPrefJDBCDataModel class.
> Fix for this would be a great help.
> Thanks,
> Rashmi

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira