Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8833947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:54:18+00:00 2026-06-14T08:54:18+00:00

Codenarc is a framework that analyzes Groovy code for defects, bad practices, inconsistencies, style

  • 0

Codenarc is a framework that analyzes Groovy code for defects, bad practices, inconsistencies, style issues and more.

Is there a reason for this rule: MisorderedStaticImports Rule:

Checks for static import statements which should
never be after nonstatic imports.

Examples of violations:

import my.something.*
import static foo.bar.*

public class MyClass{}

I don’t understand the motivation or implications for this rule.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:54:21+00:00Added an answer on June 14, 2026 at 8:54 am

    As Marko Topolnik says, the order of the imports is not relevant to the meaning of a program.

    I tried looking at the JLS for an explicit statement to that effect, but I couldn’t find one. And the Java Tutorial doesn’t mention import order either. However, the semantics of import are such that it makes no difference. If the imports result in any potential ambiguity due to import order, the JLS says it is a compilation error.

    Therefore, this is just a stylistic convention. (Indeed, if you look at the rule, it even gives you the option of putting the static imports first!)


    UPDATE

    @Eugene Stepanenkov points out this Q&A

    • Why do I get different compilation result depending on java imports and static imports sequence order?

    That was caused by an obscure bug in versions of the Oracle Java compiler prior to Java 8. It was (eventually) acknowledged as a bug and fixed.

    I guess, that means that the bug could have been part of the motivation for the Codenarc warning. However if you were using a Java compiler affected by the bug, then any code with the imports in the “wrong” order would not compile at all … rendering the Codenarc warning moot.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a grails application which has codenarc plugin. And also I am
Sonar is an application for integrating output from several static and test analysis tools
I am running a Grails 2.0.4 app on OS X (10.7.4). The app starts
I am using Grails 2.0.3 as platform and Netbeans 7.1 as an IDE. Which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.