Use JDK 7 language features whenever we can (JAVAEETUTORIAL-200)

[JAVAEETUTORIAL-174] Use try-with-resources (possibly other JDK 7 features) where we can Created: 06/Jun/13  Updated: 19/Sep/13  Resolved: 19/Sep/13

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 7.0.1
Fix Version/s: 7.0.3

Type: Sub-task Priority: Minor
Reporter: Kim Haase Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

NB provides a hint when it would be useful to wrap code in a try-with-resources block. GreetingServlet.java (in hello2) should implement this fix for the PrintWriter that it uses. Other older examples may need such fixes too.



 Comments   
Comment by jendrock [ 06/Jun/13 ]

Fixed GreetingServlet.java (in web/servlet/hello2), and MoodServlet.java (in web/servlet/mood).

Comment by Ian Evans [ 24/Jun/13 ]

See the following tech note:
http://docs.oracle.com/javase/7/docs/technotes/guides/language/try-with-resources.html

Comment by rcervera [ 05/Sep/13 ]

Fixed in the connector examples.

Comment by Ian Evans [ 19/Sep/13 ]

I think we've updated the example tree with these language features.

Generated at Fri May 22 13:05:59 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.