I have already talked about the new features to support multi-catch in an earlier post. Now I will talk about Try-with-resources statement and Simplified Varargs Method Invocation.
The compiler detects unhandled exceptions thrown by automatic/implicit close() invocation on a resource.
With Mark Occurrences enabled, the closing '}' of a try-with-resources statement is marked as a method exit point if the implicit close() invocation throws an exception. The corresponding resource variable is also highlighted.
Future items: In 3.8 we plan to add warnings to indicate that a resource is not closed, see bug 349326. In Java 7 a resource is a subtype of java.lang.AutoCloseable and in the pre-Java 7 world a resource is a subtype of java.io.Closeable. Based on these warnings we will also provide quick fixes/assists and clean-ups to enclose a resource in a try-with-resources statement, see bug 349390.
A new quick fix Add @SafeVarargs is offered for potential heap pollution warnings on method declarations.
Add @SafeVarargs quick fix is also offered from call sites.
Remove @SafeVarargs quick fix is offered for incorrect usage of @SafeVarargs annotation.
Note: This is an implementation of an early-draft specification
developed under the Java Community Process (JCP) and is made available
for testing and evaluation purposes only. The code is not compatible
with any specification of the JCP.
Thursday, July 14, 2011
Java 7 Support in Eclipse JDT (BETA) - Part I
JDT team has been working overtime over the last few months on the Java 7 support. The compiler is rock solid now and the UI is looking good with a number of new features. You can add the Java 7 support to your existing 3.7 or 4.1 install by following the instructions on http://wiki.eclipse.org/JDT/Eclipse_Java_7_Support_(BETA).
This post is the first in a series in which I will talk about the new features in JDT for Java 7. In this post I will focus on Multi-catch.
The new action Source > Surround With > Try/multi-catch Block allows you to surround the selected statements with a try/multi-catch block. This is also available as Surround with try/multi-catch quick fix in case there are multiple uncaught exceptions.
The new Add exceptions to existing catch clause quick fix allows you to add uncaught exceptions to an existing catch clause.
You can replace a multi-catch clause with individual catch blocks via Use separate catch blocks quick assist. The quick assist will create separate catch clauses for all the exceptions.
You can also pick out one or more selected exceptions from a multi-catch clause via Move exceptions to separate catch block.
The new Combine catch blocks quick assist allows you to combine separate catch blocks into a single multi-catch block, pretty useful for migrating existing code to Java 7. The quick assist is offered only when bodies of all the catch blocks are same, we still need to make it a little more smarter, see bug 350308. In 3.8 we will also provide this as a clean-up (bug 351179).
The compiler gives an error if an exception in a multi-catch clause is already caught by an alternative exception. The new Remove exception quick fix allows you to remove this exception.
Mark Occurrences has been updated to understand the multi-catch syntax.
There are also new Line Wrapping options in the Formatter for the multi-catch syntax.
Note: This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP.
This post is the first in a series in which I will talk about the new features in JDT for Java 7. In this post I will focus on Multi-catch.
The new action Source > Surround With > Try/multi-catch Block allows you to surround the selected statements with a try/multi-catch block. This is also available as Surround with try/multi-catch quick fix in case there are multiple uncaught exceptions.
The new Add exceptions to existing catch clause quick fix allows you to add uncaught exceptions to an existing catch clause.
You can replace a multi-catch clause with individual catch blocks via Use separate catch blocks quick assist. The quick assist will create separate catch clauses for all the exceptions.
You can also pick out one or more selected exceptions from a multi-catch clause via Move exceptions to separate catch block.
The new Combine catch blocks quick assist allows you to combine separate catch blocks into a single multi-catch block, pretty useful for migrating existing code to Java 7. The quick assist is offered only when bodies of all the catch blocks are same, we still need to make it a little more smarter, see bug 350308. In 3.8 we will also provide this as a clean-up (bug 351179).
The compiler gives an error if an exception in a multi-catch clause is already caught by an alternative exception. The new Remove exception quick fix allows you to remove this exception.
Mark Occurrences has been updated to understand the multi-catch syntax.
There are also new Line Wrapping options in the Formatter for the multi-catch syntax.
Note: This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP.
Saturday, July 9, 2011
JazzHub
JazzHub is a free, public, hosting hub for the open development of academic research and classroom projects. Currently it is in limited beta. To participate in the beta you can request a project creation code.
On JazzHub students and professors can plan projects, collaborate on source code, and track progress, all with the latest Jazz technology in Rational Team Concert.
- Source code management
- Work Item Tracking
- Project and personal dashboards
- Agile planning
- Reporting
- Web, Eclipse and Visual Studio interfaces
Rational Team Concert (RTC) is also available FREE of charge for qualified open source projects, academic institutions, and research projects. Steps to help you get started are available here. You can also read about RSSOwl's adoption of RTC, this also includes a great video which illustrates how the developers can benefit from RTC.
You can learn more about JazzHub at Innovate 2011, Bangalore. If you're a student, you can also win free passes to Innovate by blogging or tweeting about rational products (use hashtag #innovateindia).
Thursday, June 23, 2011
Java 7 Support in Eclipse JDT (BETA)
Java 7 is not publicly released yet and hence the Eclipse Java 7 support could not be shipped with 3.7 or 4.1. However those who want to use it in 3.7 or 4.1 can do it using the install instructions mentioned on http://wiki.eclipse.org/JDT/Eclipse_Java_7_Support_(BETA).
If you find a bug or have ideas on new quick fixes / refactorings / templates / ... , please file a bug with the [1.7] tag !
I should add that this is a work in progress, and more details are available on the following two wiki pages
Note: This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP.
If you find a bug or have ideas on new quick fixes / refactorings / templates / ... , please file a bug with the [1.7] tag !
I should add that this is a work in progress, and more details are available on the following two wiki pages
Note: This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP.
Sunday, June 5, 2011
JDT Tip: See different hovers in Java editor by using modifier keys
- When you move the mouse over an identifier that has no error or warning, by default a hover with the Javadoc is shown.
- However if there is an error or a warning on the identifier then the corresponding message is shown.
- To see the Javadoc even in this case, you can enable the Javadoc hover on this preference page and define a key modifier e.g. Ctrl+Shift.
- Now press Ctrl+Shift while hovering to see the javadoc.
Thursday, June 2, 2011
JDT Tip: Mark Occurrences in Java editor
I think everyone knows that the Java editor highlights occurrences of variables and method calls.
But did you know that it also highlights
But did you know that it also highlights
- Method exit points - select (or place caret in) the method return type
- Method calls or statements throwing an exception - select (or place caret in) an exception in a catch block
- Break/Continue targets - select (or place caret in) break or continue keywords
Mobile sessions at IBM Innovate
Attending Innovate 2011 ? Interested in mobile development ? If yes, then the following sessions might be of interest to you.
Mon, Jun 6, 2011
4:15 PM : ALM-1602A Bringing Collaborative Lifecycle Development to Mobile Software
8:00 PM : BOF-2303A How is the Need for Developing Mobile Applications Changing Development Efforts
Tue, Jun 7, 2011
1:45 PM : CS-1359B Agile Adoption for Android Mobile Project using IBM Rational Team Concert - Samsung SDS Agile Transition
Wed, Jun 8, 2011
11:15 AM : SE-2206A Mobile Application Development: Strategies for Accelerated Delivery and Deployment
1:45 PM : MAC-1756A Web 2.0 and Mobile Development Fast and Easy with IBM Rational Application Developer 8.0
3:00 PM : PPM-1300A Importance of Understanding User Needs in Mobile Development
3:00 PM : SIS-1609A Model-Driven Development for Mobile Applications
In addition there are also some demo pedestals in the Solution Center.
Mon, Jun 6, 2011
4:15 PM : ALM-1602A Bringing Collaborative Lifecycle Development to Mobile Software
8:00 PM : BOF-2303A How is the Need for Developing Mobile Applications Changing Development Efforts
Tue, Jun 7, 2011
1:45 PM : CS-1359B Agile Adoption for Android Mobile Project using IBM Rational Team Concert - Samsung SDS Agile Transition
Wed, Jun 8, 2011
11:15 AM : SE-2206A Mobile Application Development: Strategies for Accelerated Delivery and Deployment
1:45 PM : MAC-1756A Web 2.0 and Mobile Development Fast and Easy with IBM Rational Application Developer 8.0
3:00 PM : PPM-1300A Importance of Understanding User Needs in Mobile Development
3:00 PM : SIS-1609A Model-Driven Development for Mobile Applications
In addition there are also some demo pedestals in the Solution Center.
Subscribe to:
Posts (Atom)





















