Announcement Announcement Module
Collapse
No announcement yet.
Eclipse 3.0 compiler settings for Spring build? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Eclipse 3.0 compiler settings for Spring build?

    Not sure where to post this message; its not really architectural or api usage help question. Please move to appropiate place.

    In Eclipse one can set compiler settings per project. I'm curious what are developers using for these settings? What should the settings be? Which settings actually help avoid problematic code and which just generate noise.

    On a cvs checkout of the whole spring module, and using the default Eclipse compiler settings, I see many warnings. If I leave the checks for javadocs the count is much greater of course.

    Many of the warnings are stylistic, such as,
    "The local variable beanFactory is hiding a field from type AbstractXmlApplicationContext". Others are:
    "Access to enclosing constructor ConstructorArgumentValues.ValueHolder(Object, String) is emulated by a synthetic accessor method. Increasing its visibility will improve your performance"

    Note: warning. While experiment with the settings and going back and forth from workspace to project options then clicking 'use default settings' in the compiler dialog, my Eclipse compiler was temporarily incapacitated (some of the eclipse libraries were not found).

    J. Betancourt

  • #2
    I may have misunderstood what your intent is but I am assuming that you want to view the code base of Spring in Eclipse IDE. I see the build--of Spring framework--as being strictly an ANT issue and as having nothing to do with Eclipse.

    The best way to look at a project's souce code is to create a Simple -> Project instead of a java project. A java project automatically brings the Java compiler into play, which you don't want. Using simple project, the compiler doesn't get used, so all the compiler 'noise' disappears.

    So what I do to look at an open source project in Eclipse is:
    1) create a directory named 'spring', for example.

    2) In Eclipse, create a new Simple -> Project called 'spring' with the
    new spring directory as the Project contents directory.

    3) export the spring zip file into this 'spring' directory.

    3) rename the sub-directory just created to something like 'v102' instead
    the original 'spring-framework-1.0.2'.

    4) In Eclipse, right click on project icon and 'Refresh' project.

    Comment


    • #3
      Eclipse 3.0 compiler settings for Spring build?

      Feester:

      Thanks for the reply. However, I am interested in the noise.

      The Spring team is a powerhouse. I'd like to learn how they approach development. Thus, I'm interested if anyone on the team or users of Spring itself have made use of an IDE's compiler settings for use in determining code quality etc.

      The fact that the Spring source has 'warnings' is not unexpected. You should see my code!

      Of course, there are other things available, such as Checkstyle, PMD, Findbugs, and so forth.

      So, would Eclipse compiler settings help uncover code smells? Like excessive private variables that are never used, and so on?

      J. Betancourt

      Comment


      • #4
        As far as I can tell, i don't think there are any specific settings that are needed in order to view the spring source under eclipse. Creating a java project as is from the checked out source, works 'out of the box' and should be sufficient to let you explore the code base using the java tooling provided by eclipse. Which I must agree is a much better way to get familiar with a project, then just looking through files.

        As for specific developer set ups.. you'll have to ask them

        Comment


        • #5
          For what its worth, this is what I use. In my company we standardized the compiler settings in Eclipse.

          When I update my Spring project in Eclipse I get total 141 "errors", and in the main src tree only 14 "errors".

          The Eclipse settings we use are based on levels. Level 1 is:


          Code:
          ================================================================================
                                          LEVEL 1  (cautious)
                                          
          STYLE:      EE II EE I EE I
          ADVANCED:   II EEE II 99999
          UNUSED:     II EE I EE I
          JAVADOC:    P III 
          COMPLIANCE: 1.4 1.4 1.4  ALL CHECKED
          BUILD:      EEE W ALL CHECKED
          1.5:        EE
          
          ================================================================================
          
          
          ---- 
          Josef Betancourt
          Of course, 'E' is 'error' and 'I' is 'Ignore'. And, the settings can be set per project instead of global.

          Comment

          Working...
          X