You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Nicolas Peltier (JIRA)" <ji...@apache.org> on 2019/01/09 09:59:00 UTC

[jira] [Comment Edited] (SLING-8205) stop using Class.getField() to stop spitting out NoSuchFieldException

    [ https://issues.apache.org/jira/browse/SLING-8205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16738049#comment-16738049 ] 

Nicolas Peltier edited comment on SLING-8205 at 1/9/19 9:58 AM:
----------------------------------------------------------------

[~radu.cotescu] raised the PR https://github.com/apache/sling-org-apache-sling-scripting-sightly-compiler/pull/4


was (Author: npeltier):
raised the PR https://github.com/apache/sling-org-apache-sling-scripting-sightly-compiler/pull/4

> stop using Class.getField() to stop spitting out NoSuchFieldException
> ---------------------------------------------------------------------
>
>                 Key: SLING-8205
>                 URL: https://issues.apache.org/jira/browse/SLING-8205
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>            Reporter: Nicolas Peltier
>            Assignee: Nicolas Peltier
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> According to java mission control, exceptions are bad for performances, and o.a.s.scripting.sightly.compiler.util.ObjectModel uses Class.getField first to check if a use member is a simple field or a method, which generates *lots* of exceptions.
> Switching to simple lookup through getFields (that looks also to super classes fields) _looks_ quicker (this of course would need to be thoroughly tested)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)