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

Karel Piwko (JIRA) jira-events at lists.jboss.org
Mon Mar 28 03:30:39 EDT 2011


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

Karel Piwko updated ARQAJO-27:
------------------------------

    Fix Version/s: 1.0.0.Alpha3
                       (was: 1.0.0.Alpha2)


> Reduce overusage of static imports
> ----------------------------------
>
>                 Key: ARQAJO-27
>                 URL: https://issues.jboss.org/browse/ARQAJO-27
>             Project: Arquillian Ajocado
>          Issue Type: Bug
>    Affects Versions: 1.0.0.Alpha1
>            Reporter: Karel Piwko
>            Assignee: Lukas Fryc
>             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