[Arakhnę-Dev] [345] * Java 1.6 -> Java 1.7

[ Thread Index | Date Index | More arakhne.org/dev Archives ]


Revision: 345
Author:   galland
Date:     2012-07-09 22:16:08 +0200 (Mon, 09 Jul 2012)
Log Message:
-----------
* Java 1.6 -> Java 1.7

Modified Paths:
--------------
    trunk/license-installer/pom.xml
    trunk/license-installer/src/main/java/org/arakhne/maven/plugins/licenseinstaller/InstallLicenseMojo.java

Modified: trunk/license-installer/pom.xml
===================================================================
--- trunk/license-installer/pom.xml	2012-07-09 20:15:56 UTC (rev 344)
+++ trunk/license-installer/pom.xml	2012-07-09 20:16:08 UTC (rev 345)
@@ -10,7 +10,6 @@
 		<version>4.3-SNAPSHOT</version>
 	</parent>
 
-	<groupId>org.arakhne.afc</groupId>
 	<artifactId>license-installer</artifactId>
 	<version>2.3-SNAPSHOT</version>
 	<packaging>maven-plugin</packaging>

Modified: trunk/license-installer/src/main/java/org/arakhne/maven/plugins/licenseinstaller/InstallLicenseMojo.java
===================================================================
--- trunk/license-installer/src/main/java/org/arakhne/maven/plugins/licenseinstaller/InstallLicenseMojo.java	2012-07-09 20:15:56 UTC (rev 344)
+++ trunk/license-installer/src/main/java/org/arakhne/maven/plugins/licenseinstaller/InstallLicenseMojo.java	2012-07-09 20:16:08 UTC (rev 345)
@@ -1,7 +1,7 @@
 /* 
  * $Id$
  * 
- * Copyright (C) 2011 Stephane GALLAND This library is free software; you can redistribute it and/or
+ * Copyright (C) 2011-12 Stephane GALLAND This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
@@ -206,13 +206,13 @@
 
 		licenseDirectory.mkdirs();
 
-		Set<License> coreInstalled = new HashSet<License>();
+		Set<License> coreInstalled = new HashSet<>();
 		License lic;
 		URL resource;
 		String filename;
 		File licFile;
 
-		Map<String, License> includedLicenses = new HashMap<String, License>();
+		Map<String, License> includedLicenses = new HashMap<>();
 		Pattern re = Pattern.compile("^([^:]+):(.+)$"); //$NON-NLS-1$
 		if (this.thirdPartyLicenses != null) {
 			for (String tpl : this.thirdPartyLicenses) {
@@ -326,9 +326,9 @@
 					this.name, this.copyrightDates, this.copyrighters, fullLicenseText.toString(), addParts.toString());
 
 			File noticeFile = new File(metainfDirectory, filename);
-			FileWriter fileWriter = new FileWriter(noticeFile);
-			fileWriter.write(noticeText);
-			fileWriter.close();
+			try (FileWriter fileWriter = new FileWriter(noticeFile)) {
+				fileWriter.write(noticeText);
+			}
 
 			// ----------------------------------------------------
 			// AUTHORS
@@ -364,9 +364,9 @@
 			}
 
 			File authorFile = new File(metainfDirectory, filename);
-			fileWriter = new FileWriter(authorFile);
-			fileWriter.write(authorsText.toString());
-			fileWriter.close();
+			try (FileWriter fileWriter = new FileWriter(authorFile)) {
+				fileWriter.write(authorsText.toString());
+			}
 		} catch (IOException e) {
 			throw new RuntimeException(e);
 		}


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/