You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2019/08/30 17:10:00 UTC
[jira] [Commented] (GROOVY-9236) Avoid unnecessary resolving
[ https://issues.apache.org/jira/browse/GROOVY-9236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16919735#comment-16919735 ]
Eric Milles commented on GROOVY-9236:
-------------------------------------
I'm not sure you can change the order of these steps without affecting the semantics of how a type name is discovered. For example, if you exchange the order of inner class and outer class checks, won't an inner class now have lower precedence then a class in the same package?
> Avoid unnecessary resolving
> ---------------------------
>
> Key: GROOVY-9236
> URL: https://issues.apache.org/jira/browse/GROOVY-9236
> Project: Groovy
> Issue Type: Improvement
> Reporter: Daniel Sun
> Assignee: Daniel Sun
> Priority: Major
> Fix For: 3.0.0-beta-4
>
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
> {{ResolveVisitor}}'s {{resolveFromStaticInnerClasses}}, {{resolveFromDefaultImports}} and {{resolveNestedClass}} will try to guess class qualified name and load. In the process of resolving, lots of time wasted on finding non-existing classes. So we should try to resolve classes in a determined manner.
> For example,
> For {{java.util.stream.Collectors}}, ① {{resolveFromStaticInnerClasses}} will try to guess {{java.util.stream$Collectors}}, {{java.util$stream$Collectors}}, {{java$util$stream$Collectors}}.
> And ② {{resolveFromDefaultImports}} will guess {{java.lang.java$util$stream$Collectors}}, {{java.util.java$util$stream$Collectors}}, ..., {{groovy.lang.java$util$stream$Collectors}}.
> After the precedence of resolving adjusted, the above unnecessary resolving can be avoided.
--
This message was sent by Atlassian Jira
(v8.3.2#803003)