Author: jleroux
Date: Fri Apr 7 08:45:06 2017 New Revision: 1790524 URL: http://svn.apache.org/viewvc?rev=1790524&view=rev Log: No functional changes, just formatting and grouping exceptions Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/view/SimpleContentViewHandler.java Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/view/SimpleContentViewHandler.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/view/SimpleContentViewHandler.java?rev=1790524&r1=1790523&r2=1790524&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/view/SimpleContentViewHandler.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/view/SimpleContentViewHandler.java Fri Apr 7 08:45:06 2017 @@ -41,7 +41,6 @@ import org.apache.ofbiz.base.util.UtilVa import org.apache.ofbiz.content.content.ContentWorker; import org.apache.ofbiz.content.data.DataResourceWorker; import org.apache.ofbiz.entity.Delegator; -import org.apache.ofbiz.entity.GenericEntityException; import org.apache.ofbiz.entity.GenericValue; import org.apache.ofbiz.entity.util.EntityQuery; import org.apache.ofbiz.entity.util.EntityUtilProperties; @@ -110,10 +109,14 @@ public class SimpleContentViewHandler ex if (Debug.verboseOn()) Debug.logVerbose("dataResourceId:" + dataResourceId, module); } } else { - GenericValue contentRevisionItem = EntityQuery.use(delegator).from("ContentRevisionItem").where("contentId", rootContentId, "itemContentId", contentId, "contentRevisionSeqId", contentRevisionSeqId).cache().queryOne(); + GenericValue contentRevisionItem = EntityQuery.use(delegator) + .from("ContentRevisionItem") + .where("contentId", rootContentId, "itemContentId", contentId, "contentRevisionSeqId", contentRevisionSeqId) + .cache() + .queryOne(); if (contentRevisionItem == null) { throw new ViewHandlerException("ContentRevisionItem record not found for contentId=" + rootContentId - + ", contentRevisionSeqId=" + contentRevisionSeqId + ", itemContentId=" + contentId); + + ", contentRevisionSeqId=" + contentRevisionSeqId + ", itemContentId=" + contentId); } dataResourceId = contentRevisionItem.getString("newDataResourceId"); if (Debug.verboseOn()) Debug.logVerbose("contentRevisionItem:" + contentRevisionItem, module); @@ -182,11 +185,7 @@ public class SimpleContentViewHandler ex } UtilHttp.streamContentToBrowser(response, bais, byteBuffer.limit(), contentType2, fileName); } - } catch (GenericEntityException e) { - throw new ViewHandlerException(e.getMessage()); - } catch (IOException e) { - throw new ViewHandlerException(e.getMessage()); - } catch (GeneralException e) { + } catch (IOException | GeneralException e) { throw new ViewHandlerException(e.getMessage()); } } |
Free forum by Nabble | Edit this page |