felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard S. Hall (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-3478) BundleWiringImpl.getResourceByDelegation uses exceptions internally -> unnecessarily slow
Date Tue, 24 Apr 2012 13:59:35 GMT

    [ https://issues.apache.org/jira/browse/FELIX-3478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13260562#comment-13260562

Richard S. Hall commented on FELIX-3478:

I'm not sure I like that better.
> BundleWiringImpl.getResourceByDelegation uses exceptions internally -> unnecessarily
> -----------------------------------------------------------------------------------------
>                 Key: FELIX-3478
>                 URL: https://issues.apache.org/jira/browse/FELIX-3478
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-4.0.2
>         Environment: JDK 7, Ubuntu
>            Reporter: Jesse Glick
>            Priority: Minor
>             Fix For: framework-4.2.0
> Noticed a Felix-based app freezing in the event thread for a long time during startup,
while looking for locale variants of an icon (most of which do not exist):
> "AWT-EventQueue-0" prio=10 tid=0x0912c400 nid=0x2612 runnable [0xd4f0a000]
>    java.lang.Thread.State: RUNNABLE
> 	at java.lang.Throwable.fillInStackTrace(Native Method)
> 	at java.lang.Throwable.fillInStackTrace(Throwable.java:782)
> 	- locked <0xd882a250> (a org.apache.felix.framework.resolver.ResourceNotFoundException)
> 	at java.lang.Throwable.<init>(Throwable.java:265)
> 	at java.lang.Exception.<init>(Exception.java:66)
> 	at org.apache.felix.framework.resolver.ResourceNotFoundException.<init>(ResourceNotFoundException.java:25)
> 	at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1465)
> 	at org.apache.felix.framework.BundleWiringImpl.getResourceByDelegation(BundleWiringImpl.java:1360)
> 	at org.apache.felix.framework.Felix.getBundleResource(Felix.java:1514)
> 	at org.apache.felix.framework.BundleImpl.getResource(BundleImpl.java:628)
> Bundle.getResource can simply return null when the resource does not exist. Constructing
a ResourceNotFoundException internally is a waste of time.
> Best would be for findClassOrResourceByDelegation and similar methods to just return
null. If you insist on exception-based control flow, at least override fillInStackTrace in
RNFE to do nothing, so it is cheaper.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message