[arquillian-issues] [JBoss JIRA] Work started: (ARQAJO-27) Reduce overusage of static imports

Lukáš Fryč (JIRA) jira-events at lists.jboss.org
Sun May 1 03:17:18 EDT 2011


     [ https://issues.jboss.org/browse/ARQAJO-27?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on ARQAJO-27 started by Lukáš Fryč.

> Reduce overusage of static imports
> ----------------------------------
>
>                 Key: ARQAJO-27
>                 URL: https://issues.jboss.org/browse/ARQAJO-27
>             Project: Arquillian Ajocado
>          Issue Type: Bug
>          Components: api, core
>    Affects Versions: 1.0.0.Alpha1
>            Reporter: Karel Piwko
>            Assignee: Lukáš Fryč
>             Fix For: 1.0.0.Alpha3
>
>
> It is extremely difficult to follow and read the code overfilled with static imports especially when reading the code without an IDE.
> The main reason why static imports exist is to make code more readable not the opposite.
> See guideline at http://download.oracle.com/javase/1.5.0/docs/guide/language/static-import.html
> For instance, see SystemPropertiesConfiguration:
> import static org.jboss.arquillian.ajocado.utils.URLUtils.buildUrl; (used twice)
> import static java.lang.System.getProperty; (used a lot of time, but I don't consider statically importing System as a good practice either)
> import static org.jboss.arquillian.ajocado.utils.PrimitiveUtils.*; (I have no idea what is imported from there, I guess methods like asBoolean(String))
> Suggestion:
> a getPropertyAs(Class<?> clazz, String value, String default)  method can easily encapsulate calls to System.getProperty() and asType wrappers.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the arquillian-issues mailing list