New Spring Beans Quick-fixes in IntelliJ IDEA 12.1

Since IntelliJ IDEA 12.1 is already available for the early preview, we can tell you now about the new features.

If you ever referenced existing beans across multiple Spring configurations, you will find the new quick-fixes very useful. Now you can change dependencies between corresponding contexts in Spring facet without leaving the editor.

Let’s say we have two Spring XML configuration files: spring-config.xml and another-spring-config.xml, where each of them is configured in its own application context in Spring facet.

Let’s reference existing bean “sampleBean” across the existing, and yet unrelated application contexts.

Notice the new quick-fix Use existing bean from context… appears when IntelliJ IDEA detects a matching bean in an existing Spring configurations.

After invoking it you will be able to choose a corresponding action from the list:

Just choose one of the available options to fix your setup automatically or use Open Spring facet settings to make changes manually.

Stay tuned to our blog for more details about the new features upcoming in IntelliJ IDEA 12.1.

Feel free to share your feedback on the discussion forum and report bugs in our issue tracker.

Develop with Pleasure!

This entry was posted in New Features and tagged . Bookmark the permalink.

2 Responses to New Spring Beans Quick-fixes in IntelliJ IDEA 12.1

  1. Brice says:

    Spring could automatically configure these additional facets, per tests for example reading the @ContextConfiguration location.

    Also in a spring batch application we are often overiding bean definition with dummy implementations, in order to test particular part of the flow. So it becomes pretty common to have multiple definition for the same bean id.

  2. Yann Cebron says:

    Brice, testing setup does not require explicit context setup since it’s determined automatically via @ContextConfiguration. If you have specific cases where it doesn’t work or the current behaviour does not match your needs, please file a request. Thanks.

Leave a Reply to Yann Cebron Cancel reply

Your email address will not be published. Required fields are marked *