Archive for November, 2008

Fresh Update: IntelliJ IDEA 8.0.1

Thursday, November 27th, 2008

We’re glad to announce IntelliJ IDEA 8.0.1, which addresses the most recent feedback that we’ve received since the release of IntelliJ IDEA 8. Bug-fixes, various improvements, and even small new features — you can see the complete list right here.

Just download the fresh build and develop with pleasure.

IntelliJ IDEA 8 Refactorings: Wrap Return Value

Tuesday, November 18th, 2008

We’re continuing the series dedicated to new IntelliJ IDEA 8 refactorings. Today’s hero is Wrap Return Value, which is handy when you need to append some data to what a method already returns.
For instance, have a look at the following code.



At the moment we can only retrieve the full person name. Imagine how inconvenient is trying to fish out the separate first or last name in this case. It would be much more convenient if we had an option to retrieve only the part of the name that we need.
Right-click the return value and select Refactor | Wrap Return Value. Specify whether the wrapper should be a new class, an existing one, or an inner class, and click Refactor.
Now the method returns this object instance:



which contains getter for the full name:



Let’s rename the value field to name to make the code more limpid. For that, we’re using Shift+F6 – Rename refactoring. Note that IntelliJ IDEA renames not only the field itself, but the matching getter method as well.
After that, all we need is to just add getters for the first name and last name to the wrapper.



Watch this and the other refactorings in a new live demo!

IntelliJ IDEA 8 Refactorings: Introduce Parameter Object

Wednesday, November 12th, 2008

As you might already have noticed from the Features list, IntelliJ IDEA 8 brings you 7 new refactorings to ease the daily coding routine. One of these refactorings is Introduce Parameter Object. Its name speaks for itself: when you have a large group of parameters which go a long way through a chain of delegating method calls, it lets you create a wrapper class that you can then use instead. Another case is when you have a group of method parameters semantically tied one to another – a wrapper class comes handy as well.

Let’s have a look at an example. Say, we have this code:
drawEdge class before refactoring

Look at how many parameters are passed to drawEdge method – six! Imagine how lengthy the calls to this method are and how it all swamps the code. No worries – IntelliJ IDEA can help us. As we can see, the X and Y coordinates and the edgeWidth naturally go together, so we can move them to their own object.

Right-click the method name and select Refactor | Introduce Parameter Object from the context menu.In the Introduce Parameter Object dialog, we can select whether we want to create a new class, inner class, or use an existing one to wrap the parameters. For this case, we opt to the first choice. Then, select the parameters to be extracted. As we decided, these are edgeWidth, x1, x2, y1, and y2. Click OK, and voila – the things are a lot easier now!

drawEdge class after refactoring

new Parameter Object

Meet JetBrains’ Release of the Year: IntelliJ IDEA 8

Thursday, November 6th, 2008

We’re proud to announce our release of the year: IntelliJ IDEA 8!

Our new and improved IDE is now faster, more stable, and more feature-rich.

The major release highlights include:

  • SQL support & SQL Query Runner
  • UML-like class diagrams
  • JBoss Seam support
  • JavaScript & Flex Debugger
  • FreeMarker & Velocity support
  • and much more

For more details jump right to the New Features page, or better yet, start experiencing a new level of productivity and usability today – download the fully-functional, free 30-day trial copy.

Keep developing with pleasure!