|
|
Choosing A Webhost: |
svn commit: r215947 - /lenya/trunk/src/java/org/apache/lenya/cms/usecase/Ab: msg#00050cms.lenya.cvs
Author: andreas Date: Tue Jul 12 06:44:02 2005 New Revision: 215947 URL: http://svn.apache.org/viewcvs?rev=215947&view=rev Log: Allow Boolean objects in AbstractUsecase.getBooleanParameter() Modified: lenya/trunk/src/java/org/apache/lenya/cms/usecase/AbstractUsecase.java Modified: lenya/trunk/src/java/org/apache/lenya/cms/usecase/AbstractUsecase.java URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/usecase/AbstractUsecase.java?rev=215947&r1=215946&r2=215947&view=diff ============================================================================== --- lenya/trunk/src/java/org/apache/lenya/cms/usecase/AbstractUsecase.java (original) +++ lenya/trunk/src/java/org/apache/lenya/cms/usecase/AbstractUsecase.java Tue Jul 12 06:44:02 2005 @@ -390,9 +390,15 @@ boolean valueBoolean = defaultValue; Object value = getParameter(name); if (value != null) { - valueBoolean = Boolean.valueOf(value.toString()).booleanValue(); + if (value instanceof String) { + valueBoolean = Boolean.valueOf((String) value).booleanValue(); + } else if (value instanceof Boolean) { + valueBoolean = ((Boolean) value).booleanValue(); + } else { + throw new IllegalArgumentException("Cannot get boolean value of parameter [" + name + + "] (class " + value.getClass().getName() + ")"); + } } - return valueBoolean; } @@ -634,9 +640,8 @@ public final void lockInvolvedObjects(Transactionable[] objects) throws UsecaseException { if (getLogger().isDebugEnabled()) - getLogger() - .debug("AbstractUsecase::lockInvolvedObjects() called, are there objects to lock ? " - + (objects != null)); + getLogger().debug("AbstractUsecase::lockInvolvedObjects() called, are there objects to lock ? " + + (objects != null)); try { boolean canExecute = true; @@ -644,9 +649,8 @@ for (int i = 0; i < objects.length; i++) { if (objects[i].isCheckedOut() && !objects[i].isCheckedOutByUser()) { if (getLogger().isDebugEnabled()) - getLogger() - .debug("AbstractUsecase::lockInvolvedObjects() can not execute, object [" - + objects[i] + "] is already checked out"); + getLogger().debug("AbstractUsecase::lockInvolvedObjects() can not execute, object [" + + objects[i] + "] is already checked out"); canExecute = false; }
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | svn commit: r215944 - in /lenya/branches/BRANCH_1_2_X/src/webapp/lenya/pubs/blog: sitemap.xmap usecase-create.xmap webdav.xmap, thorsten |
|---|---|
| Next by Date: | svn commit: r215948 - in /lenya/trunk/src/java/org/apache/lenya/cms/editors/forms: FormsEditor.java OneFormEditor.java, andreas |
| Previous by Thread: | svn commit: r215944 - in /lenya/branches/BRANCH_1_2_X/src/webapp/lenya/pubs/blog: sitemap.xmap usecase-create.xmap webdav.xmap, thorsten |
| Next by Thread: | svn commit: r215948 - in /lenya/trunk/src/java/org/apache/lenya/cms/editors/forms: FormsEditor.java OneFormEditor.java, andreas |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |