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 2023/07/11 21:12:00 UTC
[jira] [Comment Edited] (GROOVY-1809) non-static fields should not be treated as static properties
[ https://issues.apache.org/jira/browse/GROOVY-1809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17742177#comment-17742177 ]
Eric Milles edited comment on GROOVY-1809 at 7/11/23 9:11 PM:
--------------------------------------------------------------
If "Type.name" refers to an accessible static field or property, that will be the result. If none exists, java.lang.Class is checked for an instance field or property. "print java.awt.Font.name" currently prints: java.awt.Font
was (Author: emilles):
If "Type.name" refers to a static field or property, that will be the result. If none exists, java.lang.Class is checked for an instance field or property. "print java.awt.Font.name" currently prints: java.awt.Font
> non-static fields should not be treated as static properties
> ------------------------------------------------------------
>
> Key: GROOVY-1809
> URL: https://issues.apache.org/jira/browse/GROOVY-1809
> Project: Groovy
> Issue Type: Sub-task
> Components: groovy-runtime
> Affects Versions: 1.0
> Reporter: Dierk König
> Priority: Major
>
> > java.awt.Font.getName() // ok
> > java.awt.Font.name
> > throws
> > java.lang.IllegalArgumentException
> the 'name' field on Font is treated as a static property while the field not static.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)