You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2023/04/08 20:42:07 UTC
[maven-doap-plugin] branch MDOAP-64 created (now 4368bbd)
This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a change to branch MDOAP-64
in repository https://gitbox.apache.org/repos/asf/maven-doap-plugin.git
at 4368bbd [MDOAP-64] Require Java 8
This branch includes the following new commits:
new 4368bbd [MDOAP-64] Require Java 8
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[maven-doap-plugin] 01/01: [MDOAP-64] Require Java 8
Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch MDOAP-64
in repository https://gitbox.apache.org/repos/asf/maven-doap-plugin.git
commit 4368bbdcae66d1a3fc4ef085badf7a282416e69d
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Sat Apr 8 22:25:58 2023 +0200
[MDOAP-64] Require Java 8
---
pom.xml | 5 +++--
.../org/apache/maven/plugin/doap/DoapMojo.java | 13 +++--------
.../org/apache/maven/plugin/doap/DoapUtil.java | 26 +++++++++++-----------
.../plugin/doap/options/ASFExtOptionsUtil.java | 2 +-
.../org/apache/maven/plugin/doap/DoapUtilTest.java | 4 ++--
5 files changed, 22 insertions(+), 28 deletions(-)
diff --git a/pom.xml b/pom.xml
index 5b430b4..8a0cfe3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -62,10 +62,11 @@ under the License.
</distributionManagement>
<properties>
+ <javaVersion>8</javaVersion>
<mavenVersion>2.2.1</mavenVersion>
<scmVersion>1.11.1</scmVersion>
- <maven.compiler.source>1.7</maven.compiler.source>
- <maven.compiler.target>1.7</maven.compiler.target>
+ <maven.compiler.source>1.8</maven.compiler.source>
+ <maven.compiler.target>1.8</maven.compiler.target>
<project.build.outputTimestamp>2020-04-07T21:04:00Z</project.build.outputTimestamp>
</properties>
diff --git a/src/main/java/org/apache/maven/plugin/doap/DoapMojo.java b/src/main/java/org/apache/maven/plugin/doap/DoapMojo.java
index 211374a..32ad894 100644
--- a/src/main/java/org/apache/maven/plugin/doap/DoapMojo.java
+++ b/src/main/java/org/apache/maven/plugin/doap/DoapMojo.java
@@ -1925,14 +1925,7 @@ public class DoapMojo
{
repo = scmManager.makeScmRepository( scmUrl );
}
- catch ( NoSuchScmProviderException e )
- {
- if ( getLog().isDebugEnabled() )
- {
- getLog().debug( e.getMessage(), e );
- }
- }
- catch ( ScmRepositoryException e )
+ catch ( NoSuchScmProviderException | ScmRepositoryException e )
{
if ( getLog().isDebugEnabled() )
{
@@ -2548,9 +2541,9 @@ public class DoapMojo
public static final int SHORT_DESC_TOO_LONG = 34;
- private List<String> errorMessages = new ArrayList<String>();
+ private List<String> errorMessages = new ArrayList<>();
- private List<String> warnMessages = new ArrayList<String>();
+ private List<String> warnMessages = new ArrayList<>();
/**
* @return the error messages
diff --git a/src/main/java/org/apache/maven/plugin/doap/DoapUtil.java b/src/main/java/org/apache/maven/plugin/doap/DoapUtil.java
index 441e1c7..be2bd0c 100644
--- a/src/main/java/org/apache/maven/plugin/doap/DoapUtil.java
+++ b/src/main/java/org/apache/maven/plugin/doap/DoapUtil.java
@@ -105,7 +105,7 @@ public class DoapUtil
protected static final String RDF_NODE_ID = "rdf:nodeID";
/** DoaP Organizations stored by name */
- private static Map<String, DoapUtil.Organization> organizations = new HashMap<String, DoapUtil.Organization>();
+ private static Map<String, DoapUtil.Organization> organizations = new HashMap<>();
/**
* Write comments in the DOAP file header
@@ -366,7 +366,7 @@ public class DoapUtil
private String url;
- private List<String> members = new LinkedList<String>();
+ private List<String> members = new LinkedList<>();
public Organization( String name, String url )
{
@@ -468,7 +468,7 @@ public class DoapUtil
Model model = ModelFactory.createDefaultModel();
RDFReader r = model.getReader( "RDF/XML" );
r.setProperty( "error-mode", "strict-error" );
- final List<String> errors = new ArrayList<String>();
+ final List<String> errors = new ArrayList<>();
r.setErrorHandler( new RDFDefaultErrorHandler()
{
@Override
@@ -696,14 +696,14 @@ public class DoapUtil
private static Map<String, List<Contributor>> filterContributorsByDoapRoles( I18N i18n,
List<Contributor> developersOrContributors )
{
- Map<String, List<Contributor>> returnMap = new HashMap<String, List<Contributor>>( 7 );
- returnMap.put( "maintainers", new ArrayList<Contributor>() );
- returnMap.put( "developers", new ArrayList<Contributor>() );
- returnMap.put( "documenters", new ArrayList<Contributor>() );
- returnMap.put( "translators", new ArrayList<Contributor>() );
- returnMap.put( "testers", new ArrayList<Contributor>() );
- returnMap.put( "helpers", new ArrayList<Contributor>() );
- returnMap.put( "unknowns", new ArrayList<Contributor>() );
+ Map<String, List<Contributor>> returnMap = new HashMap<>( 7 );
+ returnMap.put( "maintainers", new ArrayList<>() );
+ returnMap.put( "developers", new ArrayList<>() );
+ returnMap.put( "documenters", new ArrayList<>() );
+ returnMap.put( "translators", new ArrayList<>() );
+ returnMap.put( "testers", new ArrayList<>() );
+ returnMap.put( "helpers", new ArrayList<>() );
+ returnMap.put( "unknowns", new ArrayList<>() );
if ( developersOrContributors == null || developersOrContributors.isEmpty() )
{
@@ -845,7 +845,7 @@ public class DoapUtil
* space overflows due to retention of discarded classloaders.
*/
@SuppressWarnings( "rawtypes" )
- private static final Map<Class, ClassMap> CLASS_MAPS = new WeakHashMap<Class, ClassMap>();
+ private static final Map<Class, ClassMap> CLASS_MAPS = new WeakHashMap<>();
private ReflectionValueExtractor()
{
@@ -891,7 +891,7 @@ public class DoapUtil
token = parser2.nextToken();
try
{
- index = Integer.valueOf( parser2.nextToken() ).intValue();
+ index = Integer.parseInt( parser2.nextToken() );
}
catch ( NumberFormatException e )
{
diff --git a/src/main/java/org/apache/maven/plugin/doap/options/ASFExtOptionsUtil.java b/src/main/java/org/apache/maven/plugin/doap/options/ASFExtOptionsUtil.java
index c98e5b7..750cb7d 100644
--- a/src/main/java/org/apache/maven/plugin/doap/options/ASFExtOptionsUtil.java
+++ b/src/main/java/org/apache/maven/plugin/doap/options/ASFExtOptionsUtil.java
@@ -186,7 +186,7 @@ public class ASFExtOptionsUtil
return null;
}
- List<Developer> pmcs = new ArrayList<Developer>();
+ List<Developer> pmcs = new ArrayList<>();
for ( Developer developer : developers )
{
List<String> roles = developer.getRoles();
diff --git a/src/test/java/org/apache/maven/plugin/doap/DoapUtilTest.java b/src/test/java/org/apache/maven/plugin/doap/DoapUtilTest.java
index 4961356..70a2d53 100644
--- a/src/test/java/org/apache/maven/plugin/doap/DoapUtilTest.java
+++ b/src/test/java/org/apache/maven/plugin/doap/DoapUtilTest.java
@@ -137,7 +137,7 @@ public class DoapUtilTest
assertNotNull( i18n );
assertNotNull( i18n.getBundle() );
- List<Contributor> developersOrContributors = new ArrayList<Contributor>();
+ List<Contributor> developersOrContributors = new ArrayList<>();
// One role
Developer dev = new Developer();
@@ -217,7 +217,7 @@ public class DoapUtilTest
license.setName( "licenseName" );
license.setUrl( "licenseUrl" );
- List<Developer> developers = new ArrayList<Developer>();
+ List<Developer> developers = new ArrayList<>();
Developer developer1 = new Developer();
developer1.setId( "id1" );
developer1.setName( "developerName1" );