Try this little trick borrowed from Netty.
So you have an exception:
- you don't want to check
- you don't want to swallow
- you don't want to pollute the method signature
Consider the following class Throw:
Try this little trick borrowed from Netty.
So you have an exception:
Consider the following class Throw:
| @@ -18,7 +18,9 @@ import com.liferay.portal.kernel.io.OutputStreamWriter; | |
| import com.liferay.portal.kernel.io.unsync.UnsyncBufferedReader; | |
| import com.liferay.portal.kernel.io.unsync.UnsyncBufferedWriter; | |
| import com.liferay.portal.kernel.io.unsync.UnsyncStringReader; | |
| +import com.liferay.portal.kernel.microsofttranslator.MicrosoftTranslator; | |
| import com.liferay.portal.kernel.microsofttranslator.MicrosoftTranslatorException; | |
| +import com.liferay.portal.kernel.microsofttranslator.MicrosoftTranslatorFactoryUtil; | |
| import com.liferay.portal.kernel.util.FileUtil; | |
| import com.liferay.portal.kernel.util.GetterUtil; | |
| import com.liferay.portal.kernel.util.NaturalOrderStringComparator; |
| import java.io.File; | |
| import java.util.HashMap; | |
| import java.util.Map; | |
| import java.util.ServiceLoader; | |
| import org.osgi.framework.Bundle; | |
| import org.osgi.framework.BundleContext; | |
| import org.osgi.framework.launch.Framework; | |
| import org.osgi.framework.launch.FrameworkFactory; |
| 2014-09-29 12:42:37 | |
| Full thread dump OpenJDK 64-Bit Server VM (24.65-b04 mixed mode): | |
| "Attach Listener" daemon prio=10 tid=0x00007f7e98001000 nid=0x2776 waiting on condition [0x0000000000000000] | |
| java.lang.Thread.State: RUNNABLE | |
| "ajp-bio-8009-AsyncTimeout" daemon prio=10 tid=0x00007f7ed85e7800 nid=0x26b9 waiting on condition [0x00007f7df2bea000] | |
| java.lang.Thread.State: TIMED_WAITING (sleeping) | |
| at java.lang.Thread.sleep(Native Method) | |
| at org.apache.tomcat.util.net.JIoEndpoint$AsyncTimeout.run(JIoEndpoint.java:148) |
| @@ -14,18 +14,18 @@ | |
| package com.liferay.portlet; | |
| +import com.liferay.portal.kernel.io.unsync.UnsyncStringWriter; | |
| import com.liferay.portal.kernel.template.Template; | |
| import com.liferay.portal.kernel.template.TemplateConstants; | |
| import com.liferay.portal.kernel.template.TemplateManagerUtil; | |
| import com.liferay.portal.kernel.template.TemplateResource; | |
| import com.liferay.portal.kernel.template.TemplateResourceLoaderUtil; |
| Classfile /home/rotty/workspace/portal-master/portal-service/classes/com/liferay/portlet/announcements/service/AnnouncementsEntryServiceUtil.class | |
| Last modified Aug 18, 2014; size 3824 bytes | |
| MD5 checksum 8f10db4049ef8b7a0be911af0c81ec5c | |
| Compiled from "AnnouncementsEntryServiceUtil.java" | |
| public class com.liferay.portlet.announcements.service.AnnouncementsEntryServiceUtil | |
| SourceFile: "AnnouncementsEntryServiceUtil.java" | |
| RuntimeInvisibleAnnotations: | |
| 0: #108() | |
| minor version: 0 | |
| major version: 50 |
| @@ -371,31 +371,10 @@ serverURL.setParameter("tabs3", tabs3); | |
| } | |
| %> | |
| <liferay-ui:search-iterator searchContainer="<%= searchContainer %>" /> | |
| </c:when> | |
| - <c:when test='<%= tabs2.equals("captcha") %>'> | |
| - <liferay-ui:error key="reCaptchaPrivateKey" message="the-recaptcha-private-key-is-not-valid" /> | |
| - <liferay-ui:error key="reCaptchaPublicKey" message="the-recaptcha-public-key-is-not-valid" /> | |
| - |
| /** | |
| * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. | |
| * | |
| * This library is free software; you can redistribute it and/or modify it under | |
| * the terms of the GNU Lesser General Public License as published by the Free | |
| * Software Foundation; either version 2.1 of the License, or (at your option) | |
| * any later version. | |
| * | |
| * This library is distributed in the hope that it will be useful, but WITHOUT | |
| * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| [java] Benchmark Mode Thr Count Sec Mean Mean error Units | |
| [java] c.l.j.p.e.EventsPerformanceTest.array thrpt 4 200 1 40868.206 68.055 ops/ms | |
| [java] c.l.j.p.e.EventsPerformanceTest.eventProcessorUtil_process_classNames thrpt 4 200 1 16099.645 28.735 ops/ms | |
| [java] c.l.j.p.e.EventsPerformanceTest.eventProcessorUtil_process_registered thrpt 4 200 1 32784.652 60.586 ops/ms | |
| [java] c.l.j.p.e.EventsPerformanceTest.list thrpt 4 200 1 41045.476 82.463 ops/ms | |
| [java] c.l.j.p.e.EventsPerformanceTest.serviceTrackerCollection thrpt 4 200 1 41143.900 69.304 ops/ms | |
| [java] c.l.j.p.e.EventsPerformanceTest.serviceTrackerCollection_ToArray thrpt 4 200 1 35950.619 223.727 ops/ms | |
| [java] Benchmark Mode Thr Count Sec Mean Mean error Units | |
| [java] c.l.j.p.e.EventsPerformanceTest.array thrpt 4 200 1 40868.206 68.055 ops/ms | |
| [java] c.l.j.p.e.EventsPerformanceTest.eventProcessorUtil_process_classNames thrpt 4 200 1 16099.645 28.735 ops/ms | |
| [java] c.l.j.p.e.EventsPerformanceTest.eventProcessorUtil_process_registered thrpt 4 200 1 32784.652 60.586 ops/ms | |
| [java] c.l.j.p.e.EventsPerformanceTest.list thrpt 4 200 1 41045.476 82.463 ops/ms | |
| [java] c.l.j.p.e.EventsPerformanceTest.serviceTrackerCollection thrpt 4 200 1 41143.900 69.304 ops/ms | |
| [java] c.l.j.p.e.EventsPerformanceTest.serviceTrackerCollection_ToArray thrpt 4 200 1 35950.619 223.727 ops/ms | |