From c36b12739b556e414d93a2b0ba3af5b8cf78555e Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sun, 12 Jul 2009 10:38:22 +0000 Subject: [PATCH] [MNG-3265] maven-model Extension.equals causes NPE when any field is uninitialized o Merged from r793311 git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@793319 13f79535-47bb-0310-9956-ffa450edef68 --- maven-model/src/main/mdo/maven.mdo | 11 ++++++++--- .../org/apache/maven/model/ActivationFileTest.java | 2 ++ .../java/org/apache/maven/model/ActivationOSTest.java | 2 ++ .../apache/maven/model/ActivationPropertyTest.java | 2 ++ .../java/org/apache/maven/model/ActivationTest.java | 2 ++ .../test/java/org/apache/maven/model/BuildTest.java | 2 ++ .../java/org/apache/maven/model/CiManagementTest.java | 2 ++ .../java/org/apache/maven/model/ContributorTest.java | 2 ++ .../apache/maven/model/DependencyManagementTest.java | 2 ++ .../java/org/apache/maven/model/DependencyTest.java | 2 ++ .../apache/maven/model/DeploymentRepositoryTest.java | 2 ++ .../java/org/apache/maven/model/DeveloperTest.java | 2 ++ .../maven/model/DistributionManagementTest.java | 2 ++ .../java/org/apache/maven/model/ExclusionTest.java | 2 ++ .../java/org/apache/maven/model/ExtensionTest.java | 2 ++ .../org/apache/maven/model/IssueManagementTest.java | 2 ++ .../test/java/org/apache/maven/model/LicenseTest.java | 2 ++ .../java/org/apache/maven/model/MailingListTest.java | 2 ++ .../test/java/org/apache/maven/model/ModelTest.java | 2 ++ .../java/org/apache/maven/model/NotifierTest.java | 2 ++ .../java/org/apache/maven/model/OrganizationTest.java | 2 ++ .../test/java/org/apache/maven/model/ParentTest.java | 2 ++ .../apache/maven/model/PluginConfigurationTest.java | 2 ++ .../org/apache/maven/model/PluginContainerTest.java | 2 ++ .../org/apache/maven/model/PluginExecutionTest.java | 2 ++ .../org/apache/maven/model/PluginManagementTest.java | 2 ++ .../test/java/org/apache/maven/model/PluginTest.java | 2 ++ .../org/apache/maven/model/PrerequisitesTest.java | 2 ++ .../test/java/org/apache/maven/model/ProfileTest.java | 2 ++ .../java/org/apache/maven/model/RelocationTest.java | 2 ++ .../java/org/apache/maven/model/ReportPluginTest.java | 2 ++ .../java/org/apache/maven/model/ReportSetTest.java | 2 ++ .../java/org/apache/maven/model/ReportingTest.java | 2 ++ .../org/apache/maven/model/RepositoryPolicyTest.java | 2 ++ .../java/org/apache/maven/model/RepositoryTest.java | 2 ++ .../java/org/apache/maven/model/ResourceTest.java | 2 ++ .../src/test/java/org/apache/maven/model/ScmTest.java | 2 ++ .../test/java/org/apache/maven/model/SiteTest.java | 2 ++ 38 files changed, 82 insertions(+), 3 deletions(-) diff --git a/maven-model/src/main/mdo/maven.mdo b/maven-model/src/main/mdo/maven.mdo index 6a8a4a23a2..c259db99d2 100644 --- a/maven-model/src/main/mdo/maven.mdo +++ b/maven-model/src/main/mdo/maven.mdo @@ -3581,21 +3581,26 @@ Extension e = (Extension) o; - if ( !e.getArtifactId().equals( getArtifactId() ) ) + if ( !equal( e.getArtifactId(), getArtifactId() ) ) { return false; } - else if ( !e.getGroupId().equals( getGroupId() ) ) + else if ( !equal( e.getGroupId(), getGroupId() ) ) { return false; } - else if ( e.getVersion() != null ? !e.getVersion().equals( getVersion() ) : getVersion() != null ) + else if ( !equal( e.getVersion(), getVersion() ) ) { return false; } return true; } + private static boolean equal( T obj1, T obj2 ) + { + return ( obj1 != null ) ? obj1.equals( obj2 ) : obj2 == null; + } + /** * @see java.lang.Object#hashCode() */ diff --git a/maven-model/src/test/java/org/apache/maven/model/ActivationFileTest.java b/maven-model/src/test/java/org/apache/maven/model/ActivationFileTest.java index a2728e474f..e6f057a5ed 100644 --- a/maven-model/src/test/java/org/apache/maven/model/ActivationFileTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/ActivationFileTest.java @@ -39,6 +39,8 @@ public class ActivationFileTest public void testEqualsNullSafe() { assertFalse( new ActivationFile().equals( null ) ); + + new ActivationFile().equals( new ActivationFile() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/ActivationOSTest.java b/maven-model/src/test/java/org/apache/maven/model/ActivationOSTest.java index 76c457fe64..39b1e6210e 100644 --- a/maven-model/src/test/java/org/apache/maven/model/ActivationOSTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/ActivationOSTest.java @@ -39,6 +39,8 @@ public class ActivationOSTest public void testEqualsNullSafe() { assertFalse( new ActivationOS().equals( null ) ); + + new ActivationOS().equals( new ActivationOS() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/ActivationPropertyTest.java b/maven-model/src/test/java/org/apache/maven/model/ActivationPropertyTest.java index d298c5657d..014d321c6c 100644 --- a/maven-model/src/test/java/org/apache/maven/model/ActivationPropertyTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/ActivationPropertyTest.java @@ -39,6 +39,8 @@ public class ActivationPropertyTest public void testEqualsNullSafe() { assertFalse( new ActivationProperty().equals( null ) ); + + new ActivationProperty().equals( new ActivationProperty() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/ActivationTest.java b/maven-model/src/test/java/org/apache/maven/model/ActivationTest.java index ba7aad6bcd..cd5b17c88a 100644 --- a/maven-model/src/test/java/org/apache/maven/model/ActivationTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/ActivationTest.java @@ -39,6 +39,8 @@ public class ActivationTest public void testEqualsNullSafe() { assertFalse( new Activation().equals( null ) ); + + new Activation().equals( new Activation() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/BuildTest.java b/maven-model/src/test/java/org/apache/maven/model/BuildTest.java index 04a13b8189..0e21231211 100644 --- a/maven-model/src/test/java/org/apache/maven/model/BuildTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/BuildTest.java @@ -39,6 +39,8 @@ public class BuildTest public void testEqualsNullSafe() { assertFalse( new Build().equals( null ) ); + + new Build().equals( new Build() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/CiManagementTest.java b/maven-model/src/test/java/org/apache/maven/model/CiManagementTest.java index 1b8c3ef2d4..57b386520e 100644 --- a/maven-model/src/test/java/org/apache/maven/model/CiManagementTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/CiManagementTest.java @@ -39,6 +39,8 @@ public class CiManagementTest public void testEqualsNullSafe() { assertFalse( new CiManagement().equals( null ) ); + + new CiManagement().equals( new CiManagement() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/ContributorTest.java b/maven-model/src/test/java/org/apache/maven/model/ContributorTest.java index 6155326c0e..61b3e007ed 100644 --- a/maven-model/src/test/java/org/apache/maven/model/ContributorTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/ContributorTest.java @@ -39,6 +39,8 @@ public class ContributorTest public void testEqualsNullSafe() { assertFalse( new Contributor().equals( null ) ); + + new Contributor().equals( new Contributor() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/DependencyManagementTest.java b/maven-model/src/test/java/org/apache/maven/model/DependencyManagementTest.java index b57469f707..85a697b469 100644 --- a/maven-model/src/test/java/org/apache/maven/model/DependencyManagementTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/DependencyManagementTest.java @@ -39,6 +39,8 @@ public class DependencyManagementTest public void testEqualsNullSafe() { assertFalse( new DependencyManagement().equals( null ) ); + + new DependencyManagement().equals( new DependencyManagement() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/DependencyTest.java b/maven-model/src/test/java/org/apache/maven/model/DependencyTest.java index d86a2b49a4..3d08d50c8d 100644 --- a/maven-model/src/test/java/org/apache/maven/model/DependencyTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/DependencyTest.java @@ -39,6 +39,8 @@ public class DependencyTest public void testEqualsNullSafe() { assertFalse( new Dependency().equals( null ) ); + + new Dependency().equals( new Dependency() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/DeploymentRepositoryTest.java b/maven-model/src/test/java/org/apache/maven/model/DeploymentRepositoryTest.java index a678db7220..b16c85cfe1 100644 --- a/maven-model/src/test/java/org/apache/maven/model/DeploymentRepositoryTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/DeploymentRepositoryTest.java @@ -39,6 +39,8 @@ public class DeploymentRepositoryTest public void testEqualsNullSafe() { assertFalse( new DeploymentRepository().equals( null ) ); + + new DeploymentRepository().equals( new DeploymentRepository() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/DeveloperTest.java b/maven-model/src/test/java/org/apache/maven/model/DeveloperTest.java index eebe4563a5..45ee509028 100644 --- a/maven-model/src/test/java/org/apache/maven/model/DeveloperTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/DeveloperTest.java @@ -39,6 +39,8 @@ public class DeveloperTest public void testEqualsNullSafe() { assertFalse( new Developer().equals( null ) ); + + new Developer().equals( new Developer() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/DistributionManagementTest.java b/maven-model/src/test/java/org/apache/maven/model/DistributionManagementTest.java index 8ac8d99538..5a7a155bff 100644 --- a/maven-model/src/test/java/org/apache/maven/model/DistributionManagementTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/DistributionManagementTest.java @@ -39,6 +39,8 @@ public class DistributionManagementTest public void testEqualsNullSafe() { assertFalse( new DistributionManagement().equals( null ) ); + + new DistributionManagement().equals( new DistributionManagement() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/ExclusionTest.java b/maven-model/src/test/java/org/apache/maven/model/ExclusionTest.java index 4104144366..d6fb2d72e9 100644 --- a/maven-model/src/test/java/org/apache/maven/model/ExclusionTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/ExclusionTest.java @@ -39,6 +39,8 @@ public class ExclusionTest public void testEqualsNullSafe() { assertFalse( new Exclusion().equals( null ) ); + + new Exclusion().equals( new Exclusion() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/ExtensionTest.java b/maven-model/src/test/java/org/apache/maven/model/ExtensionTest.java index 3c0fe105b7..db74935a9c 100644 --- a/maven-model/src/test/java/org/apache/maven/model/ExtensionTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/ExtensionTest.java @@ -39,6 +39,8 @@ public class ExtensionTest public void testEqualsNullSafe() { assertFalse( new Extension().equals( null ) ); + + new Extension().equals( new Extension() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/IssueManagementTest.java b/maven-model/src/test/java/org/apache/maven/model/IssueManagementTest.java index 0c4d5331ba..5b5150905e 100644 --- a/maven-model/src/test/java/org/apache/maven/model/IssueManagementTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/IssueManagementTest.java @@ -39,6 +39,8 @@ public class IssueManagementTest public void testEqualsNullSafe() { assertFalse( new IssueManagement().equals( null ) ); + + new IssueManagement().equals( new IssueManagement() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/LicenseTest.java b/maven-model/src/test/java/org/apache/maven/model/LicenseTest.java index 248b68c9c1..e1826f53f9 100644 --- a/maven-model/src/test/java/org/apache/maven/model/LicenseTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/LicenseTest.java @@ -39,6 +39,8 @@ public class LicenseTest public void testEqualsNullSafe() { assertFalse( new License().equals( null ) ); + + new License().equals( new License() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/MailingListTest.java b/maven-model/src/test/java/org/apache/maven/model/MailingListTest.java index 8bd0c73aa9..028583e02e 100644 --- a/maven-model/src/test/java/org/apache/maven/model/MailingListTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/MailingListTest.java @@ -39,6 +39,8 @@ public class MailingListTest public void testEqualsNullSafe() { assertFalse( new MailingList().equals( null ) ); + + new MailingList().equals( new MailingList() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/ModelTest.java b/maven-model/src/test/java/org/apache/maven/model/ModelTest.java index cb9e6d6563..f322a343d7 100644 --- a/maven-model/src/test/java/org/apache/maven/model/ModelTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/ModelTest.java @@ -39,6 +39,8 @@ public class ModelTest public void testEqualsNullSafe() { assertFalse( new Model().equals( null ) ); + + new Model().equals( new Model() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/NotifierTest.java b/maven-model/src/test/java/org/apache/maven/model/NotifierTest.java index 2d5b8eeb5e..961094e2b9 100644 --- a/maven-model/src/test/java/org/apache/maven/model/NotifierTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/NotifierTest.java @@ -39,6 +39,8 @@ public class NotifierTest public void testEqualsNullSafe() { assertFalse( new Notifier().equals( null ) ); + + new Notifier().equals( new Notifier() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/OrganizationTest.java b/maven-model/src/test/java/org/apache/maven/model/OrganizationTest.java index 4e4f99485a..3bb3ec17ad 100644 --- a/maven-model/src/test/java/org/apache/maven/model/OrganizationTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/OrganizationTest.java @@ -39,6 +39,8 @@ public class OrganizationTest public void testEqualsNullSafe() { assertFalse( new Organization().equals( null ) ); + + new Organization().equals( new Organization() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/ParentTest.java b/maven-model/src/test/java/org/apache/maven/model/ParentTest.java index a35782cc27..0be4324e7f 100644 --- a/maven-model/src/test/java/org/apache/maven/model/ParentTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/ParentTest.java @@ -39,6 +39,8 @@ public class ParentTest public void testEqualsNullSafe() { assertFalse( new Parent().equals( null ) ); + + new Parent().equals( new Parent() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/PluginConfigurationTest.java b/maven-model/src/test/java/org/apache/maven/model/PluginConfigurationTest.java index b6b54acb86..349d4646c1 100644 --- a/maven-model/src/test/java/org/apache/maven/model/PluginConfigurationTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/PluginConfigurationTest.java @@ -39,6 +39,8 @@ public class PluginConfigurationTest public void testEqualsNullSafe() { assertFalse( new PluginConfiguration().equals( null ) ); + + new PluginConfiguration().equals( new PluginConfiguration() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/PluginContainerTest.java b/maven-model/src/test/java/org/apache/maven/model/PluginContainerTest.java index 0cd16a666b..85b1d34836 100644 --- a/maven-model/src/test/java/org/apache/maven/model/PluginContainerTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/PluginContainerTest.java @@ -39,6 +39,8 @@ public class PluginContainerTest public void testEqualsNullSafe() { assertFalse( new PluginContainer().equals( null ) ); + + new PluginContainer().equals( new PluginContainer() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/PluginExecutionTest.java b/maven-model/src/test/java/org/apache/maven/model/PluginExecutionTest.java index 6b14cfb971..341b5d615b 100644 --- a/maven-model/src/test/java/org/apache/maven/model/PluginExecutionTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/PluginExecutionTest.java @@ -39,6 +39,8 @@ public class PluginExecutionTest public void testEqualsNullSafe() { assertFalse( new PluginExecution().equals( null ) ); + + new PluginExecution().equals( new PluginExecution() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/PluginManagementTest.java b/maven-model/src/test/java/org/apache/maven/model/PluginManagementTest.java index 08a83858f6..9333146335 100644 --- a/maven-model/src/test/java/org/apache/maven/model/PluginManagementTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/PluginManagementTest.java @@ -39,6 +39,8 @@ public class PluginManagementTest public void testEqualsNullSafe() { assertFalse( new PluginManagement().equals( null ) ); + + new PluginManagement().equals( new PluginManagement() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/PluginTest.java b/maven-model/src/test/java/org/apache/maven/model/PluginTest.java index 3a9deb4866..e7be0a6929 100644 --- a/maven-model/src/test/java/org/apache/maven/model/PluginTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/PluginTest.java @@ -39,6 +39,8 @@ public class PluginTest public void testEqualsNullSafe() { assertFalse( new Plugin().equals( null ) ); + + new Plugin().equals( new Plugin() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/PrerequisitesTest.java b/maven-model/src/test/java/org/apache/maven/model/PrerequisitesTest.java index 441ead26da..daa9c26644 100644 --- a/maven-model/src/test/java/org/apache/maven/model/PrerequisitesTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/PrerequisitesTest.java @@ -39,6 +39,8 @@ public class PrerequisitesTest public void testEqualsNullSafe() { assertFalse( new Prerequisites().equals( null ) ); + + new Prerequisites().equals( new Prerequisites() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/ProfileTest.java b/maven-model/src/test/java/org/apache/maven/model/ProfileTest.java index 4b950c8c7a..ae111ee15e 100644 --- a/maven-model/src/test/java/org/apache/maven/model/ProfileTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/ProfileTest.java @@ -39,6 +39,8 @@ public class ProfileTest public void testEqualsNullSafe() { assertFalse( new Profile().equals( null ) ); + + new Profile().equals( new Profile() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/RelocationTest.java b/maven-model/src/test/java/org/apache/maven/model/RelocationTest.java index c016a26d9d..0ae97f7d0a 100644 --- a/maven-model/src/test/java/org/apache/maven/model/RelocationTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/RelocationTest.java @@ -39,6 +39,8 @@ public class RelocationTest public void testEqualsNullSafe() { assertFalse( new Relocation().equals( null ) ); + + new Relocation().equals( new Relocation() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/ReportPluginTest.java b/maven-model/src/test/java/org/apache/maven/model/ReportPluginTest.java index cac2bc0436..78ad4cf465 100644 --- a/maven-model/src/test/java/org/apache/maven/model/ReportPluginTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/ReportPluginTest.java @@ -39,6 +39,8 @@ public class ReportPluginTest public void testEqualsNullSafe() { assertFalse( new ReportPlugin().equals( null ) ); + + new ReportPlugin().equals( new ReportPlugin() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/ReportSetTest.java b/maven-model/src/test/java/org/apache/maven/model/ReportSetTest.java index 2839a9bbc0..9dc6d063d4 100644 --- a/maven-model/src/test/java/org/apache/maven/model/ReportSetTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/ReportSetTest.java @@ -39,6 +39,8 @@ public class ReportSetTest public void testEqualsNullSafe() { assertFalse( new ReportSet().equals( null ) ); + + new ReportSet().equals( new ReportSet() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/ReportingTest.java b/maven-model/src/test/java/org/apache/maven/model/ReportingTest.java index 6c3d8a1d48..20c88d2740 100644 --- a/maven-model/src/test/java/org/apache/maven/model/ReportingTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/ReportingTest.java @@ -39,6 +39,8 @@ public class ReportingTest public void testEqualsNullSafe() { assertFalse( new Reporting().equals( null ) ); + + new Reporting().equals( new Reporting() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/RepositoryPolicyTest.java b/maven-model/src/test/java/org/apache/maven/model/RepositoryPolicyTest.java index ef9919df58..639a29e404 100644 --- a/maven-model/src/test/java/org/apache/maven/model/RepositoryPolicyTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/RepositoryPolicyTest.java @@ -39,6 +39,8 @@ public class RepositoryPolicyTest public void testEqualsNullSafe() { assertFalse( new RepositoryPolicy().equals( null ) ); + + new RepositoryPolicy().equals( new RepositoryPolicy() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/RepositoryTest.java b/maven-model/src/test/java/org/apache/maven/model/RepositoryTest.java index 8113a59c18..8f6a03ebc2 100644 --- a/maven-model/src/test/java/org/apache/maven/model/RepositoryTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/RepositoryTest.java @@ -39,6 +39,8 @@ public class RepositoryTest public void testEqualsNullSafe() { assertFalse( new Repository().equals( null ) ); + + new Repository().equals( new Repository() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/ResourceTest.java b/maven-model/src/test/java/org/apache/maven/model/ResourceTest.java index c906bbe18c..4515c6c75e 100644 --- a/maven-model/src/test/java/org/apache/maven/model/ResourceTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/ResourceTest.java @@ -39,6 +39,8 @@ public class ResourceTest public void testEqualsNullSafe() { assertFalse( new Resource().equals( null ) ); + + new Resource().equals( new Resource() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/ScmTest.java b/maven-model/src/test/java/org/apache/maven/model/ScmTest.java index fc76fcae21..7d1e31f995 100644 --- a/maven-model/src/test/java/org/apache/maven/model/ScmTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/ScmTest.java @@ -39,6 +39,8 @@ public class ScmTest public void testEqualsNullSafe() { assertFalse( new Scm().equals( null ) ); + + new Scm().equals( new Scm() ); } public void testEqualsIdentity() diff --git a/maven-model/src/test/java/org/apache/maven/model/SiteTest.java b/maven-model/src/test/java/org/apache/maven/model/SiteTest.java index 0626f79f03..0d910eadb6 100644 --- a/maven-model/src/test/java/org/apache/maven/model/SiteTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/SiteTest.java @@ -39,6 +39,8 @@ public class SiteTest public void testEqualsNullSafe() { assertFalse( new Site().equals( null ) ); + + new Site().equals( new Site() ); } public void testEqualsIdentity()