You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(12) |
Nov
(2) |
Dec
(15) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(7) |
Feb
(2) |
Mar
|
Apr
(22) |
May
|
Jun
|
Jul
(1) |
Aug
(29) |
Sep
(17) |
Oct
(4) |
Nov
|
Dec
(19) |
2010 |
Jan
|
Feb
(9) |
Mar
(2) |
Apr
(34) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(25) |
Nov
(22) |
Dec
(3) |
2014 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <chr...@us...> - 2009-08-24 00:33:12
|
Revision: 139 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=139&view=rev Author: chriswhansen Date: 2009-08-24 00:33:03 +0000 (Mon, 24 Aug 2009) Log Message: ----------- Undo folder rename. Added Paths: ----------- branches/TestUtils/Pojomatic/ branches/TestUtils/Pojomatic/.classpath branches/TestUtils/Pojomatic/.project branches/TestUtils/Pojomatic/.settings/ branches/TestUtils/Pojomatic/pom.xml branches/TestUtils/Pojomatic/src/ branches/TestUtils/Pojomatic/src/main/ branches/TestUtils/Pojomatic/src/main/java/ branches/TestUtils/Pojomatic/src/main/java/org/ branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/ branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/Pojomatic.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/Pojomator.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/PropertyElement.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/annotations/ branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/annotations/AutoDetectPolicy.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/annotations/AutoProperty.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/annotations/DefaultPojomaticPolicy.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/annotations/PojoFormat.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/annotations/PojomaticPolicy.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/annotations/Property.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/annotations/PropertyFormat.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/diff/ branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/diff/AbstractNullDifference.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/diff/Difference.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/diff/DifferenceFromNull.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/diff/DifferenceToNull.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/diff/Differences.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/diff/NoDifferences.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/diff/PropertyDifferences.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/formatter/ branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/formatter/AccountNumberFormatter.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/formatter/DefaultPojoFormatter.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/formatter/DefaultPropertyFormatter.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/formatter/PojoFormatter.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/formatter/PropertyFormatter.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/internal/ branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/internal/AbstractPropertyElement.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/internal/OverridableMethods.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/internal/PojomatorImpl.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/internal/PropertyAccessor.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/internal/PropertyField.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/internal/PropertyFilter.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/internal/PropertyRole.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/internal/SelfPopulatingMap.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/internal/package-info.java branches/TestUtils/Pojomatic/src/main/javadoc/ branches/TestUtils/Pojomatic/src/main/javadoc/overview.html branches/TestUtils/Pojomatic/src/pmd.xml branches/TestUtils/Pojomatic/src/site/ branches/TestUtils/Pojomatic/src/site/apt/ branches/TestUtils/Pojomatic/src/site/apt/changes.apt branches/TestUtils/Pojomatic/src/site/apt/index.apt branches/TestUtils/Pojomatic/src/site/resources/ branches/TestUtils/Pojomatic/src/site/resources/css/ branches/TestUtils/Pojomatic/src/site/resources/css/site.css branches/TestUtils/Pojomatic/src/site/site.xml branches/TestUtils/Pojomatic/src/test/ branches/TestUtils/Pojomatic/src/test/java/ branches/TestUtils/Pojomatic/src/test/java/examples/ branches/TestUtils/Pojomatic/src/test/java/examples/Auto.java branches/TestUtils/Pojomatic/src/test/java/examples/Common.java branches/TestUtils/Pojomatic/src/test/java/examples/Customer.java branches/TestUtils/Pojomatic/src/test/java/examples/Employee.java branches/TestUtils/Pojomatic/src/test/java/examples/GetterAccess.java branches/TestUtils/Pojomatic/src/test/java/examples/Manual.java branches/TestUtils/Pojomatic/src/test/java/examples/Person.java branches/TestUtils/Pojomatic/src/test/java/examples/PersonMain.java branches/TestUtils/Pojomatic/src/test/java/examples/TestPojo.java branches/TestUtils/Pojomatic/src/test/java/org/ branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/ branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/PojomaticTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/TestUtils.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/diff/ branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/diff/DifferenceFromNullTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/diff/DifferenceTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/diff/DifferenceToNullTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/diff/NoDifferencesTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/diff/PropertyDifferencesTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/formatter/ branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/formatter/AccountNumberFormatterTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/formatter/DefaultPojoFormatterTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/formatter/DefaultPropertyFormatterTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/ branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/ClassPropertiesTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/OverridableMethodsTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/PojomatorImplTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/PropertyElementTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/PropertyFilterTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/SelfPopulatingMapTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/a/ branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/a/C1.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/a/C3.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/b/ branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/b/C2.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/b/C4.java branches/TestUtils/PojomaticTestUtils/ branches/TestUtils/PojomaticTestUtils/.classpath branches/TestUtils/PojomaticTestUtils/.project branches/TestUtils/PojomaticTestUtils/.settings/ branches/TestUtils/PojomaticTestUtils/.settings/org.eclipse.jdt.core.prefs branches/TestUtils/PojomaticTestUtils/.settings/org.maven.ide.eclipse.prefs branches/TestUtils/PojomaticTestUtils/pom.xml branches/TestUtils/PojomaticTestUtils/src/ branches/TestUtils/PojomaticTestUtils/src/main/ branches/TestUtils/PojomaticTestUtils/src/main/java/ branches/TestUtils/PojomaticTestUtils/src/main/java/org/ branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/ branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/junit/ branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/junit/PojomaticAssert.java branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/test/ branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/test/AssertUtils.java branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/testng/ branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/testng/PojomaticAssert.java branches/TestUtils/PojomaticTestUtils/src/test/ branches/TestUtils/PojomaticTestUtils/src/test/java/ branches/TestUtils/PojomaticTestUtils/src/test/java/org/ branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/ branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/junit/ branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/junit/PojomaticAssertTest.java branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/ branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/AssertTest.java branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/AssertUtilsTest.java branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/Container.java branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/OnlyPojomaticEqual.java branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/testng/ branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/testng/PojomaticAssertTest.java Removed Paths: ------------- branches/TestUtils/Pojomatic/.classpath branches/TestUtils/Pojomatic/.project branches/TestUtils/Pojomatic/.settings/ branches/TestUtils/Pojomatic/pom.xml branches/TestUtils/Pojomatic/src/ branches/TestUtils/Pojomatic/src/main/ branches/TestUtils/Pojomatic/src/main/java/ branches/TestUtils/Pojomatic/src/main/java/org/ branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/ branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/Pojomatic.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/Pojomator.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/PropertyElement.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/annotations/ branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/annotations/AutoDetectPolicy.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/annotations/AutoProperty.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/annotations/DefaultPojomaticPolicy.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/annotations/PojoFormat.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/annotations/PojomaticPolicy.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/annotations/Property.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/annotations/PropertyFormat.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/diff/ branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/diff/AbstractNullDifference.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/diff/Difference.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/diff/DifferenceFromNull.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/diff/DifferenceToNull.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/diff/Differences.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/diff/NoDifferences.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/diff/PropertyDifferences.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/formatter/ branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/formatter/AccountNumberFormatter.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/formatter/DefaultPojoFormatter.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/formatter/DefaultPropertyFormatter.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/formatter/PojoFormatter.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/formatter/PropertyFormatter.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/internal/ branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/internal/AbstractPropertyElement.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/internal/OverridableMethods.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/internal/PojomatorImpl.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/internal/PropertyAccessor.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/internal/PropertyField.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/internal/PropertyFilter.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/internal/PropertyRole.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/internal/SelfPopulatingMap.java branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/internal/package-info.java branches/TestUtils/Pojomatic/src/main/javadoc/ branches/TestUtils/Pojomatic/src/main/javadoc/overview.html branches/TestUtils/Pojomatic/src/pmd.xml branches/TestUtils/Pojomatic/src/site/ branches/TestUtils/Pojomatic/src/site/apt/ branches/TestUtils/Pojomatic/src/site/apt/changes.apt branches/TestUtils/Pojomatic/src/site/apt/index.apt branches/TestUtils/Pojomatic/src/site/resources/ branches/TestUtils/Pojomatic/src/site/resources/css/ branches/TestUtils/Pojomatic/src/site/resources/css/site.css branches/TestUtils/Pojomatic/src/site/site.xml branches/TestUtils/Pojomatic/src/test/ branches/TestUtils/Pojomatic/src/test/java/ branches/TestUtils/Pojomatic/src/test/java/examples/ branches/TestUtils/Pojomatic/src/test/java/examples/Auto.java branches/TestUtils/Pojomatic/src/test/java/examples/Common.java branches/TestUtils/Pojomatic/src/test/java/examples/Customer.java branches/TestUtils/Pojomatic/src/test/java/examples/Employee.java branches/TestUtils/Pojomatic/src/test/java/examples/GetterAccess.java branches/TestUtils/Pojomatic/src/test/java/examples/Manual.java branches/TestUtils/Pojomatic/src/test/java/examples/Person.java branches/TestUtils/Pojomatic/src/test/java/examples/PersonMain.java branches/TestUtils/Pojomatic/src/test/java/examples/TestPojo.java branches/TestUtils/Pojomatic/src/test/java/org/ branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/ branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/PojomaticTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/TestUtils.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/diff/ branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/diff/DifferenceFromNullTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/diff/DifferenceTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/diff/DifferenceToNullTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/diff/NoDifferencesTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/diff/PropertyDifferencesTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/formatter/ branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/formatter/AccountNumberFormatterTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/formatter/DefaultPojoFormatterTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/formatter/DefaultPropertyFormatterTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/ branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/ClassPropertiesTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/OverridableMethodsTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/PojomatorImplTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/PropertyElementTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/PropertyFilterTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/SelfPopulatingMapTest.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/a/ branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/a/C1.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/a/C3.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/b/ branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/b/C2.java branches/TestUtils/Pojomatic/src/test/java/org/pojomatic/internal/b/C4.java branches/TestUtils/PojomaticTestUtils/.classpath branches/TestUtils/PojomaticTestUtils/.project branches/TestUtils/PojomaticTestUtils/.settings/ branches/TestUtils/PojomaticTestUtils/.settings/org.eclipse.jdt.core.prefs branches/TestUtils/PojomaticTestUtils/.settings/org.maven.ide.eclipse.prefs branches/TestUtils/PojomaticTestUtils/pom.xml branches/TestUtils/PojomaticTestUtils/src/ branches/TestUtils/PojomaticTestUtils/src/main/ branches/TestUtils/PojomaticTestUtils/src/main/java/ branches/TestUtils/PojomaticTestUtils/src/main/java/org/ branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/ branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/junit/ branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/junit/PojomaticAssert.java branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/test/ branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/test/AssertUtils.java branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/testng/ branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/testng/PojomaticAssert.java branches/TestUtils/PojomaticTestUtils/src/test/ branches/TestUtils/PojomaticTestUtils/src/test/java/ branches/TestUtils/PojomaticTestUtils/src/test/java/org/ branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/ branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/junit/ branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/junit/PojomaticAssertTest.java branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/ branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/AssertTest.java branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/AssertUtilsTest.java branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/Container.java branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/OnlyPojomaticEqual.java branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/testng/ branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/testng/PojomaticAssertTest.java branches/TestUtils/pojomatic-core/ branches/TestUtils/pojomatic-test-utils/ Property changes on: branches/TestUtils/Pojomatic ___________________________________________________________________ Added: svn:ignore + target bin Deleted: branches/TestUtils/Pojomatic/.classpath =================================================================== --- branches/TestUtils/Pojomatic/.classpath 2009-08-20 05:37:29 UTC (rev 135) +++ branches/TestUtils/Pojomatic/.classpath 2009-08-24 00:33:03 UTC (rev 139) @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry including="**/*.java" kind="src" path="src/main/java"/> - <classpathentry including="**/*.java" kind="src" path="src/test/java"/> - <classpathentry kind="con" path="org.devzuz.q.maven.jdt.core.mavenClasspathContainer"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="output" path="bin"/> -</classpath> Copied: branches/TestUtils/Pojomatic/.classpath (from rev 135, branches/TestUtils/Pojomatic/.classpath) =================================================================== --- branches/TestUtils/Pojomatic/.classpath (rev 0) +++ branches/TestUtils/Pojomatic/.classpath 2009-08-24 00:33:03 UTC (rev 139) @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry including="**/*.java" kind="src" path="src/main/java"/> + <classpathentry including="**/*.java" kind="src" path="src/test/java"/> + <classpathentry kind="con" path="org.devzuz.q.maven.jdt.core.mavenClasspathContainer"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="bin"/> +</classpath> Deleted: branches/TestUtils/Pojomatic/.project =================================================================== --- branches/TestUtils/Pojomatic/.project 2009-08-20 05:37:29 UTC (rev 135) +++ branches/TestUtils/Pojomatic/.project 2009-08-24 00:33:03 UTC (rev 139) @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>Pojomatic</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.devzuz.q.maven.jdt.core.mavenIncrementalBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.devzuz.q.maven.jdt.core.mavenNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> Copied: branches/TestUtils/Pojomatic/.project (from rev 135, branches/TestUtils/Pojomatic/.project) =================================================================== --- branches/TestUtils/Pojomatic/.project (rev 0) +++ branches/TestUtils/Pojomatic/.project 2009-08-24 00:33:03 UTC (rev 139) @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>Pojomatic</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.devzuz.q.maven.jdt.core.mavenIncrementalBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.devzuz.q.maven.jdt.core.mavenNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Deleted: branches/TestUtils/Pojomatic/pom.xml =================================================================== --- branches/TestUtils/Pojomatic/pom.xml 2009-08-20 05:37:29 UTC (rev 135) +++ branches/TestUtils/Pojomatic/pom.xml 2009-08-24 00:33:03 UTC (rev 139) @@ -1,164 +0,0 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.pojomatic</groupId> - <artifactId>pojomatic</artifactId> - <packaging>jar</packaging> - <version>TestUtils-SNAPSHOT</version> - <name>Pojomatic</name> - <description> - Automatically provides configurable implementations of the - equals(Object), toString() and hashCode() methods inherited from java.lang.Object - </description> - <url>http://www.pojomatic.org</url> - <inceptionYear>2008</inceptionYear> - <scm> - <connection>scm:svn:https://pojomatic.svn.sourceforge.net/svnroot/pojomatic/trunk/Pojomatic</connection> - <developerConnection>scm:svn:https://pojomatic.svn.sourceforge.net/svnroot/pojomatic/trunk/Pojomatic</developerConnection> - <url>https://pojomatic.svn.sourceforge.net/svnroot/pojomatic/trunk/Pojomatic</url> - </scm> - <developers> - <developer> - <name>Ian Robertson</name> - <roles> - <role>Lead Developer</role> - </roles> - <email>ian...@gm...</email> - <id>ian.b.robertson</id> - <organization>Overstock.com</organization> - <organizationUrl>http://www.overstock.com</organizationUrl> - <url>http://www.artima.com/weblogs/index.jsp?blogger=ianr</url> - </developer> - <developer> - <name>Chris Hansen</name> - <roles> - <role>Lead Developer</role> - </roles> - <email>han...@gm...</email> - <id>hansen.chris.w</id> - <organization>Overstock.com</organization> - <organizationUrl>http://www.overstock.com</organizationUrl> - <url>http://polyglot-window.blogspot.com/</url> - </developer> - </developers> - <licenses> - <license> - <name>Apache License 2.0</name> - <url>http://www.apache.org/licenses/LICENSE-2.0</url> - <distribution>repo</distribution> - </license> - </licenses> - <issueManagement> - <system>Sourceforge</system> - <url>https://sourceforge.net/tracker/?func=browse&group_id=239113</url> - </issueManagement> - <distributionManagement> - <repository> - <id>pojomatic-releases</id> - <name>Pojomatic Release Repository</name> - <url>sftp://web.sourceforge.net/home/groups/p/po/pojomatic/releases</url> - </repository> - <snapshotRepository> - <id>pojomatic-snapshots</id> - <name>Pojomatic snapshot Repository</name> - <url>sftp://web.sourceforge.net/home/groups/p/po/pojomatic/snapshots</url> - </snapshotRepository> - <site> - <id>pojomatic-site</id> - <name>Pojomatic</name> - <!-- before deploying, you'll need to run ssh <username>,poj...@sh... create --> - <url>scp://shell.sourceforge.net/home/groups/p/po/pojomatic/htdocs</url> - </site> - </distributionManagement> - <mailingLists> - <mailingList> - <archive>http://sourceforge.net/mailarchive/forum.php?forum_name=pojomatic-users</archive> - <name>pojomatic-users</name> - <post>poj...@li...</post> - <subscribe>http://lists.sourceforge.net/mailman/listinfo/pojomatic-users</subscribe> - <unsubscribe>http://lists.sourceforge.net/mailman/listinfo/pojomatic-users</unsubscribe> - </mailingList> - </mailingLists> - <build> - <plugins> - <plugin> - <artifactId>maven-compiler-plugin</artifactId> - <version>2.0.2</version> - <configuration> - <source>1.5</source> - <target>1.5</target> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <version>2.4.2</version> - <configuration> - <excludes> - <exclude>**/TestUtils.java</exclude> - <exclude>examples/*.java</exclude> - </excludes> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-release-plugin</artifactId> - <version>2.0-beta-9</version> - </plugin> - </plugins> - - </build> - - <reporting> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-javadoc-plugin</artifactId> - <version>2.4</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-site-plugin</artifactId> - <version>2.0-beta-5</version> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>findbugs-maven-plugin</artifactId> - <version>1.1.1</version> - <configuration> - <excludeFilterFile>${basedir}/FindBugsFilter.xml</excludeFilterFile> - </configuration> - </plugin> - <plugin> - <artifactId>maven-surefire-report-plugin</artifactId> - <version>2.4.2</version> - </plugin> - <plugin> - <artifactId>maven-jxr-plugin</artifactId> - <version>2.1</version> - </plugin> - <plugin> - <artifactId>maven-pmd-plugin</artifactId> - <configuration> - <targetJdk>1.5</targetJdk> - <rulesets> - <ruleset>${project.basedir}/src/pmd.xml</ruleset> - </rulesets> - <includeTests>true</includeTests> - </configuration> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>cobertura-maven-plugin</artifactId> - <version>2.2</version> - </plugin> - </plugins> - </reporting> - <dependencies> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.4</version> - <scope>test</scope> - </dependency> - </dependencies> -</project> Copied: branches/TestUtils/Pojomatic/pom.xml (from rev 135, branches/TestUtils/Pojomatic/pom.xml) =================================================================== --- branches/TestUtils/Pojomatic/pom.xml (rev 0) +++ branches/TestUtils/Pojomatic/pom.xml 2009-08-24 00:33:03 UTC (rev 139) @@ -0,0 +1,164 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.pojomatic</groupId> + <artifactId>pojomatic</artifactId> + <packaging>jar</packaging> + <version>TestUtils-SNAPSHOT</version> + <name>Pojomatic</name> + <description> + Automatically provides configurable implementations of the + equals(Object), toString() and hashCode() methods inherited from java.lang.Object + </description> + <url>http://www.pojomatic.org</url> + <inceptionYear>2008</inceptionYear> + <scm> + <connection>scm:svn:https://pojomatic.svn.sourceforge.net/svnroot/pojomatic/trunk/Pojomatic</connection> + <developerConnection>scm:svn:https://pojomatic.svn.sourceforge.net/svnroot/pojomatic/trunk/Pojomatic</developerConnection> + <url>https://pojomatic.svn.sourceforge.net/svnroot/pojomatic/trunk/Pojomatic</url> + </scm> + <developers> + <developer> + <name>Ian Robertson</name> + <roles> + <role>Lead Developer</role> + </roles> + <email>ian...@gm...</email> + <id>ian.b.robertson</id> + <organization>Overstock.com</organization> + <organizationUrl>http://www.overstock.com</organizationUrl> + <url>http://www.artima.com/weblogs/index.jsp?blogger=ianr</url> + </developer> + <developer> + <name>Chris Hansen</name> + <roles> + <role>Lead Developer</role> + </roles> + <email>han...@gm...</email> + <id>hansen.chris.w</id> + <organization>Overstock.com</organization> + <organizationUrl>http://www.overstock.com</organizationUrl> + <url>http://polyglot-window.blogspot.com/</url> + </developer> + </developers> + <licenses> + <license> + <name>Apache License 2.0</name> + <url>http://www.apache.org/licenses/LICENSE-2.0</url> + <distribution>repo</distribution> + </license> + </licenses> + <issueManagement> + <system>Sourceforge</system> + <url>https://sourceforge.net/tracker/?func=browse&group_id=239113</url> + </issueManagement> + <distributionManagement> + <repository> + <id>pojomatic-releases</id> + <name>Pojomatic Release Repository</name> + <url>sftp://web.sourceforge.net/home/groups/p/po/pojomatic/releases</url> + </repository> + <snapshotRepository> + <id>pojomatic-snapshots</id> + <name>Pojomatic snapshot Repository</name> + <url>sftp://web.sourceforge.net/home/groups/p/po/pojomatic/snapshots</url> + </snapshotRepository> + <site> + <id>pojomatic-site</id> + <name>Pojomatic</name> + <!-- before deploying, you'll need to run ssh <username>,poj...@sh... create --> + <url>scp://shell.sourceforge.net/home/groups/p/po/pojomatic/htdocs</url> + </site> + </distributionManagement> + <mailingLists> + <mailingList> + <archive>http://sourceforge.net/mailarchive/forum.php?forum_name=pojomatic-users</archive> + <name>pojomatic-users</name> + <post>poj...@li...</post> + <subscribe>http://lists.sourceforge.net/mailman/listinfo/pojomatic-users</subscribe> + <unsubscribe>http://lists.sourceforge.net/mailman/listinfo/pojomatic-users</unsubscribe> + </mailingList> + </mailingLists> + <build> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.0.2</version> + <configuration> + <source>1.5</source> + <target>1.5</target> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.4.2</version> + <configuration> + <excludes> + <exclude>**/TestUtils.java</exclude> + <exclude>examples/*.java</exclude> + </excludes> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-release-plugin</artifactId> + <version>2.0-beta-9</version> + </plugin> + </plugins> + + </build> + + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>2.4</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-site-plugin</artifactId> + <version>2.0-beta-5</version> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>findbugs-maven-plugin</artifactId> + <version>1.1.1</version> + <configuration> + <excludeFilterFile>${basedir}/FindBugsFilter.xml</excludeFilterFile> + </configuration> + </plugin> + <plugin> + <artifactId>maven-surefire-report-plugin</artifactId> + <version>2.4.2</version> + </plugin> + <plugin> + <artifactId>maven-jxr-plugin</artifactId> + <version>2.1</version> + </plugin> + <plugin> + <artifactId>maven-pmd-plugin</artifactId> + <configuration> + <targetJdk>1.5</targetJdk> + <rulesets> + <ruleset>${project.basedir}/src/pmd.xml</ruleset> + </rulesets> + <includeTests>true</includeTests> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>cobertura-maven-plugin</artifactId> + <version>2.2</version> + </plugin> + </plugins> + </reporting> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.4</version> + <scope>test</scope> + </dependency> + </dependencies> +</project> Deleted: branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/Pojomatic.java =================================================================== --- branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/Pojomatic.java 2009-08-20 05:37:29 UTC (rev 135) +++ branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/Pojomatic.java 2009-08-24 00:33:03 UTC (rev 139) @@ -1,158 +0,0 @@ -package org.pojomatic; - -import org.pojomatic.diff.DifferenceFromNull; -import org.pojomatic.diff.Differences; -import org.pojomatic.diff.NoDifferences; -import org.pojomatic.internal.PojomatorImpl; -import org.pojomatic.internal.SelfPopulatingMap; - -/** - * Static methods for implementing the {@link java.lang.Object#equals(Object)}, - * {@link java.lang.Object#hashCode()} and {@link java.lang.Object#toString()} methods on a - * annotated POJO. The actual work for a given class is done by a {@link Pojomator} created for - * that class. This class is careful to create only a single {@code Pojomator} per POJO class. - * The overhead for looking up the {@code Pojomator} by POJO class is light, so a typical use in a - * POJO class would be - * <p style="background-color:#EEEEFF; margin: 1em"> - * <code> - * <font color="#646464">@Override</font> <font color="#7f0055"><b>public </b></font><font color="#7f0055"><b>int </b></font><font color="#000000">hashCode() {</font><br> - * <font color="#7f0055"><b>return </b></font><font color="#000000">Pojomatic.hashCode(</font><font color="#7f0055"><b>this</b></font><font color="#000000">);</font><br /> - * <font color="#000000">}</font><br> - * <br/> - * <font color="#646464">@Override</font> <font color="#7f0055"><b>public </b></font><font color="#7f0055"><b>boolean </b></font><font color="#000000">equals(Object other) {</font><br> - * <font color="#7f0055"><b>return </b></font><font color="#000000">Pojomatic.equals(</font><font color="#7f0055"><b>this</b></font><font color="#000000">, other);</font><br /> - * <font color="#000000">}</font><br> - * <br/> - * <font color="#646464">@Override</font> <font color="#7f0055"><b>public </b></font><font color="#000000">String toString() {</font><br> - * <font color="#7f0055"><b>return </b></font><font color="#000000">Pojomatic.toString(</font><font color="#7f0055"><b>this</b></font><font color="#000000">);</font><br /> - * <font color="#000000">}</font><br> - * <br/> - * </code> - * </p> - * Under the covers, these methods are referencing a {@link org.pojomatic.Pojomator Pojomator} instance - * which is created lazily and cached on a per-class basis. The performance penalty for this is - * negligible, but if profiling suggests that it is a bottleneck, one can do this by hand: - * <p style="background-color:#EEEEFF; margin: 1em"> - * <code> - * <font color="#ffffff"> </font><font color="#7f0055"><b>private final static </b></font><font color="#000000">Pojomator<Manual> POJOMATOR = Pojomatic.pojomator</font><font color="#000000">(</font><font color="#000000">Manual.</font><font color="#7f0055"><b>class</b></font><font color="#000000">)</font><font color="#000000">;</font><br /> - * <font color="#ffffff"></font><br /> - * <font color="#ffffff"> </font><font color="#646464">@Override </font><font color="#7f0055"><b>public </b></font><font color="#7f0055"><b>boolean </b></font><font color="#000000">equals</font><font color="#000000">(</font><font color="#000000">Object other</font><font color="#000000">) {</font><br /> - * <font color="#ffffff"> </font><font color="#7f0055"><b>return </b></font><font color="#000000">POJOMATOR.doEquals</font><font color="#000000">(</font><font color="#000000">this, other</font><font color="#000000">)</font><font color="#000000">;</font><br /> - * <font color="#ffffff"> </font><font color="#000000">}</font><br /> - * <font color="#ffffff"></font><br /> - * <font color="#ffffff"> </font><font color="#646464">@Override </font><font color="#7f0055"><b>public </b></font><font color="#7f0055"><b>int </b></font><font color="#000000">hashCode</font><font color="#000000">() {</font><br /> - * <font color="#ffffff"> </font><font color="#7f0055"><b>return </b></font><font color="#000000">POJOMATOR.doHashCode</font><font color="#000000">(</font><font color="#7f0055"><b>this</b></font><font color="#000000">)</font><font color="#000000">;</font><br /> - * <font color="#ffffff"> </font><font color="#000000">}</font><br /> - * <font color="#ffffff"></font><br /> - * <font color="#ffffff"> </font><font color="#646464">@Override </font><font color="#7f0055"><b>public </b></font><font color="#000000">String toString</font><font color="#000000">() {</font><br /> - * <font color="#ffffff"> </font><font color="#7f0055"><b>return </b></font><font color="#000000">POJOMATOR.doToString</font><font color="#000000">(</font><font color="#7f0055"><b>this</b></font><font color="#000000">)</font><font color="#000000">;</font><br /> - * <font color="#ffffff"> </font><font color="#000000">}</font> - * </code> - * </p> - * - * @see Pojomator - */ -public class Pojomatic { - - private static SelfPopulatingMap<Class<?>, Pojomator<?>> POJOMATORS = - new SelfPopulatingMap<Class<?>, Pojomator<?>>() { - @Override - @SuppressWarnings("unchecked") - // compiler does not know that the type parameter to Pojomator is the same as the type - // parameter to Class - protected Pojomator<?> create(Class<?> key) { - return new PojomatorImpl(key); - } - }; - - private Pojomatic() {} - - /** - * Compute the {@code toString} representation for a POJO. - * @param <T> the type of the POJO - * @param pojo the POJO - must not be null - * @return the {@code toString} representation of {@code pojo}. - * @throws IllegalArgumentException if {@code pojo}'s class has no properties annotated for use - * with Pojomatic - * @see Pojomator#doToString(Object) - */ - public static <T> String toString(T pojo) throws IllegalArgumentException { - return pojomator(getClass(pojo)).doToString(pojo); - } - - /** - * Compute the {@code hashCode} for a POJO. - * @param <T> the type of the POJO - * @param pojo the POJO - must not be null - * @return the {@code hashCode} for {@code pojo}. - * @throws IllegalArgumentException if {@code pojo}'s class has no properties annotated for use - * with Pojomatic - * @see Pojomator#doHashCode(Object) - */ - public static <T> int hashCode(T pojo) throws IllegalArgumentException { - return pojomator(getClass(pojo)).doHashCode(pojo); - } - - /** - * Compute whether {@code pojo} and {@code other} are equal to each other in the sense of - * {@code Object}'s {@code equals} method. - * @param <T> the type of the POJO - * @param pojo the POJO - must not be null - * @param other the object to compare to for equality - * @return whether {@code pojo} and {@code other} are equal to each other in the sense of - * {@code Object}'s {@code equals} method. - * @throws IllegalArgumentException if {@code pojo}'s class has no properties annotated for use - * with Pojomatic - * @see Pojomator#doEquals(Object, Object) - */ - public static <T> boolean equals(T pojo, Object other) throws IllegalArgumentException { - return pojomator(getClass(pojo)).doEquals(pojo, other); - } - - - /** - * Compute the differences between {@code pojo} and {@code other} among the properties - * examined by {@link #equals(Object, Object)} for type {@code T}. - * - * @param <T> the static type of the first object to compare - * @param <S> the static type of the first object to compare - * @param pojo the instance to diff against - * @param other the instance to diff - * @return the list of differences (possibly empty) between {@code instance} and {@code other} - * among the properties examined by {@link #equals(Object, Object)} for type {@code T}. - * @throws IllegalArgumentException if {@code pojo}'s class has no properties annotated for use - * with Pojomatic - */ - public static <T, S extends T> Differences diff(T pojo, S other) - throws NullPointerException, IllegalArgumentException { - if (pojo == null) { - if (other != null) { - return new DifferenceFromNull(other); - } - else { //both null - return NoDifferences.getInstance(); - } - } - - return pojomator(getClass(pojo)).doDiff(pojo, other); - } - - /** - * Get the {@code Pojomator} for {@code pojoClass}. The same instance will be returned every time - * for a given value of {@code pojoClass}. - * @param <T> the type represented by {@code pojoClass} - * @param pojoClass the class to create a {@code Pojomator} for. - * @return a {@code Pojomator<T>} - * @throws IllegalArgumentException if {@code pojoClass} has no properties annotated for use - * with Pojomatic - */ - @SuppressWarnings("unchecked") // compiler does not know that the type parameter to Pojomator is T - public static <T> Pojomator<T> pojomator(Class<T> pojoClass) throws IllegalArgumentException { - return (Pojomator<T>) POJOMATORS.get(pojoClass); - } - - @SuppressWarnings("unchecked") // Since Object.getClass returns Class<?> - private static <T> Class<T> getClass(T pojo) { - return (Class<T>) pojo.getClass(); - } -} Copied: branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/Pojomatic.java (from rev 135, branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/Pojomatic.java) =================================================================== --- branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/Pojomatic.java (rev 0) +++ branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/Pojomatic.java 2009-08-24 00:33:03 UTC (rev 139) @@ -0,0 +1,158 @@ +package org.pojomatic; + +import org.pojomatic.diff.DifferenceFromNull; +import org.pojomatic.diff.Differences; +import org.pojomatic.diff.NoDifferences; +import org.pojomatic.internal.PojomatorImpl; +import org.pojomatic.internal.SelfPopulatingMap; + +/** + * Static methods for implementing the {@link java.lang.Object#equals(Object)}, + * {@link java.lang.Object#hashCode()} and {@link java.lang.Object#toString()} methods on a + * annotated POJO. The actual work for a given class is done by a {@link Pojomator} created for + * that class. This class is careful to create only a single {@code Pojomator} per POJO class. + * The overhead for looking up the {@code Pojomator} by POJO class is light, so a typical use in a + * POJO class would be + * <p style="background-color:#EEEEFF; margin: 1em"> + * <code> + * <font color="#646464">@Override</font> <font color="#7f0055"><b>public </b></font><font color="#7f0055"><b>int </b></font><font color="#000000">hashCode() {</font><br> + * <font color="#7f0055"><b>return </b></font><font color="#000000">Pojomatic.hashCode(</font><font color="#7f0055"><b>this</b></font><font color="#000000">);</font><br /> + * <font color="#000000">}</font><br> + * <br/> + * <font color="#646464">@Override</font> <font color="#7f0055"><b>public </b></font><font color="#7f0055"><b>boolean </b></font><font color="#000000">equals(Object other) {</font><br> + * <font color="#7f0055"><b>return </b></font><font color="#000000">Pojomatic.equals(</font><font color="#7f0055"><b>this</b></font><font color="#000000">, other);</font><br /> + * <font color="#000000">}</font><br> + * <br/> + * <font color="#646464">@Override</font> <font color="#7f0055"><b>public </b></font><font color="#000000">String toString() {</font><br> + * <font color="#7f0055"><b>return </b></font><font color="#000000">Pojomatic.toString(</font><font color="#7f0055"><b>this</b></font><font color="#000000">);</font><br /> + * <font color="#000000">}</font><br> + * <br/> + * </code> + * </p> + * Under the covers, these methods are referencing a {@link org.pojomatic.Pojomator Pojomator} instance + * which is created lazily and cached on a per-class basis. The performance penalty for this is + * negligible, but if profiling suggests that it is a bottleneck, one can do this by hand: + * <p style="background-color:#EEEEFF; margin: 1em"> + * <code> + * <font color="#ffffff"> </font><font color="#7f0055"><b>private final static </b></font><font color="#000000">Pojomator<Manual> POJOMATOR = Pojomatic.pojomator</font><font color="#000000">(</font><font color="#000000">Manual.</font><font color="#7f0055"><b>class</b></font><font color="#000000">)</font><font color="#000000">;</font><br /> + * <font color="#ffffff"></font><br /> + * <font color="#ffffff"> </font><font color="#646464">@Override </font><font color="#7f0055"><b>public </b></font><font color="#7f0055"><b>boolean </b></font><font color="#000000">equals</font><font color="#000000">(</font><font color="#000000">Object other</font><font color="#000000">) {</font><br /> + * <font color="#ffffff"> </font><font color="#7f0055"><b>return </b></font><font color="#000000">POJOMATOR.doEquals</font><font color="#000000">(</font><font color="#000000">this, other</font><font color="#000000">)</font><font color="#000000">;</font><br /> + * <font color="#ffffff"> </font><font color="#000000">}</font><br /> + * <font color="#ffffff"></font><br /> + * <font color="#ffffff"> </font><font color="#646464">@Override </font><font color="#7f0055"><b>public </b></font><font color="#7f0055"><b>int </b></font><font color="#000000">hashCode</font><font color="#000000">() {</font><br /> + * <font color="#ffffff"> </font><font color="#7f0055"><b>return </b></font><font color="#000000">POJOMATOR.doHashCode</font><font color="#000000">(</font><font color="#7f0055"><b>this</b></font><font color="#000000">)</font><font color="#000000">;</font><br /> + * <font color="#ffffff"> </font><font color="#000000">}</font><br /> + * <font color="#ffffff"></font><br /> + * <font color="#ffffff"> </font><font color="#646464">@Override </font><font color="#7f0055"><b>public </b></font><font color="#000000">String toString</font><font color="#000000">() {</font><br /> + * <font color="#ffffff"> </font><font color="#7f0055"><b>return </b></font><font color="#000000">POJOMATOR.doToString</font><font color="#000000">(</font><font color="#7f0055"><b>this</b></font><font color="#000000">)</font><font color="#000000">;</font><br /> + * <font color="#ffffff"> </font><font color="#000000">}</font> + * </code> + * </p> + * + * @see Pojomator + */ +public class Pojomatic { + + private static SelfPopulatingMap<Class<?>, Pojomator<?>> POJOMATORS = + new SelfPopulatingMap<Class<?>, Pojomator<?>>() { + @Override + @SuppressWarnings("unchecked") + // compiler does not know that the type parameter to Pojomator is the same as the type + // parameter to Class + protected Pojomator<?> create(Class<?> key) { + return new PojomatorImpl(key); + } + }; + + private Pojomatic() {} + + /** + * Compute the {@code toString} representation for a POJO. + * @param <T> the type of the POJO + * @param pojo the POJO - must not be null + * @return the {@code toString} representation of {@code pojo}. + * @throws IllegalArgumentException if {@code pojo}'s class has no properties annotated for use + * with Pojomatic + * @see Pojomator#doToString(Object) + */ + public static <T> String toString(T pojo) throws IllegalArgumentException { + return pojomator(getClass(pojo)).doToString(pojo); + } + + /** + * Compute the {@code hashCode} for a POJO. + * @param <T> the type of the POJO + * @param pojo the POJO - must not be null + * @return the {@code hashCode} for {@code pojo}. + * @throws IllegalArgumentException if {@code pojo}'s class has no properties annotated for use + * with Pojomatic + * @see Pojomator#doHashCode(Object) + */ + public static <T> int hashCode(T pojo) throws IllegalArgumentException { + return pojomator(getClass(pojo)).doHashCode(pojo); + } + + /** + * Compute whether {@code pojo} and {@code other} are equal to each other in the sense of + * {@code Object}'s {@code equals} method. + * @param <T> the type of the POJO + * @param pojo the POJO - must not be null + * @param other the object to compare to for equality + * @return whether {@code pojo} and {@code other} are equal to each other in the sense of + * {@code Object}'s {@code equals} method. + * @throws IllegalArgumentException if {@code pojo}'s class has no properties annotated for use + * with Pojomatic + * @see Pojomator#doEquals(Object, Object) + */ + public static <T> boolean equals(T pojo, Object other) throws IllegalArgumentException { + return pojomator(getClass(pojo)).doEquals(pojo, other); + } + + + /** + * Compute the differences between {@code pojo} and {@code other} among the properties + * examined by {@link #equals(Object, Object)} for type {@code T}. + * + * @param <T> the static type of the first object to compare + * @param <S> the static type of the first object to compare + * @param pojo the instance to diff against + * @param other the instance to diff + * @return the list of differences (possibly empty) between {@code instance} and {@code other} + * among the properties examined by {@link #equals(Object, Object)} for type {@code T}. + * @throws IllegalArgumentException if {@code pojo}'s class has no properties annotated for use + * with Pojomatic + */ + public static <T, S extends T> Differences diff(T pojo, S other) + throws NullPointerException, IllegalArgumentException { + if (pojo == null) { + if (other != null) { + return new DifferenceFromNull(other); + } + else { //both null + return NoDifferences.getInstance(); + } + } + + return pojomator(getClass(pojo)).doDiff(pojo, other); + } + + /** + * Get the {@code Pojomator} for {@code pojoClass}. The same instance will be returned every time + * for a given value of {@code pojoClass}. + * @param <T> the type represented by {@code pojoClass} + * @param pojoClass the class to create a {@code Pojomator} for. + * @return a {@code Pojomator<T>} + * @throws IllegalArgumentException if {@code pojoClass} has no properties annotated for use + * with Pojomatic + */ + @SuppressWarnings("unchecked") // compiler does not know that the type parameter to Pojomator is T + public static <T> Pojomator<T> pojomator(Class<T> pojoClass) throws IllegalArgumentException { + return (Pojomator<T>) POJOMATORS.get(pojoClass); + } + + @SuppressWarnings("unchecked") // Since Object.getClass returns Class<?> + private static <T> Class<T> getClass(T pojo) { + return (Class<T>) pojo.getClass(); + } +} Deleted: branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/Pojomator.java =================================================================== --- branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/Pojomator.java 2009-08-20 05:37:29 UTC (rev 135) +++ branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/Pojomator.java 2009-08-24 00:33:03 UTC (rev 139) @@ -1,55 +0,0 @@ -package org.pojomatic; - -import org.pojomatic.diff.Differences; - -/** - * A provider of the three standard {@code Object} methods, - * {@link Object#equals(Object)}, {@link Object#hashCode()} and {@link Object#toString()}. - * - * @param <T> the class this {@code Pojomator} is generated for. - */ -public interface Pojomator<T> { - - /** - * Compute the hashCode for a given instance of {@code T}. - * - * @param instance the instance to compute the hashCode for - must not be {@code null} - * @return the hashCode of {@code instance} - * @see Object#hashCode() - */ - int doHashCode(T instance); - - /** - * Compute the {@code toString} representation for a given instance of {@code T} - * - * @param instance the instance to compute the {@code toString} representation for - must not be {@code null} - * @return the {@code toString} representation of {@code instance} - * @see Object#toString() - */ - String doToString(T instance); - - /** - * Compute whether {@code instance} and {@code other} are equal to each other in the sense of - * {@code Object}'s {@link Object#equals(Object) equals} method. - * - * @param instance the instance to test against - must not be {@code null} - * @param other the instance to test - * @return {@code true} if {@code instance} should be considered equal to {@code other}, and - * {@code false} otherwise. - * @see Object#equals(Object) - */ - boolean doEquals(T instance, Object other); - - /** - * Compute the differences between {@code instance} and {@code other} among the properties - * examined by {@link #doEquals(Object, Object)}. It is guaranteed that invoking - * {@link Differences#areEqual()} on the returned object will return true iff - * {@code instance.equals(other)}. - * - * @param instance the instance to diff against - * @param other the instance to diff - * @return the differences between {@code instance} and {@code other} - * among the properties examined by {@link #doEquals(Object, Object)}. - */ - Differences doDiff(T instance, T other); -} Copied: branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/Pojomator.java (from rev 135, branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/Pojomator.java) =================================================================== --- branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/Pojomator.java (rev 0) +++ branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/Pojomator.java 2009-08-24 00:33:03 UTC (rev 139) @@ -0,0 +1,55 @@ +package org.pojomatic; + +import org.pojomatic.diff.Differences; + +/** + * A provider of the three standard {@code Object} methods, + * {@link Object#equals(Object)}, {@link Object#hashCode()} and {@link Object#toString()}. + * + * @param <T> the class this {@code Pojomator} is generated for. + */ +public interface Pojomator<T> { + + /** + * Compute the hashCode for a given instance of {@code T}. + * + * @param instance the instance to compute the hashCode for - must not be {@code null} + * @return the hashCode of {@code instance} + * @see Object#hashCode() + */ + int doHashCode(T instance); + + /** + * Compute the {@code toString} representation for a given instance of {@code T} + * + * @param instance the instance to compute the {@code toString} representation for - must not be {@code null} + * @return the {@code toString} representation of {@code instance} + * @see Object#toString() + */ + String doToString(T instance); + + /** + * Compute whether {@code instance} and {@code other} are equal to each other in the sense of + * {@code Object}'s {@link Object#equals(Object) equals} method. + * + * @param instance the instance to test against - must not be {@code null} + * @param other the instance to test + * @return {@code true} if {@code instance} should be considered equal to {@code other}, and + * {@code false} otherwise. + * @see Object#equals(Object) + */ + boolean doEquals(T instance, Object other); + + /** + * Compute the differences between {@code instance} and {@code other} among the properties + * examined by {@link #doEquals(Object, Object)}. It is guaranteed that invoking + * {@link Differences#areEqual()} on the returned object will return true iff + * {@code instance.equals(other)}. + * + * @param instance the instance to diff against + * @param other the instance to diff + * @return the differences between {@code instance} and {@code other} + * among the properties examined by {@link #doEquals(Object, Object)}. + */ + Differences doDiff(T instance, T other); +} Deleted: branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/PropertyElement.java =================================================================== --- branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/PropertyElement.java 2009-08-20 05:37:29 UTC (rev 135) +++ branches/TestUtils/Pojomatic/src/main/java/org/pojomatic/PropertyElement.java 2009-08-24 00:33:03 UTC (rev 139) @@ -1,31 +0,0 @@ -package org.pojomatic; - -import java.lang.reflect.AnnotatedElement; - -/** - * A "property" on a class. In this context, all a property is is a means of obtaining a value from - * an instance. - */ -public interface PropertyElement { - - /** - * Get the name of this property. - * @return the name of this property. - */ - String getName(); - - /** - * Get the value held by this property from the given instance. - * - * @param instance the instance to get the value from - * @return the value held by the instance - */ - Object getValue(Object... [truncated message content] |
From: <chr...@us...> - 2009-08-24 00:24:57
|
Revision: 138 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=138&view=rev Author: chriswhansen Date: 2009-08-24 00:24:45 +0000 (Mon, 24 Aug 2009) Log Message: ----------- Undo folder rename. Added Paths: ----------- branches/TestUtils/pojomatic-core/ branches/TestUtils/pojomatic-core/.classpath branches/TestUtils/pojomatic-core/.project branches/TestUtils/pojomatic-core/.settings/ branches/TestUtils/pojomatic-core/pom.xml branches/TestUtils/pojomatic-core/src/ branches/TestUtils/pojomatic-core/src/main/ branches/TestUtils/pojomatic-core/src/main/java/ branches/TestUtils/pojomatic-core/src/main/java/org/ branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/ branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/Pojomatic.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/Pojomator.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/PropertyElement.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/annotations/ branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/annotations/AutoDetectPolicy.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/annotations/AutoProperty.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/annotations/DefaultPojomaticPolicy.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/annotations/PojoFormat.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/annotations/PojomaticPolicy.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/annotations/Property.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/annotations/PropertyFormat.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/diff/ branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/diff/AbstractNullDifference.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/diff/Difference.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/diff/DifferenceFromNull.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/diff/DifferenceToNull.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/diff/Differences.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/diff/NoDifferences.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/diff/PropertyDifferences.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/formatter/ branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/formatter/AccountNumberFormatter.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/formatter/DefaultPojoFormatter.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/formatter/DefaultPropertyFormatter.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/formatter/PojoFormatter.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/formatter/PropertyFormatter.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/internal/ branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/internal/AbstractPropertyElement.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/internal/ClassProperties.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/internal/OverridableMethods.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/internal/PojomatorImpl.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/internal/PropertyAccessor.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/internal/PropertyField.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/internal/PropertyFilter.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/internal/PropertyRole.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/internal/SelfPopulatingMap.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/internal/package-info.java branches/TestUtils/pojomatic-core/src/main/javadoc/ branches/TestUtils/pojomatic-core/src/main/javadoc/overview.html branches/TestUtils/pojomatic-core/src/pmd.xml branches/TestUtils/pojomatic-core/src/site/ branches/TestUtils/pojomatic-core/src/site/apt/ branches/TestUtils/pojomatic-core/src/site/apt/changes.apt branches/TestUtils/pojomatic-core/src/site/apt/index.apt branches/TestUtils/pojomatic-core/src/site/resources/ branches/TestUtils/pojomatic-core/src/site/resources/css/ branches/TestUtils/pojomatic-core/src/site/resources/css/site.css branches/TestUtils/pojomatic-core/src/site/site.xml branches/TestUtils/pojomatic-core/src/test/ branches/TestUtils/pojomatic-core/src/test/java/ branches/TestUtils/pojomatic-core/src/test/java/examples/ branches/TestUtils/pojomatic-core/src/test/java/examples/Auto.java branches/TestUtils/pojomatic-core/src/test/java/examples/Common.java branches/TestUtils/pojomatic-core/src/test/java/examples/Customer.java branches/TestUtils/pojomatic-core/src/test/java/examples/Employee.java branches/TestUtils/pojomatic-core/src/test/java/examples/GetterAccess.java branches/TestUtils/pojomatic-core/src/test/java/examples/Manual.java branches/TestUtils/pojomatic-core/src/test/java/examples/Person.java branches/TestUtils/pojomatic-core/src/test/java/examples/PersonMain.java branches/TestUtils/pojomatic-core/src/test/java/examples/TestPojo.java branches/TestUtils/pojomatic-core/src/test/java/org/ branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/ branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/PojomaticTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/TestUtils.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/diff/ branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/diff/DifferenceFromNullTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/diff/DifferenceTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/diff/DifferenceToNullTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/diff/NoDifferencesTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/diff/PropertyDifferencesTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/formatter/ branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/formatter/AccountNumberFormatterTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/formatter/DefaultPojoFormatterTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/formatter/DefaultPropertyFormatterTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/ branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/ClassPropertiesTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/OverridableMethodsTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/PojomatorImplTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/PropertyElementTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/PropertyFilterTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/SelfPopulatingMapTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/a/ branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/a/C1.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/a/C3.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/b/ branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/b/C2.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/b/C4.java Removed Paths: ------------- branches/TestUtils/pojomatic/ branches/TestUtils/pojomatic-core/.classpath branches/TestUtils/pojomatic-core/.project branches/TestUtils/pojomatic-core/.settings/ branches/TestUtils/pojomatic-core/pom.xml branches/TestUtils/pojomatic-core/src/ branches/TestUtils/pojomatic-core/src/main/ branches/TestUtils/pojomatic-core/src/main/java/ branches/TestUtils/pojomatic-core/src/main/java/org/ branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/ branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/Pojomatic.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/Pojomator.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/PropertyElement.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/annotations/ branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/annotations/AutoDetectPolicy.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/annotations/AutoProperty.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/annotations/DefaultPojomaticPolicy.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/annotations/PojoFormat.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/annotations/PojomaticPolicy.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/annotations/Property.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/annotations/PropertyFormat.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/diff/ branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/diff/AbstractNullDifference.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/diff/Difference.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/diff/DifferenceFromNull.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/diff/DifferenceToNull.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/diff/Differences.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/diff/NoDifferences.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/diff/PropertyDifferences.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/formatter/ branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/formatter/AccountNumberFormatter.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/formatter/DefaultPojoFormatter.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/formatter/DefaultPropertyFormatter.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/formatter/PojoFormatter.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/formatter/PropertyFormatter.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/internal/ branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/internal/AbstractPropertyElement.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/internal/ClassProperties.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/internal/OverridableMethods.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/internal/PojomatorImpl.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/internal/PropertyAccessor.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/internal/PropertyField.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/internal/PropertyFilter.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/internal/PropertyRole.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/internal/SelfPopulatingMap.java branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/internal/package-info.java branches/TestUtils/pojomatic-core/src/main/javadoc/ branches/TestUtils/pojomatic-core/src/main/javadoc/overview.html branches/TestUtils/pojomatic-core/src/pmd.xml branches/TestUtils/pojomatic-core/src/site/ branches/TestUtils/pojomatic-core/src/site/apt/ branches/TestUtils/pojomatic-core/src/site/apt/changes.apt branches/TestUtils/pojomatic-core/src/site/apt/index.apt branches/TestUtils/pojomatic-core/src/site/resources/ branches/TestUtils/pojomatic-core/src/site/resources/css/ branches/TestUtils/pojomatic-core/src/site/resources/css/site.css branches/TestUtils/pojomatic-core/src/site/site.xml branches/TestUtils/pojomatic-core/src/test/ branches/TestUtils/pojomatic-core/src/test/java/ branches/TestUtils/pojomatic-core/src/test/java/examples/ branches/TestUtils/pojomatic-core/src/test/java/examples/Auto.java branches/TestUtils/pojomatic-core/src/test/java/examples/Common.java branches/TestUtils/pojomatic-core/src/test/java/examples/Customer.java branches/TestUtils/pojomatic-core/src/test/java/examples/Employee.java branches/TestUtils/pojomatic-core/src/test/java/examples/GetterAccess.java branches/TestUtils/pojomatic-core/src/test/java/examples/Manual.java branches/TestUtils/pojomatic-core/src/test/java/examples/Person.java branches/TestUtils/pojomatic-core/src/test/java/examples/PersonMain.java branches/TestUtils/pojomatic-core/src/test/java/examples/TestPojo.java branches/TestUtils/pojomatic-core/src/test/java/org/ branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/ branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/PojomaticTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/TestUtils.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/diff/ branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/diff/DifferenceFromNullTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/diff/DifferenceTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/diff/DifferenceToNullTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/diff/NoDifferencesTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/diff/PropertyDifferencesTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/formatter/ branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/formatter/AccountNumberFormatterTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/formatter/DefaultPojoFormatterTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/formatter/DefaultPropertyFormatterTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/ branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/ClassPropertiesTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/OverridableMethodsTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/PojomatorImplTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/PropertyElementTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/PropertyFilterTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/SelfPopulatingMapTest.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/a/ branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/a/C1.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/a/C3.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/b/ branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/b/C2.java branches/TestUtils/pojomatic-core/src/test/java/org/pojomatic/internal/b/C4.java Property Changed: ---------------- branches/TestUtils/pojomatic-test-utils/ Property changes on: branches/TestUtils/pojomatic-core ___________________________________________________________________ Added: svn:ignore + target bin Added: svn:mergeinfo + Deleted: branches/TestUtils/pojomatic-core/.classpath =================================================================== --- branches/TestUtils/pojomatic-core/.classpath 2009-08-23 22:23:51 UTC (rev 136) +++ branches/TestUtils/pojomatic-core/.classpath 2009-08-24 00:24:45 UTC (rev 138) @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry including="**/*.java" kind="src" path="src/main/java"/> - <classpathentry including="**/*.java" kind="src" path="src/test/java"/> - <classpathentry kind="con" path="org.devzuz.q.maven.jdt.core.mavenClasspathContainer"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="output" path="bin"/> -</classpath> Copied: branches/TestUtils/pojomatic-core/.classpath (from rev 136, branches/TestUtils/pojomatic-core/.classpath) =================================================================== --- branches/TestUtils/pojomatic-core/.classpath (rev 0) +++ branches/TestUtils/pojomatic-core/.classpath 2009-08-24 00:24:45 UTC (rev 138) @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry including="**/*.java" kind="src" path="src/main/java"/> + <classpathentry including="**/*.java" kind="src" path="src/test/java"/> + <classpathentry kind="con" path="org.devzuz.q.maven.jdt.core.mavenClasspathContainer"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="bin"/> +</classpath> Deleted: branches/TestUtils/pojomatic-core/.project =================================================================== --- branches/TestUtils/pojomatic-core/.project 2009-08-23 22:23:51 UTC (rev 136) +++ branches/TestUtils/pojomatic-core/.project 2009-08-24 00:24:45 UTC (rev 138) @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>Pojomatic</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.devzuz.q.maven.jdt.core.mavenIncrementalBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.devzuz.q.maven.jdt.core.mavenNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> Copied: branches/TestUtils/pojomatic-core/.project (from rev 136, branches/TestUtils/pojomatic-core/.project) =================================================================== --- branches/TestUtils/pojomatic-core/.project (rev 0) +++ branches/TestUtils/pojomatic-core/.project 2009-08-24 00:24:45 UTC (rev 138) @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>Pojomatic</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.devzuz.q.maven.jdt.core.mavenIncrementalBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.devzuz.q.maven.jdt.core.mavenNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Deleted: branches/TestUtils/pojomatic-core/pom.xml =================================================================== --- branches/TestUtils/pojomatic-core/pom.xml 2009-08-23 22:23:51 UTC (rev 136) +++ branches/TestUtils/pojomatic-core/pom.xml 2009-08-24 00:24:45 UTC (rev 138) @@ -1,164 +0,0 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.pojomatic</groupId> - <artifactId>pojomatic</artifactId> - <packaging>jar</packaging> - <version>TestUtils-SNAPSHOT</version> - <name>Pojomatic</name> - <description> - Automatically provides configurable implementations of the - equals(Object), toString() and hashCode() methods inherited from java.lang.Object - </description> - <url>http://www.pojomatic.org</url> - <inceptionYear>2008</inceptionYear> - <scm> - <connection>scm:svn:https://pojomatic.svn.sourceforge.net/svnroot/pojomatic/trunk/Pojomatic</connection> - <developerConnection>scm:svn:https://pojomatic.svn.sourceforge.net/svnroot/pojomatic/trunk/Pojomatic</developerConnection> - <url>https://pojomatic.svn.sourceforge.net/svnroot/pojomatic/trunk/Pojomatic</url> - </scm> - <developers> - <developer> - <name>Ian Robertson</name> - <roles> - <role>Lead Developer</role> - </roles> - <email>ian...@gm...</email> - <id>ian.b.robertson</id> - <organization>Overstock.com</organization> - <organizationUrl>http://www.overstock.com</organizationUrl> - <url>http://www.artima.com/weblogs/index.jsp?blogger=ianr</url> - </developer> - <developer> - <name>Chris Hansen</name> - <roles> - <role>Lead Developer</role> - </roles> - <email>han...@gm...</email> - <id>hansen.chris.w</id> - <organization>Overstock.com</organization> - <organizationUrl>http://www.overstock.com</organizationUrl> - <url>http://polyglot-window.blogspot.com/</url> - </developer> - </developers> - <licenses> - <license> - <name>Apache License 2.0</name> - <url>http://www.apache.org/licenses/LICENSE-2.0</url> - <distribution>repo</distribution> - </license> - </licenses> - <issueManagement> - <system>Sourceforge</system> - <url>https://sourceforge.net/tracker/?func=browse&group_id=239113</url> - </issueManagement> - <distributionManagement> - <repository> - <id>pojomatic-releases</id> - <name>Pojomatic Release Repository</name> - <url>sftp://web.sourceforge.net/home/groups/p/po/pojomatic/releases</url> - </repository> - <snapshotRepository> - <id>pojomatic-snapshots</id> - <name>Pojomatic snapshot Repository</name> - <url>sftp://web.sourceforge.net/home/groups/p/po/pojomatic/snapshots</url> - </snapshotRepository> - <site> - <id>pojomatic-site</id> - <name>Pojomatic</name> - <!-- before deploying, you'll need to run ssh <username>,poj...@sh... create --> - <url>scp://shell.sourceforge.net/home/groups/p/po/pojomatic/htdocs</url> - </site> - </distributionManagement> - <mailingLists> - <mailingList> - <archive>http://sourceforge.net/mailarchive/forum.php?forum_name=pojomatic-users</archive> - <name>pojomatic-users</name> - <post>poj...@li...</post> - <subscribe>http://lists.sourceforge.net/mailman/listinfo/pojomatic-users</subscribe> - <unsubscribe>http://lists.sourceforge.net/mailman/listinfo/pojomatic-users</unsubscribe> - </mailingList> - </mailingLists> - <build> - <plugins> - <plugin> - <artifactId>maven-compiler-plugin</artifactId> - <version>2.0.2</version> - <configuration> - <source>1.5</source> - <target>1.5</target> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <version>2.4.2</version> - <configuration> - <excludes> - <exclude>**/TestUtils.java</exclude> - <exclude>examples/*.java</exclude> - </excludes> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-release-plugin</artifactId> - <version>2.0-beta-9</version> - </plugin> - </plugins> - - </build> - - <reporting> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-javadoc-plugin</artifactId> - <version>2.4</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-site-plugin</artifactId> - <version>2.0-beta-5</version> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>findbugs-maven-plugin</artifactId> - <version>1.1.1</version> - <configuration> - <excludeFilterFile>${basedir}/FindBugsFilter.xml</excludeFilterFile> - </configuration> - </plugin> - <plugin> - <artifactId>maven-surefire-report-plugin</artifactId> - <version>2.4.2</version> - </plugin> - <plugin> - <artifactId>maven-jxr-plugin</artifactId> - <version>2.1</version> - </plugin> - <plugin> - <artifactId>maven-pmd-plugin</artifactId> - <configuration> - <targetJdk>1.5</targetJdk> - <rulesets> - <ruleset>${project.basedir}/src/pmd.xml</ruleset> - </rulesets> - <includeTests>true</includeTests> - </configuration> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>cobertura-maven-plugin</artifactId> - <version>2.2</version> - </plugin> - </plugins> - </reporting> - <dependencies> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.4</version> - <scope>test</scope> - </dependency> - </dependencies> -</project> Copied: branches/TestUtils/pojomatic-core/pom.xml (from rev 136, branches/TestUtils/pojomatic-core/pom.xml) =================================================================== --- branches/TestUtils/pojomatic-core/pom.xml (rev 0) +++ branches/TestUtils/pojomatic-core/pom.xml 2009-08-24 00:24:45 UTC (rev 138) @@ -0,0 +1,164 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.pojomatic</groupId> + <artifactId>pojomatic</artifactId> + <packaging>jar</packaging> + <version>TestUtils-SNAPSHOT</version> + <name>Pojomatic</name> + <description> + Automatically provides configurable implementations of the + equals(Object), toString() and hashCode() methods inherited from java.lang.Object + </description> + <url>http://www.pojomatic.org</url> + <inceptionYear>2008</inceptionYear> + <scm> + <connection>scm:svn:https://pojomatic.svn.sourceforge.net/svnroot/pojomatic/trunk/Pojomatic</connection> + <developerConnection>scm:svn:https://pojomatic.svn.sourceforge.net/svnroot/pojomatic/trunk/Pojomatic</developerConnection> + <url>https://pojomatic.svn.sourceforge.net/svnroot/pojomatic/trunk/Pojomatic</url> + </scm> + <developers> + <developer> + <name>Ian Robertson</name> + <roles> + <role>Lead Developer</role> + </roles> + <email>ian...@gm...</email> + <id>ian.b.robertson</id> + <organization>Overstock.com</organization> + <organizationUrl>http://www.overstock.com</organizationUrl> + <url>http://www.artima.com/weblogs/index.jsp?blogger=ianr</url> + </developer> + <developer> + <name>Chris Hansen</name> + <roles> + <role>Lead Developer</role> + </roles> + <email>han...@gm...</email> + <id>hansen.chris.w</id> + <organization>Overstock.com</organization> + <organizationUrl>http://www.overstock.com</organizationUrl> + <url>http://polyglot-window.blogspot.com/</url> + </developer> + </developers> + <licenses> + <license> + <name>Apache License 2.0</name> + <url>http://www.apache.org/licenses/LICENSE-2.0</url> + <distribution>repo</distribution> + </license> + </licenses> + <issueManagement> + <system>Sourceforge</system> + <url>https://sourceforge.net/tracker/?func=browse&group_id=239113</url> + </issueManagement> + <distributionManagement> + <repository> + <id>pojomatic-releases</id> + <name>Pojomatic Release Repository</name> + <url>sftp://web.sourceforge.net/home/groups/p/po/pojomatic/releases</url> + </repository> + <snapshotRepository> + <id>pojomatic-snapshots</id> + <name>Pojomatic snapshot Repository</name> + <url>sftp://web.sourceforge.net/home/groups/p/po/pojomatic/snapshots</url> + </snapshotRepository> + <site> + <id>pojomatic-site</id> + <name>Pojomatic</name> + <!-- before deploying, you'll need to run ssh <username>,poj...@sh... create --> + <url>scp://shell.sourceforge.net/home/groups/p/po/pojomatic/htdocs</url> + </site> + </distributionManagement> + <mailingLists> + <mailingList> + <archive>http://sourceforge.net/mailarchive/forum.php?forum_name=pojomatic-users</archive> + <name>pojomatic-users</name> + <post>poj...@li...</post> + <subscribe>http://lists.sourceforge.net/mailman/listinfo/pojomatic-users</subscribe> + <unsubscribe>http://lists.sourceforge.net/mailman/listinfo/pojomatic-users</unsubscribe> + </mailingList> + </mailingLists> + <build> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.0.2</version> + <configuration> + <source>1.5</source> + <target>1.5</target> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.4.2</version> + <configuration> + <excludes> + <exclude>**/TestUtils.java</exclude> + <exclude>examples/*.java</exclude> + </excludes> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-release-plugin</artifactId> + <version>2.0-beta-9</version> + </plugin> + </plugins> + + </build> + + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>2.4</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-site-plugin</artifactId> + <version>2.0-beta-5</version> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>findbugs-maven-plugin</artifactId> + <version>1.1.1</version> + <configuration> + <excludeFilterFile>${basedir}/FindBugsFilter.xml</excludeFilterFile> + </configuration> + </plugin> + <plugin> + <artifactId>maven-surefire-report-plugin</artifactId> + <version>2.4.2</version> + </plugin> + <plugin> + <artifactId>maven-jxr-plugin</artifactId> + <version>2.1</version> + </plugin> + <plugin> + <artifactId>maven-pmd-plugin</artifactId> + <configuration> + <targetJdk>1.5</targetJdk> + <rulesets> + <ruleset>${project.basedir}/src/pmd.xml</ruleset> + </rulesets> + <includeTests>true</includeTests> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>cobertura-maven-plugin</artifactId> + <version>2.2</version> + </plugin> + </plugins> + </reporting> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.4</version> + <scope>test</scope> + </dependency> + </dependencies> +</project> Deleted: branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/Pojomatic.java =================================================================== --- branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/Pojomatic.java 2009-08-23 22:23:51 UTC (rev 136) +++ branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/Pojomatic.java 2009-08-24 00:24:45 UTC (rev 138) @@ -1,158 +0,0 @@ -package org.pojomatic; - -import org.pojomatic.diff.DifferenceFromNull; -import org.pojomatic.diff.Differences; -import org.pojomatic.diff.NoDifferences; -import org.pojomatic.internal.PojomatorImpl; -import org.pojomatic.internal.SelfPopulatingMap; - -/** - * Static methods for implementing the {@link java.lang.Object#equals(Object)}, - * {@link java.lang.Object#hashCode()} and {@link java.lang.Object#toString()} methods on a - * annotated POJO. The actual work for a given class is done by a {@link Pojomator} created for - * that class. This class is careful to create only a single {@code Pojomator} per POJO class. - * The overhead for looking up the {@code Pojomator} by POJO class is light, so a typical use in a - * POJO class would be - * <p style="background-color:#EEEEFF; margin: 1em"> - * <code> - * <font color="#646464">@Override</font> <font color="#7f0055"><b>public </b></font><font color="#7f0055"><b>int </b></font><font color="#000000">hashCode() {</font><br> - * <font color="#7f0055"><b>return </b></font><font color="#000000">Pojomatic.hashCode(</font><font color="#7f0055"><b>this</b></font><font color="#000000">);</font><br /> - * <font color="#000000">}</font><br> - * <br/> - * <font color="#646464">@Override</font> <font color="#7f0055"><b>public </b></font><font color="#7f0055"><b>boolean </b></font><font color="#000000">equals(Object other) {</font><br> - * <font color="#7f0055"><b>return </b></font><font color="#000000">Pojomatic.equals(</font><font color="#7f0055"><b>this</b></font><font color="#000000">, other);</font><br /> - * <font color="#000000">}</font><br> - * <br/> - * <font color="#646464">@Override</font> <font color="#7f0055"><b>public </b></font><font color="#000000">String toString() {</font><br> - * <font color="#7f0055"><b>return </b></font><font color="#000000">Pojomatic.toString(</font><font color="#7f0055"><b>this</b></font><font color="#000000">);</font><br /> - * <font color="#000000">}</font><br> - * <br/> - * </code> - * </p> - * Under the covers, these methods are referencing a {@link org.pojomatic.Pojomator Pojomator} instance - * which is created lazily and cached on a per-class basis. The performance penalty for this is - * negligible, but if profiling suggests that it is a bottleneck, one can do this by hand: - * <p style="background-color:#EEEEFF; margin: 1em"> - * <code> - * <font color="#ffffff"> </font><font color="#7f0055"><b>private final static </b></font><font color="#000000">Pojomator<Manual> POJOMATOR = Pojomatic.pojomator</font><font color="#000000">(</font><font color="#000000">Manual.</font><font color="#7f0055"><b>class</b></font><font color="#000000">)</font><font color="#000000">;</font><br /> - * <font color="#ffffff"></font><br /> - * <font color="#ffffff"> </font><font color="#646464">@Override </font><font color="#7f0055"><b>public </b></font><font color="#7f0055"><b>boolean </b></font><font color="#000000">equals</font><font color="#000000">(</font><font color="#000000">Object other</font><font color="#000000">) {</font><br /> - * <font color="#ffffff"> </font><font color="#7f0055"><b>return </b></font><font color="#000000">POJOMATOR.doEquals</font><font color="#000000">(</font><font color="#000000">this, other</font><font color="#000000">)</font><font color="#000000">;</font><br /> - * <font color="#ffffff"> </font><font color="#000000">}</font><br /> - * <font color="#ffffff"></font><br /> - * <font color="#ffffff"> </font><font color="#646464">@Override </font><font color="#7f0055"><b>public </b></font><font color="#7f0055"><b>int </b></font><font color="#000000">hashCode</font><font color="#000000">() {</font><br /> - * <font color="#ffffff"> </font><font color="#7f0055"><b>return </b></font><font color="#000000">POJOMATOR.doHashCode</font><font color="#000000">(</font><font color="#7f0055"><b>this</b></font><font color="#000000">)</font><font color="#000000">;</font><br /> - * <font color="#ffffff"> </font><font color="#000000">}</font><br /> - * <font color="#ffffff"></font><br /> - * <font color="#ffffff"> </font><font color="#646464">@Override </font><font color="#7f0055"><b>public </b></font><font color="#000000">String toString</font><font color="#000000">() {</font><br /> - * <font color="#ffffff"> </font><font color="#7f0055"><b>return </b></font><font color="#000000">POJOMATOR.doToString</font><font color="#000000">(</font><font color="#7f0055"><b>this</b></font><font color="#000000">)</font><font color="#000000">;</font><br /> - * <font color="#ffffff"> </font><font color="#000000">}</font> - * </code> - * </p> - * - * @see Pojomator - */ -public class Pojomatic { - - private static SelfPopulatingMap<Class<?>, Pojomator<?>> POJOMATORS = - new SelfPopulatingMap<Class<?>, Pojomator<?>>() { - @Override - @SuppressWarnings("unchecked") - // compiler does not know that the type parameter to Pojomator is the same as the type - // parameter to Class - protected Pojomator<?> create(Class<?> key) { - return new PojomatorImpl(key); - } - }; - - private Pojomatic() {} - - /** - * Compute the {@code toString} representation for a POJO. - * @param <T> the type of the POJO - * @param pojo the POJO - must not be null - * @return the {@code toString} representation of {@code pojo}. - * @throws IllegalArgumentException if {@code pojo}'s class has no properties annotated for use - * with Pojomatic - * @see Pojomator#doToString(Object) - */ - public static <T> String toString(T pojo) throws IllegalArgumentException { - return pojomator(getClass(pojo)).doToString(pojo); - } - - /** - * Compute the {@code hashCode} for a POJO. - * @param <T> the type of the POJO - * @param pojo the POJO - must not be null - * @return the {@code hashCode} for {@code pojo}. - * @throws IllegalArgumentException if {@code pojo}'s class has no properties annotated for use - * with Pojomatic - * @see Pojomator#doHashCode(Object) - */ - public static <T> int hashCode(T pojo) throws IllegalArgumentException { - return pojomator(getClass(pojo)).doHashCode(pojo); - } - - /** - * Compute whether {@code pojo} and {@code other} are equal to each other in the sense of - * {@code Object}'s {@code equals} method. - * @param <T> the type of the POJO - * @param pojo the POJO - must not be null - * @param other the object to compare to for equality - * @return whether {@code pojo} and {@code other} are equal to each other in the sense of - * {@code Object}'s {@code equals} method. - * @throws IllegalArgumentException if {@code pojo}'s class has no properties annotated for use - * with Pojomatic - * @see Pojomator#doEquals(Object, Object) - */ - public static <T> boolean equals(T pojo, Object other) throws IllegalArgumentException { - return pojomator(getClass(pojo)).doEquals(pojo, other); - } - - - /** - * Compute the differences between {@code pojo} and {@code other} among the properties - * examined by {@link #equals(Object, Object)} for type {@code T}. - * - * @param <T> the static type of the first object to compare - * @param <S> the static type of the first object to compare - * @param pojo the instance to diff against - * @param other the instance to diff - * @return the list of differences (possibly empty) between {@code instance} and {@code other} - * among the properties examined by {@link #equals(Object, Object)} for type {@code T}. - * @throws IllegalArgumentException if {@code pojo}'s class has no properties annotated for use - * with Pojomatic - */ - public static <T, S extends T> Differences diff(T pojo, S other) - throws NullPointerException, IllegalArgumentException { - if (pojo == null) { - if (other != null) { - return new DifferenceFromNull(other); - } - else { //both null - return NoDifferences.getInstance(); - } - } - - return pojomator(getClass(pojo)).doDiff(pojo, other); - } - - /** - * Get the {@code Pojomator} for {@code pojoClass}. The same instance will be returned every time - * for a given value of {@code pojoClass}. - * @param <T> the type represented by {@code pojoClass} - * @param pojoClass the class to create a {@code Pojomator} for. - * @return a {@code Pojomator<T>} - * @throws IllegalArgumentException if {@code pojoClass} has no properties annotated for use - * with Pojomatic - */ - @SuppressWarnings("unchecked") // compiler does not know that the type parameter to Pojomator is T - public static <T> Pojomator<T> pojomator(Class<T> pojoClass) throws IllegalArgumentException { - return (Pojomator<T>) POJOMATORS.get(pojoClass); - } - - @SuppressWarnings("unchecked") // Since Object.getClass returns Class<?> - private static <T> Class<T> getClass(T pojo) { - return (Class<T>) pojo.getClass(); - } -} Copied: branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/Pojomatic.java (from rev 136, branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/Pojomatic.java) =================================================================== --- branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/Pojomatic.java (rev 0) +++ branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/Pojomatic.java 2009-08-24 00:24:45 UTC (rev 138) @@ -0,0 +1,158 @@ +package org.pojomatic; + +import org.pojomatic.diff.DifferenceFromNull; +import org.pojomatic.diff.Differences; +import org.pojomatic.diff.NoDifferences; +import org.pojomatic.internal.PojomatorImpl; +import org.pojomatic.internal.SelfPopulatingMap; + +/** + * Static methods for implementing the {@link java.lang.Object#equals(Object)}, + * {@link java.lang.Object#hashCode()} and {@link java.lang.Object#toString()} methods on a + * annotated POJO. The actual work for a given class is done by a {@link Pojomator} created for + * that class. This class is careful to create only a single {@code Pojomator} per POJO class. + * The overhead for looking up the {@code Pojomator} by POJO class is light, so a typical use in a + * POJO class would be + * <p style="background-color:#EEEEFF; margin: 1em"> + * <code> + * <font color="#646464">@Override</font> <font color="#7f0055"><b>public </b></font><font color="#7f0055"><b>int </b></font><font color="#000000">hashCode() {</font><br> + * <font color="#7f0055"><b>return </b></font><font color="#000000">Pojomatic.hashCode(</font><font color="#7f0055"><b>this</b></font><font color="#000000">);</font><br /> + * <font color="#000000">}</font><br> + * <br/> + * <font color="#646464">@Override</font> <font color="#7f0055"><b>public </b></font><font color="#7f0055"><b>boolean </b></font><font color="#000000">equals(Object other) {</font><br> + * <font color="#7f0055"><b>return </b></font><font color="#000000">Pojomatic.equals(</font><font color="#7f0055"><b>this</b></font><font color="#000000">, other);</font><br /> + * <font color="#000000">}</font><br> + * <br/> + * <font color="#646464">@Override</font> <font color="#7f0055"><b>public </b></font><font color="#000000">String toString() {</font><br> + * <font color="#7f0055"><b>return </b></font><font color="#000000">Pojomatic.toString(</font><font color="#7f0055"><b>this</b></font><font color="#000000">);</font><br /> + * <font color="#000000">}</font><br> + * <br/> + * </code> + * </p> + * Under the covers, these methods are referencing a {@link org.pojomatic.Pojomator Pojomator} instance + * which is created lazily and cached on a per-class basis. The performance penalty for this is + * negligible, but if profiling suggests that it is a bottleneck, one can do this by hand: + * <p style="background-color:#EEEEFF; margin: 1em"> + * <code> + * <font color="#ffffff"> </font><font color="#7f0055"><b>private final static </b></font><font color="#000000">Pojomator<Manual> POJOMATOR = Pojomatic.pojomator</font><font color="#000000">(</font><font color="#000000">Manual.</font><font color="#7f0055"><b>class</b></font><font color="#000000">)</font><font color="#000000">;</font><br /> + * <font color="#ffffff"></font><br /> + * <font color="#ffffff"> </font><font color="#646464">@Override </font><font color="#7f0055"><b>public </b></font><font color="#7f0055"><b>boolean </b></font><font color="#000000">equals</font><font color="#000000">(</font><font color="#000000">Object other</font><font color="#000000">) {</font><br /> + * <font color="#ffffff"> </font><font color="#7f0055"><b>return </b></font><font color="#000000">POJOMATOR.doEquals</font><font color="#000000">(</font><font color="#000000">this, other</font><font color="#000000">)</font><font color="#000000">;</font><br /> + * <font color="#ffffff"> </font><font color="#000000">}</font><br /> + * <font color="#ffffff"></font><br /> + * <font color="#ffffff"> </font><font color="#646464">@Override </font><font color="#7f0055"><b>public </b></font><font color="#7f0055"><b>int </b></font><font color="#000000">hashCode</font><font color="#000000">() {</font><br /> + * <font color="#ffffff"> </font><font color="#7f0055"><b>return </b></font><font color="#000000">POJOMATOR.doHashCode</font><font color="#000000">(</font><font color="#7f0055"><b>this</b></font><font color="#000000">)</font><font color="#000000">;</font><br /> + * <font color="#ffffff"> </font><font color="#000000">}</font><br /> + * <font color="#ffffff"></font><br /> + * <font color="#ffffff"> </font><font color="#646464">@Override </font><font color="#7f0055"><b>public </b></font><font color="#000000">String toString</font><font color="#000000">() {</font><br /> + * <font color="#ffffff"> </font><font color="#7f0055"><b>return </b></font><font color="#000000">POJOMATOR.doToString</font><font color="#000000">(</font><font color="#7f0055"><b>this</b></font><font color="#000000">)</font><font color="#000000">;</font><br /> + * <font color="#ffffff"> </font><font color="#000000">}</font> + * </code> + * </p> + * + * @see Pojomator + */ +public class Pojomatic { + + private static SelfPopulatingMap<Class<?>, Pojomator<?>> POJOMATORS = + new SelfPopulatingMap<Class<?>, Pojomator<?>>() { + @Override + @SuppressWarnings("unchecked") + // compiler does not know that the type parameter to Pojomator is the same as the type + // parameter to Class + protected Pojomator<?> create(Class<?> key) { + return new PojomatorImpl(key); + } + }; + + private Pojomatic() {} + + /** + * Compute the {@code toString} representation for a POJO. + * @param <T> the type of the POJO + * @param pojo the POJO - must not be null + * @return the {@code toString} representation of {@code pojo}. + * @throws IllegalArgumentException if {@code pojo}'s class has no properties annotated for use + * with Pojomatic + * @see Pojomator#doToString(Object) + */ + public static <T> String toString(T pojo) throws IllegalArgumentException { + return pojomator(getClass(pojo)).doToString(pojo); + } + + /** + * Compute the {@code hashCode} for a POJO. + * @param <T> the type of the POJO + * @param pojo the POJO - must not be null + * @return the {@code hashCode} for {@code pojo}. + * @throws IllegalArgumentException if {@code pojo}'s class has no properties annotated for use + * with Pojomatic + * @see Pojomator#doHashCode(Object) + */ + public static <T> int hashCode(T pojo) throws IllegalArgumentException { + return pojomator(getClass(pojo)).doHashCode(pojo); + } + + /** + * Compute whether {@code pojo} and {@code other} are equal to each other in the sense of + * {@code Object}'s {@code equals} method. + * @param <T> the type of the POJO + * @param pojo the POJO - must not be null + * @param other the object to compare to for equality + * @return whether {@code pojo} and {@code other} are equal to each other in the sense of + * {@code Object}'s {@code equals} method. + * @throws IllegalArgumentException if {@code pojo}'s class has no properties annotated for use + * with Pojomatic + * @see Pojomator#doEquals(Object, Object) + */ + public static <T> boolean equals(T pojo, Object other) throws IllegalArgumentException { + return pojomator(getClass(pojo)).doEquals(pojo, other); + } + + + /** + * Compute the differences between {@code pojo} and {@code other} among the properties + * examined by {@link #equals(Object, Object)} for type {@code T}. + * + * @param <T> the static type of the first object to compare + * @param <S> the static type of the first object to compare + * @param pojo the instance to diff against + * @param other the instance to diff + * @return the list of differences (possibly empty) between {@code instance} and {@code other} + * among the properties examined by {@link #equals(Object, Object)} for type {@code T}. + * @throws IllegalArgumentException if {@code pojo}'s class has no properties annotated for use + * with Pojomatic + */ + public static <T, S extends T> Differences diff(T pojo, S other) + throws NullPointerException, IllegalArgumentException { + if (pojo == null) { + if (other != null) { + return new DifferenceFromNull(other); + } + else { //both null + return NoDifferences.getInstance(); + } + } + + return pojomator(getClass(pojo)).doDiff(pojo, other); + } + + /** + * Get the {@code Pojomator} for {@code pojoClass}. The same instance will be returned every time + * for a given value of {@code pojoClass}. + * @param <T> the type represented by {@code pojoClass} + * @param pojoClass the class to create a {@code Pojomator} for. + * @return a {@code Pojomator<T>} + * @throws IllegalArgumentException if {@code pojoClass} has no properties annotated for use + * with Pojomatic + */ + @SuppressWarnings("unchecked") // compiler does not know that the type parameter to Pojomator is T + public static <T> Pojomator<T> pojomator(Class<T> pojoClass) throws IllegalArgumentException { + return (Pojomator<T>) POJOMATORS.get(pojoClass); + } + + @SuppressWarnings("unchecked") // Since Object.getClass returns Class<?> + private static <T> Class<T> getClass(T pojo) { + return (Class<T>) pojo.getClass(); + } +} Deleted: branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/Pojomator.java =================================================================== --- branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/Pojomator.java 2009-08-23 22:23:51 UTC (rev 136) +++ branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/Pojomator.java 2009-08-24 00:24:45 UTC (rev 138) @@ -1,55 +0,0 @@ -package org.pojomatic; - -import org.pojomatic.diff.Differences; - -/** - * A provider of the three standard {@code Object} methods, - * {@link Object#equals(Object)}, {@link Object#hashCode()} and {@link Object#toString()}. - * - * @param <T> the class this {@code Pojomator} is generated for. - */ -public interface Pojomator<T> { - - /** - * Compute the hashCode for a given instance of {@code T}. - * - * @param instance the instance to compute the hashCode for - must not be {@code null} - * @return the hashCode of {@code instance} - * @see Object#hashCode() - */ - int doHashCode(T instance); - - /** - * Compute the {@code toString} representation for a given instance of {@code T} - * - * @param instance the instance to compute the {@code toString} representation for - must not be {@code null} - * @return the {@code toString} representation of {@code instance} - * @see Object#toString() - */ - String doToString(T instance); - - /** - * Compute whether {@code instance} and {@code other} are equal to each other in the sense of - * {@code Object}'s {@link Object#equals(Object) equals} method. - * - * @param instance the instance to test against - must not be {@code null} - * @param other the instance to test - * @return {@code true} if {@code instance} should be considered equal to {@code other}, and - * {@code false} otherwise. - * @see Object#equals(Object) - */ - boolean doEquals(T instance, Object other); - - /** - * Compute the differences between {@code instance} and {@code other} among the properties - * examined by {@link #doEquals(Object, Object)}. It is guaranteed that invoking - * {@link Differences#areEqual()} on the returned object will return true iff - * {@code instance.equals(other)}. - * - * @param instance the instance to diff against - * @param other the instance to diff - * @return the differences between {@code instance} and {@code other} - * among the properties examined by {@link #doEquals(Object, Object)}. - */ - Differences doDiff(T instance, T other); -} Copied: branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/Pojomator.java (from rev 136, branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/Pojomator.java) =================================================================== --- branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/Pojomator.java (rev 0) +++ branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/Pojomator.java 2009-08-24 00:24:45 UTC (rev 138) @@ -0,0 +1,55 @@ +package org.pojomatic; + +import org.pojomatic.diff.Differences; + +/** + * A provider of the three standard {@code Object} methods, + * {@link Object#equals(Object)}, {@link Object#hashCode()} and {@link Object#toString()}. + * + * @param <T> the class this {@code Pojomator} is generated for. + */ +public interface Pojomator<T> { + + /** + * Compute the hashCode for a given instance of {@code T}. + * + * @param instance the instance to compute the hashCode for - must not be {@code null} + * @return the hashCode of {@code instance} + * @see Object#hashCode() + */ + int doHashCode(T instance); + + /** + * Compute the {@code toString} representation for a given instance of {@code T} + * + * @param instance the instance to compute the {@code toString} representation for - must not be {@code null} + * @return the {@code toString} representation of {@code instance} + * @see Object#toString() + */ + String doToString(T instance); + + /** + * Compute whether {@code instance} and {@code other} are equal to each other in the sense of + * {@code Object}'s {@link Object#equals(Object) equals} method. + * + * @param instance the instance to test against - must not be {@code null} + * @param other the instance to test + * @return {@code true} if {@code instance} should be considered equal to {@code other}, and + * {@code false} otherwise. + * @see Object#equals(Object) + */ + boolean doEquals(T instance, Object other); + + /** + * Compute the differences between {@code instance} and {@code other} among the properties + * examined by {@link #doEquals(Object, Object)}. It is guaranteed that invoking + * {@link Differences#areEqual()} on the returned object will return true iff + * {@code instance.equals(other)}. + * + * @param instance the instance to diff against + * @param other the instance to diff + * @return the differences between {@code instance} and {@code other} + * among the properties examined by {@link #doEquals(Object, Object)}. + */ + Differences doDiff(T instance, T other); +} Deleted: branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/PropertyElement.java =================================================================== --- branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/PropertyElement.java 2009-08-23 22:23:51 UTC (rev 136) +++ branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/PropertyElement.java 2009-08-24 00:24:45 UTC (rev 138) @@ -1,31 +0,0 @@ -package org.pojomatic; - -import java.lang.reflect.AnnotatedElement; - -/** - * A "property" on a class. In this context, all a property is is a means of obtaining a value from - * an instance. - */ -public interface PropertyElement { - - /** - * Get the name of this property. - * @return the name of this property. - */ - String getName(); - - /** - * Get the value held by this property from the given instance. - * - * @param instance the instance to get the value from - * @return the value held by the instance - */ - Object getValue(Object instance); - - /** - * Get the original annotated element that this property is derived from. - * @return the original annotated element that this property is derived from. - */ - AnnotatedElement getElement(); - -} Copied: branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/PropertyElement.java (from rev 136, branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/PropertyElement.java) =================================================================== --- branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/PropertyElement.java (rev 0) +++ branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/PropertyElement.java 2009-08-24 00:24:45 UTC (rev 138) @@ -0,0 +1,31 @@ +package org.pojomatic; + +import java.lang.reflect.AnnotatedElement; + +/** + * A "property" on a class. In this context, all a property is is a means of obtaining a value from + * an instance. + */ +public interface PropertyElement { + + /** + * Get the name of this property. + * @return the name of this property. + */ + String getName(); + + /** + * Get the value held by this property from the given instance. + * + * @param instance the instance to get the value from + * @return the value held by the instance + */ + Object getValue(Object instance); + + /** + * Get the original annotated element that this property is derived from. + * @return the original annotated element that this property is derived from. + */ + AnnotatedElement getElement(); + +} Deleted: branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/annotations/AutoDetectPolicy.java =================================================================== --- branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/annotations/AutoDetectPolicy.java 2009-08-23 22:23:51 UTC (rev 136) +++ branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/annotations/AutoDetectPolicy.java 2009-08-24 00:24:45 UTC (rev 138) @@ -1,25 +0,0 @@ -package org.pojomatic.annotations; - -/** - * A policy for determining which class members are automatically detected as properties. This - * policy is set class-wide using {@link AutoProperty}. - */ -public enum AutoDetectPolicy { - /** - * Auto-detect fields of the class as properties - */ - FIELD, - - /** - * Auto-detect accessor methods of the class as properties using the JavaBean conventions - * (i.e. getX and isX). - */ - METHOD, - - /** - * Do not auto-detect properties for the class. This is be useful to specify - * a different {@link PojomaticPolicy} in {@link AutoProperty} without enabling - * property auto-detection. - */ - NONE; -} Copied: branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/annotations/AutoDetectPolicy.java (from rev 136, branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/annotations/AutoDetectPolicy.java) =================================================================== --- branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/annotations/AutoDetectPolicy.java (rev 0) +++ branches/TestUtils/pojomatic-core/src/main/java/org/pojomatic/annotations/AutoDetectPolicy.java 2009-08-24 00:24:45 UTC (rev 138) @@ -0,0 +1,25 @@ +package org.pojomatic.... [truncated message content] |
From: <chr...@us...> - 2009-08-24 00:18:55
|
Revision: 136 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=136&view=rev Author: chriswhansen Date: 2009-08-23 22:23:51 +0000 (Sun, 23 Aug 2009) Log Message: ----------- Move SVN folders to match artifact ids. Added Paths: ----------- branches/TestUtils/pojomatic-core/ branches/TestUtils/pojomatic-test-utils/ Removed Paths: ------------- branches/TestUtils/Pojomatic/ branches/TestUtils/PojomaticTestUtils/ Property changes on: branches/TestUtils/pojomatic-core ___________________________________________________________________ Added: svn:ignore + target bin Added: svn:mergeinfo + Property changes on: branches/TestUtils/pojomatic-test-utils ___________________________________________________________________ Added: svn:ignore + target Added: svn:mergeinfo + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-08-24 00:18:48
|
Revision: 137 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=137&view=rev Author: chriswhansen Date: 2009-08-23 22:30:07 +0000 (Sun, 23 Aug 2009) Log Message: ----------- Move SVN folders to match artifact ids. Added Paths: ----------- branches/TestUtils/pojomatic/ Removed Paths: ------------- branches/TestUtils/pojomatic-core/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-08-20 05:37:37
|
Revision: 135 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=135&view=rev Author: chriswhansen Date: 2009-08-20 05:37:29 +0000 (Thu, 20 Aug 2009) Log Message: ----------- Initial implementation of assertEqualsWithDiff() methods including JUnit-style and TestNG-style. Added Paths: ----------- branches/TestUtils/PojomaticTestUtils/.classpath branches/TestUtils/PojomaticTestUtils/.project branches/TestUtils/PojomaticTestUtils/.settings/ branches/TestUtils/PojomaticTestUtils/.settings/org.eclipse.jdt.core.prefs branches/TestUtils/PojomaticTestUtils/.settings/org.maven.ide.eclipse.prefs branches/TestUtils/PojomaticTestUtils/pom.xml branches/TestUtils/PojomaticTestUtils/src/ branches/TestUtils/PojomaticTestUtils/src/main/ branches/TestUtils/PojomaticTestUtils/src/main/java/ branches/TestUtils/PojomaticTestUtils/src/main/java/org/ branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/ branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/junit/ branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/junit/PojomaticAssert.java branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/test/ branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/test/AssertUtils.java branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/testng/ branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/testng/PojomaticAssert.java branches/TestUtils/PojomaticTestUtils/src/test/ branches/TestUtils/PojomaticTestUtils/src/test/java/ branches/TestUtils/PojomaticTestUtils/src/test/java/org/ branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/ branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/junit/ branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/junit/PojomaticAssertTest.java branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/ branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/AssertTest.java branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/AssertUtilsTest.java branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/Container.java branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/OnlyPojomaticEqual.java branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/testng/ branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/testng/PojomaticAssertTest.java Property Changed: ---------------- branches/TestUtils/PojomaticTestUtils/ Property changes on: branches/TestUtils/PojomaticTestUtils ___________________________________________________________________ Added: svn:ignore + target Added: branches/TestUtils/PojomaticTestUtils/.classpath =================================================================== --- branches/TestUtils/PojomaticTestUtils/.classpath (rev 0) +++ branches/TestUtils/PojomaticTestUtils/.classpath 2009-08-20 05:37:29 UTC (rev 135) @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" output="target/classes" path="src/main/java"/> + <classpathentry kind="src" output="target/test-classes" path="src/test/java"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> + <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/> + <classpathentry kind="output" path="target/classes"/> +</classpath> Added: branches/TestUtils/PojomaticTestUtils/.project =================================================================== --- branches/TestUtils/PojomaticTestUtils/.project (rev 0) +++ branches/TestUtils/PojomaticTestUtils/.project 2009-08-20 05:37:29 UTC (rev 135) @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>PojomaticTestUtils</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.iam.jdt.core.mavenIncrementalBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.maven.ide.eclipse.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.maven.ide.eclipse.maven2Nature</nature> + <nature>org.eclipse.iam.jdt.core.mavenNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Added: branches/TestUtils/PojomaticTestUtils/.settings/org.eclipse.jdt.core.prefs =================================================================== --- branches/TestUtils/PojomaticTestUtils/.settings/org.eclipse.jdt.core.prefs (rev 0) +++ branches/TestUtils/PojomaticTestUtils/.settings/org.eclipse.jdt.core.prefs 2009-08-20 05:37:29 UTC (rev 135) @@ -0,0 +1,12 @@ +#Thu Aug 06 23:32:41 MDT 2009 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.5 Added: branches/TestUtils/PojomaticTestUtils/.settings/org.maven.ide.eclipse.prefs =================================================================== --- branches/TestUtils/PojomaticTestUtils/.settings/org.maven.ide.eclipse.prefs (rev 0) +++ branches/TestUtils/PojomaticTestUtils/.settings/org.maven.ide.eclipse.prefs 2009-08-20 05:37:29 UTC (rev 135) @@ -0,0 +1,9 @@ +#Thu Aug 06 23:37:24 MDT 2009 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 Added: branches/TestUtils/PojomaticTestUtils/pom.xml =================================================================== --- branches/TestUtils/PojomaticTestUtils/pom.xml (rev 0) +++ branches/TestUtils/PojomaticTestUtils/pom.xml 2009-08-20 05:37:29 UTC (rev 135) @@ -0,0 +1,40 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.pojomatic</groupId> + <artifactId>pojomatic-test-utils</artifactId> + <packaging>jar</packaging> + <version>1.0-SNAPSHOT</version> + <name>pojomatic-test-utils</name> + <url>http://maven.apache.org</url> + + <dependencies> + <!-- TODO move this to a common parent pom --> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.6</version> + <scope>test</scope> + </dependency> + <dependency> + <!-- TODO move this to a common parent pom --> + <groupId>org.pojomatic</groupId> + <artifactId>pojomatic</artifactId> + <version>TestUtils-SNAPSHOT</version> + </dependency> + </dependencies> + + <build> + <plugins> + <!-- TODO move this to a common parent pom --> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.0.2</version> + <configuration> + <source>1.5</source> + <target>1.5</target> + </configuration> + </plugin> + </plugins> + </build> +</project> Added: branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/junit/PojomaticAssert.java =================================================================== --- branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/junit/PojomaticAssert.java (rev 0) +++ branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/junit/PojomaticAssert.java 2009-08-20 05:37:29 UTC (rev 135) @@ -0,0 +1,42 @@ +package org.pojomatic.junit; + +import org.pojomatic.Pojomatic; +import org.pojomatic.test.AssertUtils; + +/** + * Pojomatic-related JUnit-style assertion methods useful for writing tests. + * @see org.junit.Assert + */ +public class PojomaticAssert { + + /** + * Asserts that two possibly {@code null} objects are equal according to + * {@link Object#equals(Object)}. If not, the differences, + * via {@link Pojomatic#diff(Object, Object)}, are included in the failure message. + * + * @param expected the expected object + * @param actual the object which should be tested to equal the expected object + * @throws AssertionError if the objects are not equal, with details of the differences + * included in the message + * @see #assertEqualsWithDiff(Object, Object, String) + */ + public static void assertEqualsWithDiff(Object expected, Object actual) { + assertEqualsWithDiff(expected, actual, null); + } + + /** + * Asserts that two possibly {@code null} objects are equal according to + * {@link Object#equals(Object)}. If not, the differences, + * via {@link Pojomatic#diff(Object, Object)}, are included in the failure message. + * + * @param expected the expected object + * @param actual the object which should be tested to equal the expected object + * @throws AssertionError if the objects are not equal, with details of the differences + * included in the message + */ + public static void assertEqualsWithDiff(Object expected, Object actual, String message) { + AssertUtils.assertEquals(message, expected, actual); + } + + private PojomaticAssert() {} +} Added: branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/test/AssertUtils.java =================================================================== --- branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/test/AssertUtils.java (rev 0) +++ branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/test/AssertUtils.java 2009-08-20 05:37:29 UTC (rev 135) @@ -0,0 +1,55 @@ +package org.pojomatic.test; + +import org.pojomatic.Pojomatic; +import org.pojomatic.diff.Differences; + +/** + * This class is not meant to be a part of the public API. + */ +public class AssertUtils { + + /** + * Determines if two possibly {@code null} objects are equal. + * + * @return {@code true} if both objects are null, + * or {@code first} is non-null and {@code first.equals(second)}, + * {@code false} otherwise + * @see Object#equals(Object) + */ + public static boolean equal(Object first, Object second) { + if (first == null && second == null) { + return true; + } + if (first != null && first.equals(second)) { + return true; + } + return false; + } + + /** + * Asserts that the objects are equal via {@link #equal(Object, Object)}. + * + * @param message the message to add if the assertion fails + * @param first will be displayed first if the assertion fails + * @param second will be displayed second if the assertion fails + * @throws AssertionError if the objects are not equal. {@link AssertionError#getMessage()} will + * include information about the differences + */ + public static void assertEquals(String message, Object first, Object second) { + if (!equal(first, second)) { + throw new AssertionError(buildMessage(message, Pojomatic.diff(first, second))); + } + } + + private static String buildMessage(String message, Differences differences) { + String formatted = ""; + if (message != null) { + formatted = message + " "; + } + + return formatted + differences.toString(); + } + + private AssertUtils() {} + +} Added: branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/testng/PojomaticAssert.java =================================================================== --- branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/testng/PojomaticAssert.java (rev 0) +++ branches/TestUtils/PojomaticTestUtils/src/main/java/org/pojomatic/testng/PojomaticAssert.java 2009-08-20 05:37:29 UTC (rev 135) @@ -0,0 +1,44 @@ +package org.pojomatic.testng; + +import org.pojomatic.Pojomatic; +import org.pojomatic.test.AssertUtils; + +/** + * Pojomatic-related TestNG-style assertion methods useful for writing tests. + * @see org.testng.Assert + */ +public class PojomaticAssert { + + /** + * Asserts that two possibly {@code null} objects are equal according to + * {@link Object#equals(Object)}. If not, the differences, + * via {@link Pojomatic#diff(Object, Object)}, are included in the failure message. + * + * @param expected the expected object + * @param actual the object which should be tested to equal the expected object + * @throws AssertionError if the objects are not equal, with details of the differences + * included in the message + * @see #assertEqualsWithDiff(Object, Object, String) + */ + public static void assertEqualsWithDiff(Object actual, Object expected) { + assertEqualsWithDiff(actual, expected, null); + } + + /** + * Asserts that two possibly {@code null} objects are equal according to + * {@link Object#equals(Object)}. If not, the differences, + * via {@link Pojomatic#diff(Object, Object)}, are included in the failure message. + * + * @param expected the expected object + * @param actual the object which should be tested to equal the expected object + * @param message an optional message provided along with the diff if the objects are not equal + * @throws AssertionError if the objects are not equal, with details of the differences + * included in the message + */ + public static void assertEqualsWithDiff(Object actual, Object expected, String message) { + //the arguments are passed as follows according to display order for a potential error message + AssertUtils.assertEquals(message, expected, actual); + } + + private PojomaticAssert() {} +} Added: branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/junit/PojomaticAssertTest.java =================================================================== --- branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/junit/PojomaticAssertTest.java (rev 0) +++ branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/junit/PojomaticAssertTest.java 2009-08-20 05:37:29 UTC (rev 135) @@ -0,0 +1,12 @@ +package org.pojomatic.junit; + +import org.pojomatic.test.AssertTest; + +public class PojomaticAssertTest extends AssertTest { + + @Override + protected void performAssertEquals(Object first, Object second) { + PojomaticAssert.assertEqualsWithDiff(first, second); + } + +} Added: branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/AssertTest.java =================================================================== --- branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/AssertTest.java (rev 0) +++ branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/AssertTest.java 2009-08-20 05:37:29 UTC (rev 135) @@ -0,0 +1,92 @@ +package org.pojomatic.test; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; +import org.pojomatic.Pojomatic; +import org.pojomatic.junit.PojomaticAssert; + +/** + * Tests assertion methods such as assertEquals(Object, Object) for correctness of assertions. + */ +public abstract class AssertTest { + + /** + * Only the unit under test should throw {@link AssertionError}, so no assertions are allowed + * within the implementation of this method. + * + * @param first the object which should appear first if the assertion fails. Note that this + * could be either "expected" or "actual". + * @param second the object which should appear second if the assertion fails. Note that this + * could be either "expected" or "actual". + */ + protected abstract void performAssertEquals(Object first, Object second); + + @Test + public final void assertEqualsBothNull() { + performAssertEquals(null, null); + } + + @Test(expected=AssertionError.class) + public final void assertEqualsNullExpected() { + performAssertEquals(null, new Container(null)); + } + + @Test(expected=AssertionError.class) + public final void assertEqualsNullActual() { + performAssertEquals(new Container(null), null); + } + + /** + * Tests that {@link PojomaticAssert#assertEqualsWithDiff(Object, Object)} + * uses {@link Object#equals(Object)} instead of {@link Pojomatic#equals(Object, Object)}. + */ + @Test(expected=AssertionError.class) + public final void assertEqualsViaInheritedEquals() { + //create objects which are never equal via Object.equals(Object), but are equal via + //Pojomatic.equals(Object, Object) + OnlyPojomaticEqual first = new OnlyPojomaticEqual(); + OnlyPojomaticEqual second = new OnlyPojomaticEqual(); + + performAssertEquals(first, second); + } + + @Test + public final void assertEqualsMessagingOrder() { + String first = "foo"; + String second = "bar"; + try { + performAssertEquals(new Container(first), new Container(second)); + } + catch (AssertionError e) { + //expected, check the message + assertAppearanceOrder(e.getMessage(), first, second); + } + } + + /** + * Asserts that {@code first} appears before {@code second} in {@code text}. + * + * @param text must contain both {@code first} and {@code second} + * @param first cannot be {@code null} + * @param second cannot be {@code null} + * @throws NullPointerException if {@code first} or {@code second} is {@code null} + * @throws IllegalArgumentException if {@code text} does not contain both + * {@code first} and {@code second} + */ + protected final void assertAppearanceOrder(String text, String first, String second) { + if (first == null || second == null) { + throw new NullPointerException(); + } + int firstIndex = text.indexOf(first); + int secondIndex = text.indexOf(second); + if (firstIndex < 0 || secondIndex < 0) { + throw new IllegalArgumentException("The string \"" + text + "\" does not conatin " + + "both \"" + first + "\" and \"" + second + "\""); + } + String message = "In the string \"" + text + "\", " + + "\"" + first + "\" should come before \"" + second + "\""; + assertTrue(message, firstIndex < secondIndex); + } + +} Added: branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/AssertUtilsTest.java =================================================================== --- branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/AssertUtilsTest.java (rev 0) +++ branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/AssertUtilsTest.java 2009-08-20 05:37:29 UTC (rev 135) @@ -0,0 +1,40 @@ +package org.pojomatic.test; + +import static org.junit.Assert.*; + +import org.junit.Test; + +public class AssertUtilsTest extends AssertTest { + + @Override + protected void performAssertEquals(Object first, Object second) { + AssertUtils.assertEquals(null, first, second); + } + + @Test + public void testEquals() { + assertTrue(AssertUtils.equal(new Container(""), new Container(""))); + } + + @Test + public void testEqualsReflexive() { + Container instance = new Container(""); + assertTrue(AssertUtils.equal(instance, instance)); + } + + @Test + public void testEqualsBothNull() { + assertTrue(AssertUtils.equal(null, null)); + } + + @Test + public void testEqualsNullFirst() { + assertFalse(AssertUtils.equal(null, new Container(null))); + } + + @Test + public void testEqualsNullSecond() { + assertFalse(AssertUtils.equal(new Container(null), null)); + } + +} Added: branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/Container.java =================================================================== --- branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/Container.java (rev 0) +++ branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/Container.java 2009-08-20 05:37:29 UTC (rev 135) @@ -0,0 +1,37 @@ +package org.pojomatic.test; + +import org.pojomatic.Pojomatic; +import org.pojomatic.annotations.AutoProperty; + +/** + * Simple one-object container for use in tests. + */ +@AutoProperty +public class Container { + + private final Object test; + + public Container(Object test) { + this.test = test; + } + + public Object getTest() { + return test; + } + + @Override + public int hashCode() { + return Pojomatic.hashCode(this); + } + + @Override + public String toString() { + return Pojomatic.toString(this); + } + + @Override + public boolean equals(Object o) { + return Pojomatic.equals(this, o); + } + +} Added: branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/OnlyPojomaticEqual.java =================================================================== --- branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/OnlyPojomaticEqual.java (rev 0) +++ branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/test/OnlyPojomaticEqual.java 2009-08-20 05:37:29 UTC (rev 135) @@ -0,0 +1,23 @@ +package org.pojomatic.test; + +import org.pojomatic.Pojomatic; +import org.pojomatic.annotations.AutoProperty; + +/** + * Class where every instance is equal via {@link Pojomatic#equals(Object, Object)}, but never + * by {@code this.equals(other)}. + */ +@AutoProperty +public class OnlyPojomaticEqual { + @SuppressWarnings("unused") + private final int number = 3; + + @Override + public boolean equals(Object obj) { + //cannot assert because only the unit under test should throw AssertionError + if (!Pojomatic.equals(this, obj)) { + throw new IllegalStateException("Invariant violated"); + } + return false; + } +} Added: branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/testng/PojomaticAssertTest.java =================================================================== --- branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/testng/PojomaticAssertTest.java (rev 0) +++ branches/TestUtils/PojomaticTestUtils/src/test/java/org/pojomatic/testng/PojomaticAssertTest.java 2009-08-20 05:37:29 UTC (rev 135) @@ -0,0 +1,13 @@ +package org.pojomatic.testng; + +import org.pojomatic.test.AssertTest; + +public class PojomaticAssertTest extends AssertTest { + + @Override + protected void performAssertEquals(Object first, Object second) { + //in TestNG, the arguments are included in any failure message in reverse order + PojomaticAssert.assertEqualsWithDiff(second, first); + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-08-20 05:29:10
|
Revision: 134 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=134&view=rev Author: chriswhansen Date: 2009-08-20 05:29:03 +0000 (Thu, 20 Aug 2009) Log Message: ----------- Branchify pom.xml Modified Paths: -------------- branches/TestUtils/Pojomatic/pom.xml Modified: branches/TestUtils/Pojomatic/pom.xml =================================================================== --- branches/TestUtils/Pojomatic/pom.xml 2009-08-20 05:24:54 UTC (rev 133) +++ branches/TestUtils/Pojomatic/pom.xml 2009-08-20 05:29:03 UTC (rev 134) @@ -3,7 +3,7 @@ <groupId>org.pojomatic</groupId> <artifactId>pojomatic</artifactId> <packaging>jar</packaging> - <version>trunk-SNAPSHOT</version> + <version>TestUtils-SNAPSHOT</version> <name>Pojomatic</name> <description> Automatically provides configurable implementations of the This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-08-20 05:25:04
|
Revision: 133 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=133&view=rev Author: chriswhansen Date: 2009-08-20 05:24:54 +0000 (Thu, 20 Aug 2009) Log Message: ----------- Initial import of test utils. Addresses 2832463 Added Paths: ----------- branches/TestUtils/PojomaticTestUtils/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-08-20 04:06:18
|
Revision: 132 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=132&view=rev Author: chriswhansen Date: 2009-08-20 04:06:12 +0000 (Thu, 20 Aug 2009) Log Message: ----------- Branch for work on the assert utility. Addresses 2832463 Added Paths: ----------- branches/TestUtils/ branches/TestUtils/Pojomatic/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <iro...@us...> - 2009-08-17 17:49:28
|
Revision: 131 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=131&view=rev Author: iroberts Date: 2009-08-17 17:49:13 +0000 (Mon, 17 Aug 2009) Log Message: ----------- No need for this test to be multithreaded Modified Paths: -------------- trunk/Pojomatic/src/test/java/org/pojomatic/internal/SelfPopulatingMapTest.java Modified: trunk/Pojomatic/src/test/java/org/pojomatic/internal/SelfPopulatingMapTest.java =================================================================== --- trunk/Pojomatic/src/test/java/org/pojomatic/internal/SelfPopulatingMapTest.java 2009-08-17 01:09:05 UTC (rev 130) +++ trunk/Pojomatic/src/test/java/org/pojomatic/internal/SelfPopulatingMapTest.java 2009-08-17 17:49:13 UTC (rev 131) @@ -49,37 +49,23 @@ final SelfPopulatingMap<String, String> selfPopulatingMap = new SelfPopulatingMap<String, String>() { @Override protected String create(String key) { - try { - Thread.sleep(10); // ensure that two threads have time to collide. - } - catch (InterruptedException e) {} if (firstTime.getAndSet(true)) { return new String(key); } else { - //first time through, throw an exception - throw new RuntimeException("This is expected: failing on first attempt"); + throw new RuntimeException("first"); } } }; - int numThreads = 2; - Thread[] threads = new Thread[numThreads]; - final String[] results = new String[numThreads]; - for (int i = 0; i < threads.length; i++) { - final int threadNumber = i; - threads[i] = new Thread() { - @Override public void run() { - results[threadNumber] = selfPopulatingMap.get("x"); - } - }; + + try { + selfPopulatingMap.get("x"); + fail("Exception expected"); } - for (Thread t: threads) { - t.start(); + catch(RuntimeException e) { + assertEquals("first", e.getMessage()); } - for (Thread t: threads) { - t.join(); - } - assertNull(results[0]); - assertEquals("x", results[1]); + + assertEquals("x", selfPopulatingMap.get("x")); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <iro...@us...> - 2009-08-17 01:09:16
|
Revision: 130 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=130&view=rev Author: iroberts Date: 2009-08-17 01:09:05 +0000 (Mon, 17 Aug 2009) Log Message: ----------- Support pojomators for interfaces Modified Paths: -------------- trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java trunk/Pojomatic/src/test/java/org/pojomatic/internal/ClassPropertiesTest.java Modified: trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java =================================================================== --- trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java 2009-08-16 17:17:24 UTC (rev 129) +++ trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java 2009-08-17 01:09:05 UTC (rev 130) @@ -48,7 +48,12 @@ * with Pojomatic. */ private ClassProperties(Class<?> pojoClass) throws IllegalArgumentException { - walkHierarchy(pojoClass, makeOverridableMethods()); + if (pojoClass.isInterface()) { + extractClassProperties(pojoClass, makeOverridableMethods()); + } + else { + walkHierarchy(pojoClass, makeOverridableMethods()); + } verifyPropertiesNotEmpty(pojoClass); } Modified: trunk/Pojomatic/src/test/java/org/pojomatic/internal/ClassPropertiesTest.java =================================================================== --- trunk/Pojomatic/src/test/java/org/pojomatic/internal/ClassPropertiesTest.java 2009-08-16 17:17:24 UTC (rev 129) +++ trunk/Pojomatic/src/test/java/org/pojomatic/internal/ClassPropertiesTest.java 2009-08-17 01:09:05 UTC (rev 130) @@ -206,6 +206,16 @@ } } + @Test public void testInterface() throws Exception { + ClassProperties classProperties = ClassProperties.createInstance(Interface.class); + PropertyElement getFoo = TestUtils.method(Interface.class, "getFoo"); + PropertyElement baz = TestUtils.method(Interface.class, "baz"); + assertEquals(asSet(getFoo), asSet(classProperties.getHashCodeProperties())); + assertEquals(asSet(getFoo), asSet(classProperties.getToStringProperties())); + assertEquals(asSet(getFoo, baz), asSet(classProperties.getEqualsProperties())); + + } + public static class FieldPojo { @SuppressWarnings("unused") @Property @@ -331,6 +341,13 @@ @Override public int getFoo() { return 2; } } + @AutoProperty(autoDetect=AutoDetectPolicy.METHOD) + public static interface Interface { + int getFoo(); + int bar(); + @Property(policy=PojomaticPolicy.EQUALS) int baz(); + } + public static class ChildExtendsAutoPojo extends ParentAutoPojo { @Property public String other; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <iro...@us...> - 2009-08-16 17:17:32
|
Revision: 129 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=129&view=rev Author: iroberts Date: 2009-08-16 17:17:24 +0000 (Sun, 16 Aug 2009) Log Message: ----------- Pojomatic will no longer add a method property multiple times if it is overridden (even if the overridden method is explicitely annotated). Modified Paths: -------------- trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java trunk/Pojomatic/src/test/java/org/pojomatic/internal/ClassPropertiesTest.java Added Paths: ----------- trunk/Pojomatic/src/main/java/org/pojomatic/internal/OverridableMethods.java trunk/Pojomatic/src/test/java/org/pojomatic/internal/OverridableMethodsTest.java trunk/Pojomatic/src/test/java/org/pojomatic/internal/a/ trunk/Pojomatic/src/test/java/org/pojomatic/internal/a/C1.java trunk/Pojomatic/src/test/java/org/pojomatic/internal/a/C3.java trunk/Pojomatic/src/test/java/org/pojomatic/internal/b/ trunk/Pojomatic/src/test/java/org/pojomatic/internal/b/C2.java trunk/Pojomatic/src/test/java/org/pojomatic/internal/b/C4.java Modified: trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java =================================================================== --- trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java 2009-08-16 15:05:21 UTC (rev 128) +++ trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java 2009-08-16 17:17:24 UTC (rev 129) @@ -48,18 +48,20 @@ * with Pojomatic. */ private ClassProperties(Class<?> pojoClass) throws IllegalArgumentException { - walkHierarchy(pojoClass); + walkHierarchy(pojoClass, makeOverridableMethods()); verifyPropertiesNotEmpty(pojoClass); } - private void walkHierarchy(Class<?> clazz) { + private void walkHierarchy( + Class<?> clazz, Map<PropertyRole, OverridableMethods> overridableMethods) { if (clazz != Object.class) { - walkHierarchy(clazz.getSuperclass()); - extractClassProperties(clazz); + walkHierarchy(clazz.getSuperclass(), overridableMethods); + extractClassProperties(clazz, overridableMethods); } } - private void extractClassProperties(Class<?> clazz) { + private void extractClassProperties( + Class<?> clazz, Map<PropertyRole, OverridableMethods> overridableMethods) { AutoProperty autoProperty = clazz.getAnnotation(AutoProperty.class); final DefaultPojomaticPolicy classPolicy = (autoProperty != null) ? autoProperty.policy() : null; @@ -67,11 +69,14 @@ (autoProperty != null) ? autoProperty.autoDetect() : null; extractFields(clazz, classPolicy, autoDetectPolicy); - extractMethods(clazz, classPolicy, autoDetectPolicy); + extractMethods(clazz, classPolicy, autoDetectPolicy, overridableMethods); } - private void extractMethods(Class<?> clazz, final DefaultPojomaticPolicy classPolicy, - final AutoDetectPolicy autoDetectPolicy) { + private void extractMethods( + Class<?> clazz, + final DefaultPojomaticPolicy classPolicy, + final AutoDetectPolicy autoDetectPolicy, + final Map<PropertyRole, OverridableMethods> overridableMethods) { for (Method method : clazz.getDeclaredMethods()) { Property property = method.getAnnotation(Property.class); if (isStatic(method)) { @@ -98,11 +103,14 @@ continue; } - /* add all methods that are explicitly annotated or auto-detected */ - if (propertyPolicy != null || - (AutoDetectPolicy.METHOD == autoDetectPolicy && !isStatic(method))) { - addPropertyToRoles( - new PropertyAccessor(method, getPropertyName(property)), classPolicy, propertyPolicy); + /* add all methods that are explicitly annotated or auto-detected, and not overriding already + * added methods */ + if (propertyPolicy != null || AutoDetectPolicy.METHOD == autoDetectPolicy) { + for (PropertyRole role : PropertyFilter.getRoles(propertyPolicy, classPolicy)) { + if(overridableMethods.get(role).checkAndMaybeAddMethod(method)) { + properties.get(role).add(new PropertyAccessor(method, getPropertyName(property))); + } + } } } } @@ -126,21 +134,13 @@ /* add all fields that are explicitly annotated or auto-detected */ if (propertyPolicy != null || AutoDetectPolicy.FIELD == autoDetectPolicy) { - addPropertyToRoles( - new PropertyField(field, getPropertyName(property)), classPolicy, propertyPolicy); + for (PropertyRole role : PropertyFilter.getRoles(propertyPolicy, classPolicy)) { + properties.get(role).add(new PropertyField(field, getPropertyName(property))); + } } } } - private void addPropertyToRoles( - PropertyElement propertyElement, - final DefaultPojomaticPolicy classPolicy, - final PojomaticPolicy propertyPolicy) { - for (PropertyRole role : PropertyFilter.getRoles(propertyPolicy, classPolicy)) { - properties.get(role).add(propertyElement); - } - } - private void verifyPropertiesNotEmpty(Class<?> pojoClass) { for (Collection<PropertyElement> propertyElements : properties.values()) { if (!propertyElements.isEmpty()) { @@ -205,4 +205,15 @@ } return properties; } + + private Map<PropertyRole, OverridableMethods> makeOverridableMethods() { + Map<PropertyRole, OverridableMethods> overrideableMethods = + new EnumMap<PropertyRole, OverridableMethods>(PropertyRole.class); + for (PropertyRole role : PropertyRole.values()) { + overrideableMethods.put(role, new OverridableMethods()); + } + return overrideableMethods; + + } + } Added: trunk/Pojomatic/src/main/java/org/pojomatic/internal/OverridableMethods.java =================================================================== --- trunk/Pojomatic/src/main/java/org/pojomatic/internal/OverridableMethods.java (rev 0) +++ trunk/Pojomatic/src/main/java/org/pojomatic/internal/OverridableMethods.java 2009-08-16 17:17:24 UTC (rev 129) @@ -0,0 +1,68 @@ +package org.pojomatic.internal; + +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.util.HashSet; +import java.util.Set; + +/** + * A mutable set of methods which can be overridden. All methods are assumed to take no arguments + * and either public, protected or package private. + */ +class OverridableMethods { + /** + * Check a method to see if it is not an override; if not, add it to the collection of methods + * @param method the method to check and maybe add. It is assumed the method is not private. + * @return {@code true} if the method is not an override + */ + boolean checkAndMaybeAddMethod(Method method) { + if (isPackagePrivate(method)) { + // This can only override another package private method + return packageMethods.add(new PackageMethod(method)); + } + else { + // If there is a public method already declared, then this is an override. Otherwise, + // we need to track it as a public override going forward, even if it is overriding a + // superclass method which was declared package private. + return publicOrProtectedMethods.add(method.getName()) + && !packageMethods.contains(new PackageMethod(method)); + } + } + + /** + * A bean to track the package and name of a package-private method + */ + private class PackageMethod { + PackageMethod(Method method) { + name = method.getName(); + pakage = method.getDeclaringClass().getPackage(); + } + + String name; + Package pakage; + @Override public int hashCode() { + return name.hashCode() * 31 + pakage.hashCode(); + } + + @Override public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj instanceof PackageMethod) { + PackageMethod other = (PackageMethod)obj; + return name.equals(other.name) && pakage.equals(other.pakage); + } + else { + return false; + } + } + } + + private Set<String> publicOrProtectedMethods = new HashSet<String>(); + private Set<PackageMethod> packageMethods = new HashSet<PackageMethod>(); + + private static boolean isPackagePrivate(Method method) { + return !(Modifier.isPublic(method.getModifiers()) + || Modifier.isProtected(method.getModifiers())); + } + +} Property changes on: trunk/Pojomatic/src/main/java/org/pojomatic/internal/OverridableMethods.java ___________________________________________________________________ Added: svn:mime-type + text/plain Modified: trunk/Pojomatic/src/test/java/org/pojomatic/internal/ClassPropertiesTest.java =================================================================== --- trunk/Pojomatic/src/test/java/org/pojomatic/internal/ClassPropertiesTest.java 2009-08-16 15:05:21 UTC (rev 128) +++ trunk/Pojomatic/src/test/java/org/pojomatic/internal/ClassPropertiesTest.java 2009-08-16 17:17:24 UTC (rev 129) @@ -125,15 +125,26 @@ assertEquals(Collections.EMPTY_SET, asSet(parentClassProperties.getHashCodeProperties())); assertEquals(Collections.EMPTY_SET, asSet(parentClassProperties.getToStringProperties())); - ClassProperties childClassProperties = ClassProperties.createInstance(ChildAutoPojo.class); + ClassProperties childClassProperties = ClassProperties.createInstance(ChildAutoFieldPojo.class); Set<PropertyElement> expectedChild = asSet( - TestUtils.field(ChildAutoPojo.class, "other")); + TestUtils.field(ChildAutoFieldPojo.class, "other")); assertEquals(expectedParent, asSet(childClassProperties.getEqualsProperties())); assertEquals(Collections.EMPTY_SET, asSet(childClassProperties.getHashCodeProperties())); assertEquals(expectedChild, asSet(childClassProperties.getToStringProperties())); } @Test + public void testAutoInheritanceWithOverride() throws Exception { + ClassProperties childClassProperties = ClassProperties.createInstance(ChildAutoMethodPojo.class); + Set<PropertyElement> expected = asSet( + TestUtils.method(ParentPojo.class, "getFoo"), + TestUtils.method(ChildAutoMethodPojo.class, "getBar")); + assertEquals(expected, asSet(childClassProperties.getEqualsProperties())); + assertEquals(expected, asSet(childClassProperties.getHashCodeProperties())); + assertEquals(expected, asSet(childClassProperties.getToStringProperties())); + } + + @Test public void testAutoInheritanceAnnotatedParent() throws Exception { Set<PropertyElement> expectedParent = asSet(TestUtils.method(ParentPojo.class, "getFoo")); ClassProperties parentClassProperties = ClassProperties.createInstance(ParentPojo.class); @@ -144,7 +155,6 @@ ClassProperties childClassProperties = ClassProperties.createInstance(ChildExtendsAnnotatedPojo.class); Set<PropertyElement> expectedChild = asSet( TestUtils.method(ParentPojo.class, "getFoo"), - TestUtils.method(ChildExtendsAnnotatedPojo.class, "getFoo"), TestUtils.method(ChildExtendsAnnotatedPojo.class, "getMyString")); assertEquals(expectedChild, asSet(childClassProperties.getEqualsProperties())); assertEquals(expectedChild, asSet(childClassProperties.getHashCodeProperties())); @@ -296,6 +306,12 @@ } @AutoProperty(autoDetect=AutoDetectPolicy.METHOD) + public static class ChildAutoMethodPojo extends ParentPojo { + @Override public int getFoo() { return 2; } + public int getBar() { return 2; } + } + + @AutoProperty(autoDetect=AutoDetectPolicy.METHOD) public static class ChildExtendsAnnotatedPojo extends ParentPojo { @Override public int getFoo() { return 0; } @@ -309,7 +325,7 @@ } @AutoProperty(autoDetect=AutoDetectPolicy.FIELD, policy=DefaultPojomaticPolicy.TO_STRING) - public static class ChildAutoPojo extends ParentAutoPojo { + public static class ChildAutoFieldPojo extends ParentAutoPojo { public String other; @Override public int getFoo() { return 2; } Added: trunk/Pojomatic/src/test/java/org/pojomatic/internal/OverridableMethodsTest.java =================================================================== --- trunk/Pojomatic/src/test/java/org/pojomatic/internal/OverridableMethodsTest.java (rev 0) +++ trunk/Pojomatic/src/test/java/org/pojomatic/internal/OverridableMethodsTest.java 2009-08-16 17:17:24 UTC (rev 129) @@ -0,0 +1,49 @@ +package org.pojomatic.internal; + +import static org.junit.Assert.*; + +import java.lang.reflect.Method; + +import org.junit.Test; +import org.pojomatic.internal.a.C1; +import org.pojomatic.internal.a.C3; +import org.pojomatic.internal.b.C2; +import org.pojomatic.internal.b.C4; + + +public class OverridableMethodsTest { + + @Test public void testPackagePrivate() throws Exception { + checkMethod("packagePrivate", true, true, false, false); + } + + @Test public void testPackagePrivateToProtected() throws Exception { + checkMethod("packagePrivateOverriddenProtected", true, true, false, false); + } + + @Test public void testPackagePrivateToPublic() throws Exception { + checkMethod("packagePrivateOverriddenPublic", true, true, false, false); + } + + @Test public void testProtected() throws Exception { + checkMethod("protectedMethod", true, false, false, false); + } + + @Test public void testPublic() throws Exception { + checkMethod("publicMethod", true, false, false, false); + } + + private void checkMethod( + String methodName, boolean c1Add, boolean c2Add, boolean c3Add, boolean c4Add) + throws Exception { + OverridableMethods overridableMethods = new OverridableMethods(); + assertEquals(c1Add, overridableMethods.checkAndMaybeAddMethod(method(C1.class, methodName))); + assertEquals(c2Add, overridableMethods.checkAndMaybeAddMethod(method(C2.class, methodName))); + assertEquals(c3Add, overridableMethods.checkAndMaybeAddMethod(method(C3.class, methodName))); + assertEquals(c4Add, overridableMethods.checkAndMaybeAddMethod(method(C4.class, methodName))); + } + + private static Method method(Class<?> clazz, String name) throws Exception { + return clazz.getDeclaredMethod(name); + } +} Property changes on: trunk/Pojomatic/src/test/java/org/pojomatic/internal/OverridableMethodsTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/Pojomatic/src/test/java/org/pojomatic/internal/a/C1.java =================================================================== --- trunk/Pojomatic/src/test/java/org/pojomatic/internal/a/C1.java (rev 0) +++ trunk/Pojomatic/src/test/java/org/pojomatic/internal/a/C1.java 2009-08-16 17:17:24 UTC (rev 129) @@ -0,0 +1,9 @@ +package org.pojomatic.internal.a; + +public class C1 { + int packagePrivate() { return 1; } + int packagePrivateOverriddenProtected() { return 1; } + int packagePrivateOverriddenPublic() { return 1; } + protected int protectedMethod() { return 1; } + public int publicMethod() { return 1; } +} Property changes on: trunk/Pojomatic/src/test/java/org/pojomatic/internal/a/C1.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/Pojomatic/src/test/java/org/pojomatic/internal/a/C3.java =================================================================== --- trunk/Pojomatic/src/test/java/org/pojomatic/internal/a/C3.java (rev 0) +++ trunk/Pojomatic/src/test/java/org/pojomatic/internal/a/C3.java 2009-08-16 17:17:24 UTC (rev 129) @@ -0,0 +1,12 @@ +package org.pojomatic.internal.a; + +import org.pojomatic.internal.b.C2; + +@SuppressWarnings("all") +public class C3 extends C2 { + int packagePrivate() { return 3; } + protected int packagePrivateOverriddenProtected() { return 3; } + public int packagePrivateOverriddenPublic() { return 3; } + protected int protectedMethod() { return 3; } + public int publicMethod() { return 3; } +} Property changes on: trunk/Pojomatic/src/test/java/org/pojomatic/internal/a/C3.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/Pojomatic/src/test/java/org/pojomatic/internal/b/C2.java =================================================================== --- trunk/Pojomatic/src/test/java/org/pojomatic/internal/b/C2.java (rev 0) +++ trunk/Pojomatic/src/test/java/org/pojomatic/internal/b/C2.java 2009-08-16 17:17:24 UTC (rev 129) @@ -0,0 +1,12 @@ +package org.pojomatic.internal.b; + +import org.pojomatic.internal.a.C1; + +@SuppressWarnings("all") +public class C2 extends C1 { + int packagePrivate() { return 1; } + protected int packagePrivateOverriddenProtected() { return 2; } + public int packagePrivateOverriddenPublic() { return 2; } + protected int protectedMethod() { return 2; } + public int publicMethod() { return 2; } +} Property changes on: trunk/Pojomatic/src/test/java/org/pojomatic/internal/b/C2.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/Pojomatic/src/test/java/org/pojomatic/internal/b/C4.java =================================================================== --- trunk/Pojomatic/src/test/java/org/pojomatic/internal/b/C4.java (rev 0) +++ trunk/Pojomatic/src/test/java/org/pojomatic/internal/b/C4.java 2009-08-16 17:17:24 UTC (rev 129) @@ -0,0 +1,12 @@ +package org.pojomatic.internal.b; + +import org.pojomatic.internal.a.C3; + +@SuppressWarnings("all") +public class C4 extends C3 { + int packagePrivate() { return 4; } + protected int packagePrivateOverriddenProtected() { return 4; } + public int packagePrivateOverriddenPublic() { return 4; } + protected int protectedMethod() { return 4; } + public int publicMethod() { return 4; } +} Property changes on: trunk/Pojomatic/src/test/java/org/pojomatic/internal/b/C4.java ___________________________________________________________________ Added: svn:mime-type + text/plain This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <iro...@us...> - 2009-08-16 15:05:29
|
Revision: 128 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=128&view=rev Author: iroberts Date: 2009-08-16 15:05:21 +0000 (Sun, 16 Aug 2009) Log Message: ----------- Put parent class properties ahead of child class properties. Modified Paths: -------------- trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java Modified: trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java =================================================================== --- trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java 2009-08-15 16:50:24 UTC (rev 127) +++ trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java 2009-08-16 15:05:21 UTC (rev 128) @@ -48,11 +48,15 @@ * with Pojomatic. */ private ClassProperties(Class<?> pojoClass) throws IllegalArgumentException { - for (Class<?> clazz = pojoClass; clazz != Object.class; clazz = clazz.getSuperclass()) { + walkHierarchy(pojoClass); + verifyPropertiesNotEmpty(pojoClass); + } + + private void walkHierarchy(Class<?> clazz) { + if (clazz != Object.class) { + walkHierarchy(clazz.getSuperclass()); extractClassProperties(clazz); } - - verifyPropertiesNotEmpty(pojoClass); } private void extractClassProperties(Class<?> clazz) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <iro...@us...> - 2009-08-15 16:50:30
|
Revision: 127 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=127&view=rev Author: iroberts Date: 2009-08-15 16:50:24 +0000 (Sat, 15 Aug 2009) Log Message: ----------- break up long method Modified Paths: -------------- trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java Modified: trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java =================================================================== --- trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java 2009-08-15 16:48:17 UTC (rev 126) +++ trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java 2009-08-15 16:50:24 UTC (rev 127) @@ -62,28 +62,12 @@ final AutoDetectPolicy autoDetectPolicy = (autoProperty != null) ? autoProperty.autoDetect() : null; - for (Field field : clazz.getDeclaredFields()) { - Property property = field.getAnnotation(Property.class); - if (isStatic(field)) { - if (property != null) { - throw new IllegalArgumentException( - "Static field " + clazz.getName() + "." + field.getName() - + " is annotated with @Property"); - } - else { - continue; - } - } - - final PojomaticPolicy propertyPolicy = (property != null) ? property.policy() : null; + extractFields(clazz, classPolicy, autoDetectPolicy); + extractMethods(clazz, classPolicy, autoDetectPolicy); + } - /* add all fields that are explicitly annotated or auto-detected */ - if (propertyPolicy != null || AutoDetectPolicy.FIELD == autoDetectPolicy) { - addPropertyToRoles( - new PropertyField(field, getPropertyName(property)), classPolicy, propertyPolicy); - } - } - + private void extractMethods(Class<?> clazz, final DefaultPojomaticPolicy classPolicy, + final AutoDetectPolicy autoDetectPolicy) { for (Method method : clazz.getDeclaredMethods()) { Property property = method.getAnnotation(Property.class); if (isStatic(method)) { @@ -119,6 +103,31 @@ } } + private void extractFields(Class<?> clazz, final DefaultPojomaticPolicy classPolicy, + final AutoDetectPolicy autoDetectPolicy) { + for (Field field : clazz.getDeclaredFields()) { + Property property = field.getAnnotation(Property.class); + if (isStatic(field)) { + if (property != null) { + throw new IllegalArgumentException( + "Static field " + clazz.getName() + "." + field.getName() + + " is annotated with @Property"); + } + else { + continue; + } + } + + final PojomaticPolicy propertyPolicy = (property != null) ? property.policy() : null; + + /* add all fields that are explicitly annotated or auto-detected */ + if (propertyPolicy != null || AutoDetectPolicy.FIELD == autoDetectPolicy) { + addPropertyToRoles( + new PropertyField(field, getPropertyName(property)), classPolicy, propertyPolicy); + } + } + } + private void addPropertyToRoles( PropertyElement propertyElement, final DefaultPojomaticPolicy classPolicy, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <iro...@us...> - 2009-08-15 16:48:30
|
Revision: 126 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=126&view=rev Author: iroberts Date: 2009-08-15 16:48:17 +0000 (Sat, 15 Aug 2009) Log Message: ----------- Don't allow static properties. Modified Paths: -------------- trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java trunk/Pojomatic/src/test/java/org/pojomatic/internal/ClassPropertiesTest.java Modified: trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java =================================================================== --- trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java 2009-08-15 16:04:29 UTC (rev 125) +++ trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java 2009-08-15 16:48:17 UTC (rev 126) @@ -64,11 +64,21 @@ for (Field field : clazz.getDeclaredFields()) { Property property = field.getAnnotation(Property.class); + if (isStatic(field)) { + if (property != null) { + throw new IllegalArgumentException( + "Static field " + clazz.getName() + "." + field.getName() + + " is annotated with @Property"); + } + else { + continue; + } + } + final PojomaticPolicy propertyPolicy = (property != null) ? property.policy() : null; /* add all fields that are explicitly annotated or auto-detected */ - if (propertyPolicy != null || - (AutoDetectPolicy.FIELD == autoDetectPolicy && !isStatic(field))) { + if (propertyPolicy != null || AutoDetectPolicy.FIELD == autoDetectPolicy) { addPropertyToRoles( new PropertyField(field, getPropertyName(property)), classPolicy, propertyPolicy); } @@ -76,6 +86,17 @@ for (Method method : clazz.getDeclaredMethods()) { Property property = method.getAnnotation(Property.class); + if (isStatic(method)) { + if (property != null) { + throw new IllegalArgumentException( + "Static method " + clazz.getName() + "." + method.getName() + + "() is annotated with @Property"); + } + else { + continue; + } + } + PojomaticPolicy propertyPolicy = null; if (property != null) { if (!methodSignatureIsAccessor(method)) { Modified: trunk/Pojomatic/src/test/java/org/pojomatic/internal/ClassPropertiesTest.java =================================================================== --- trunk/Pojomatic/src/test/java/org/pojomatic/internal/ClassPropertiesTest.java 2009-08-15 16:04:29 UTC (rev 125) +++ trunk/Pojomatic/src/test/java/org/pojomatic/internal/ClassPropertiesTest.java 2009-08-15 16:48:17 UTC (rev 126) @@ -169,7 +169,33 @@ assertEquals(expectedChild, asSet(childClassProperties.getHashCodeProperties())); assertEquals(expectedChild, asSet(childClassProperties.getToStringProperties())); } + + @Test + public void testAnnotatedStaticField() { + try { + ClassProperties.createInstance(StaticField.class); + fail("Exception expected"); + } + catch (IllegalArgumentException e) { + assertEquals( + "Static field " + StaticField.class.getName() + ".a is annotated with @Property", + e.getMessage()); + } + } + @Test + public void testAnnotatedStaticMethod() { + try { + ClassProperties.createInstance(StaticMethod.class); + fail("Exception expected"); + } + catch (IllegalArgumentException e) { + assertEquals( + "Static method " + StaticMethod.class.getName() + ".a() is annotated with @Property", + e.getMessage()); + } + } + public static class FieldPojo { @SuppressWarnings("unused") @Property @@ -297,7 +323,15 @@ public String getBar() { return ""; } } + + public static class StaticField { + @Property public static int a; + } + public static class StaticMethod { + @Property public static int a() { return 1; } + } + private static Set<PropertyElement> asSet(PropertyElement... elements) { HashSet<PropertyElement> result = new HashSet<PropertyElement>(); for (PropertyElement element : elements) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <iro...@us...> - 2009-08-15 16:04:38
|
Revision: 125 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=125&view=rev Author: iroberts Date: 2009-08-15 16:04:29 +0000 (Sat, 15 Aug 2009) Log Message: ----------- move factory method up top Modified Paths: -------------- trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java Modified: trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java =================================================================== --- trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java 2009-08-15 16:03:32 UTC (rev 124) +++ trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java 2009-08-15 16:04:29 UTC (rev 125) @@ -22,6 +22,20 @@ * {@link PojomatorImpl#doEquals(Object, Object)}, and {@link PojomatorImpl#doToString(Object)}. */ public class ClassProperties { + /** + * Creates a new instance. + * + * @param <T> the type of {@code pojoClass} + * @param pojoClass the class to inspect + * @return a new instance + * @throws IllegalArgumentException if {@code pojoClass} has no properties annotated for use + * with Pojomatic. + */ + public static <T> ClassProperties createInstance(Class<T> pojoClass) throws IllegalArgumentException { + return new ClassProperties(pojoClass); + } + + private static final Pattern ACCESSOR_PATTERN = Pattern.compile("(get|is)\\P{Ll}.*"); private final Map<PropertyRole, Collection<PropertyElement>> properties = makeProperties(); @@ -157,17 +171,4 @@ } return properties; } - - /** - * Creates a new instance. - * - * @param <T> the type of {@code pojoClass} - * @param pojoClass the class to inspect - * @return a new instance - * @throws IllegalArgumentException if {@code pojoClass} has no properties annotated for use - * with Pojomatic. - */ - public static <T> ClassProperties createInstance(Class<T> pojoClass) throws IllegalArgumentException { - return new ClassProperties(pojoClass); - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <iro...@us...> - 2009-08-15 16:03:47
|
Revision: 124 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=124&view=rev Author: iroberts Date: 2009-08-15 16:03:32 +0000 (Sat, 15 Aug 2009) Log Message: ----------- refactor long constructor code into shorter methods. Modified Paths: -------------- trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java Modified: trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java =================================================================== --- trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java 2009-08-14 23:02:37 UTC (rev 123) +++ trunk/Pojomatic/src/main/java/org/pojomatic/internal/ClassProperties.java 2009-08-15 16:03:32 UTC (rev 124) @@ -24,8 +24,7 @@ public class ClassProperties { private static final Pattern ACCESSOR_PATTERN = Pattern.compile("(get|is)\\P{Ll}.*"); - private final Map<PropertyRole, Collection<PropertyElement>> properties = - new EnumMap<PropertyRole, Collection<PropertyElement>>(PropertyRole.class); + private final Map<PropertyRole, Collection<PropertyElement>> properties = makeProperties(); /** * Creates an instance for the given {@code pojoClass}. @@ -35,71 +34,73 @@ * with Pojomatic. */ private ClassProperties(Class<?> pojoClass) throws IllegalArgumentException { - for (PropertyRole role : PropertyRole.values()) { - properties.put(role, new ArrayList<PropertyElement>()); + for (Class<?> clazz = pojoClass; clazz != Object.class; clazz = clazz.getSuperclass()) { + extractClassProperties(clazz); } - for (Class<?> clazz = pojoClass; clazz != Object.class; clazz = clazz.getSuperclass()) { - AutoProperty autoProperty = clazz.getAnnotation(AutoProperty.class); - DefaultPojomaticPolicy classPolicy = null; - if (autoProperty != null) { - classPolicy = autoProperty.policy(); - } + verifyPropertiesNotEmpty(pojoClass); + } - for (Field field : clazz.getDeclaredFields()) { - Property property = field.getAnnotation(Property.class); - PojomaticPolicy propertyPolicy = null; - if (property != null) { - propertyPolicy = property.policy(); - } + private void extractClassProperties(Class<?> clazz) { + AutoProperty autoProperty = clazz.getAnnotation(AutoProperty.class); + final DefaultPojomaticPolicy classPolicy = + (autoProperty != null) ? autoProperty.policy() : null; + final AutoDetectPolicy autoDetectPolicy = + (autoProperty != null) ? autoProperty.autoDetect() : null; - /* add all fields that are explicitly annotated or auto-detected */ - if (propertyPolicy != null || - (autoProperty != null - && AutoDetectPolicy.FIELD == autoProperty.autoDetect() - && !isStatic(field))) { - PropertyField propertyField = new PropertyField(field, getPropertyName(property)); - for (PropertyRole role : PropertyFilter.getRoles(propertyPolicy, classPolicy)) { - properties.get(role).add(propertyField); - } - } + for (Field field : clazz.getDeclaredFields()) { + Property property = field.getAnnotation(Property.class); + final PojomaticPolicy propertyPolicy = (property != null) ? property.policy() : null; + + /* add all fields that are explicitly annotated or auto-detected */ + if (propertyPolicy != null || + (AutoDetectPolicy.FIELD == autoDetectPolicy && !isStatic(field))) { + addPropertyToRoles( + new PropertyField(field, getPropertyName(property)), classPolicy, propertyPolicy); } + } - for (Method method : clazz.getDeclaredMethods()) { - Property property = method.getAnnotation(Property.class); - PojomaticPolicy propertyPolicy = null; - if (property != null) { - if (!methodSignatureIsAccessor(method)) { - throw new IllegalArgumentException( - "Method " + method + - " is annotated with @Property but either takes arguments or returns void"); - } - propertyPolicy = property.policy(); + for (Method method : clazz.getDeclaredMethods()) { + Property property = method.getAnnotation(Property.class); + PojomaticPolicy propertyPolicy = null; + if (property != null) { + if (!methodSignatureIsAccessor(method)) { + throw new IllegalArgumentException( + "Method " + method + + " is annotated with @Property but either takes arguments or returns void"); } - else if (!methodIsAccessor(method)) { - continue; - } + propertyPolicy = property.policy(); + } + else if (!methodIsAccessor(method)) { + continue; + } - /* add all methods that are explicitly annotated or auto-detected */ - if (propertyPolicy != null || - (autoProperty != null - && AutoDetectPolicy.METHOD == autoProperty.autoDetect() - && !isStatic(method))) { - PropertyAccessor propertyAccessor = - new PropertyAccessor(method, getPropertyName(property)); - for (PropertyRole role : PropertyFilter.getRoles(propertyPolicy, classPolicy)) { - properties.get(role).add(propertyAccessor); - } - } + /* add all methods that are explicitly annotated or auto-detected */ + if (propertyPolicy != null || + (AutoDetectPolicy.METHOD == autoDetectPolicy && !isStatic(method))) { + addPropertyToRoles( + new PropertyAccessor(method, getPropertyName(property)), classPolicy, propertyPolicy); } } + } + private void addPropertyToRoles( + PropertyElement propertyElement, + final DefaultPojomaticPolicy classPolicy, + final PojomaticPolicy propertyPolicy) { + for (PropertyRole role : PropertyFilter.getRoles(propertyPolicy, classPolicy)) { + properties.get(role).add(propertyElement); + } + } + + private void verifyPropertiesNotEmpty(Class<?> pojoClass) { for (Collection<PropertyElement> propertyElements : properties.values()) { if (!propertyElements.isEmpty()) { return; } } - throw new IllegalArgumentException("Class " + pojoClass.getName() + " has no Pojomatic properties"); + throw new IllegalArgumentException( + "Class " + pojoClass.getName() + " has no Pojomatic properties"); } private String getPropertyName(Property property) { @@ -148,6 +149,15 @@ return properties.get(PropertyRole.TO_STRING); } + private static Map<PropertyRole, Collection<PropertyElement>> makeProperties() { + Map<PropertyRole, Collection<PropertyElement>> properties = + new EnumMap<PropertyRole, Collection<PropertyElement>>(PropertyRole.class); + for (PropertyRole role : PropertyRole.values()) { + properties.put(role, new ArrayList<PropertyElement>()); + } + return properties; + } + /** * Creates a new instance. * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-08-14 23:02:52
|
Revision: 123 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=123&view=rev Author: chriswhansen Date: 2009-08-14 23:02:37 +0000 (Fri, 14 Aug 2009) Log Message: ----------- Pojomatic.diff() no longer requires a non-null first argument. Likewise, Pojomator.diff() no longer requires a non-null first argument. Created NoDifferences singleton class to represent no differences and removed similar logic from PropertyDifferences. Modified Paths: -------------- trunk/Pojomatic/src/main/java/org/pojomatic/Pojomatic.java trunk/Pojomatic/src/main/java/org/pojomatic/Pojomator.java trunk/Pojomatic/src/main/java/org/pojomatic/diff/DifferenceToNull.java trunk/Pojomatic/src/main/java/org/pojomatic/diff/PropertyDifferences.java trunk/Pojomatic/src/main/java/org/pojomatic/internal/PojomatorImpl.java trunk/Pojomatic/src/test/java/org/pojomatic/PojomaticTest.java trunk/Pojomatic/src/test/java/org/pojomatic/diff/PropertyDifferencesTest.java trunk/Pojomatic/src/test/java/org/pojomatic/internal/PojomatorImplTest.java Added Paths: ----------- trunk/Pojomatic/src/main/java/org/pojomatic/diff/AbstractNullDifference.java trunk/Pojomatic/src/main/java/org/pojomatic/diff/DifferenceFromNull.java trunk/Pojomatic/src/main/java/org/pojomatic/diff/NoDifferences.java trunk/Pojomatic/src/test/java/org/pojomatic/diff/DifferenceFromNullTest.java trunk/Pojomatic/src/test/java/org/pojomatic/diff/NoDifferencesTest.java Property Changed: ---------------- trunk/Pojomatic/ Property changes on: trunk/Pojomatic ___________________________________________________________________ Added: svn:ignore + target bin Modified: trunk/Pojomatic/src/main/java/org/pojomatic/Pojomatic.java =================================================================== --- trunk/Pojomatic/src/main/java/org/pojomatic/Pojomatic.java 2009-08-14 22:58:29 UTC (rev 122) +++ trunk/Pojomatic/src/main/java/org/pojomatic/Pojomatic.java 2009-08-14 23:02:37 UTC (rev 123) @@ -1,6 +1,8 @@ package org.pojomatic; +import org.pojomatic.diff.DifferenceFromNull; import org.pojomatic.diff.Differences; +import org.pojomatic.diff.NoDifferences; import org.pojomatic.internal.PojomatorImpl; import org.pojomatic.internal.SelfPopulatingMap; @@ -114,14 +116,24 @@ * * @param <T> the static type of the first object to compare * @param <S> the static type of the first object to compare - * @param pojo the instance to diff against - must not be {@code null} + * @param pojo the instance to diff against * @param other the instance to diff * @return the list of differences (possibly empty) between {@code instance} and {@code other} * among the properties examined by {@link #equals(Object, Object)} for type {@code T}. * @throws IllegalArgumentException if {@code pojo}'s class has no properties annotated for use * with Pojomatic */ - public static <T, S extends T> Differences diff(T pojo, S other) throws IllegalArgumentException { + public static <T, S extends T> Differences diff(T pojo, S other) + throws NullPointerException, IllegalArgumentException { + if (pojo == null) { + if (other != null) { + return new DifferenceFromNull(other); + } + else { //both null + return NoDifferences.getInstance(); + } + } + return pojomator(getClass(pojo)).doDiff(pojo, other); } Modified: trunk/Pojomatic/src/main/java/org/pojomatic/Pojomator.java =================================================================== --- trunk/Pojomatic/src/main/java/org/pojomatic/Pojomator.java 2009-08-14 22:58:29 UTC (rev 122) +++ trunk/Pojomatic/src/main/java/org/pojomatic/Pojomator.java 2009-08-14 23:02:37 UTC (rev 123) @@ -46,7 +46,7 @@ * {@link Differences#areEqual()} on the returned object will return true iff * {@code instance.equals(other)}. * - * @param instance the instance to diff against - must not be {@code null} + * @param instance the instance to diff against * @param other the instance to diff * @return the differences between {@code instance} and {@code other} * among the properties examined by {@link #doEquals(Object, Object)}. Added: trunk/Pojomatic/src/main/java/org/pojomatic/diff/AbstractNullDifference.java =================================================================== --- trunk/Pojomatic/src/main/java/org/pojomatic/diff/AbstractNullDifference.java (rev 0) +++ trunk/Pojomatic/src/main/java/org/pojomatic/diff/AbstractNullDifference.java 2009-08-14 23:02:37 UTC (rev 123) @@ -0,0 +1,46 @@ +package org.pojomatic.diff; + +import org.pojomatic.Pojomatic; +import org.pojomatic.annotations.AutoProperty; +import org.pojomatic.annotations.DefaultPojomaticPolicy; +import org.pojomatic.annotations.PojomaticPolicy; +import org.pojomatic.annotations.Property; + +/** + * A {@link Differences} whose {@link Differences#toString()} is generated exactly once. + */ +@AutoProperty(policy=DefaultPojomaticPolicy.NONE) +abstract class AbstractNullDifference implements Differences { + @Property(policy=PojomaticPolicy.ALL) + protected final Object instance; + + /** + * @param instance the non-null object being compared to {@code null}. + * @throws NullPointerException if {@code instance} is {@code null}. + */ + public AbstractNullDifference(Object instance) { + if (instance == null) { + throw new NullPointerException("Instance cannot be null"); + } + + this.instance = instance; + } + + public final boolean areEqual() { + return false; + } + + @Override + public abstract String toString(); + + @Override + public int hashCode() { + return Pojomatic.hashCode(this); + } + + @Override + public boolean equals(Object o) { + return Pojomatic.equals(this, o); + } + +} Added: trunk/Pojomatic/src/main/java/org/pojomatic/diff/DifferenceFromNull.java =================================================================== --- trunk/Pojomatic/src/main/java/org/pojomatic/diff/DifferenceFromNull.java (rev 0) +++ trunk/Pojomatic/src/main/java/org/pojomatic/diff/DifferenceFromNull.java 2009-08-14 23:02:37 UTC (rev 123) @@ -0,0 +1,18 @@ +package org.pojomatic.diff; + +/** + * The result of comparing {@code null} to a non-null object. + * @see DifferenceToNull + */ +public final class DifferenceFromNull extends AbstractNullDifference { + + public DifferenceFromNull(Object other) { + super(other); + } + + @Override + public String toString() { + return "null is different than the object {" + instance + "}"; + } + +} Modified: trunk/Pojomatic/src/main/java/org/pojomatic/diff/DifferenceToNull.java =================================================================== --- trunk/Pojomatic/src/main/java/org/pojomatic/diff/DifferenceToNull.java 2009-08-14 22:58:29 UTC (rev 122) +++ trunk/Pojomatic/src/main/java/org/pojomatic/diff/DifferenceToNull.java 2009-08-14 23:02:37 UTC (rev 123) @@ -1,21 +1,17 @@ package org.pojomatic.diff; -public class DifferenceToNull implements Differences { - private final Object instance; +/** + * The result of comparing a non-null object to {@code null}. + * @see DifferenceFromNull + */ +public final class DifferenceToNull extends AbstractNullDifference { public DifferenceToNull(Object instance) { - if (instance == null) { - throw new NullPointerException(); - } - this.instance = instance; + super(instance); } @Override public String toString() { - return "the object {" + instance + "} is different than null" ; + return "the object {" + instance + "} is different than null"; } - - public boolean areEqual() { - return false; - } } Added: trunk/Pojomatic/src/main/java/org/pojomatic/diff/NoDifferences.java =================================================================== --- trunk/Pojomatic/src/main/java/org/pojomatic/diff/NoDifferences.java (rev 0) +++ trunk/Pojomatic/src/main/java/org/pojomatic/diff/NoDifferences.java 2009-08-14 23:02:37 UTC (rev 123) @@ -0,0 +1,22 @@ +package org.pojomatic.diff; + +public final class NoDifferences implements Differences { + private static final NoDifferences INSTANCE = new NoDifferences(); + + private NoDifferences() { + } + + public boolean areEqual() { + return true; + } + + @Override + public String toString() { + return "no differences"; + } + + public static NoDifferences getInstance() { + return INSTANCE; + } + +} Modified: trunk/Pojomatic/src/main/java/org/pojomatic/diff/PropertyDifferences.java =================================================================== --- trunk/Pojomatic/src/main/java/org/pojomatic/diff/PropertyDifferences.java 2009-08-14 22:58:29 UTC (rev 122) +++ trunk/Pojomatic/src/main/java/org/pojomatic/diff/PropertyDifferences.java 2009-08-14 23:02:37 UTC (rev 123) @@ -10,10 +10,18 @@ @Property private final List<Difference> differences; + /** + * @param differences cannot be {@code null} or empty + * @throws NullPointerException if {@code differences} is {@code null} + * @throws IllegalArgumentException if {@code differences.isEmpty()} is {@code true} + */ public PropertyDifferences(List<Difference> differences) { if (differences == null) { throw new NullPointerException("list of differences is null"); } + if (differences.isEmpty()) { + throw new IllegalArgumentException("list of differences is empty"); + } this.differences = Collections.unmodifiableList(differences); } @@ -21,15 +29,22 @@ return differences; } + public boolean areEqual() { + return false; + } + @Override public String toString() { - return differences.isEmpty() ? "no differences" : differences.toString(); + return differences.toString(); } - @Override public boolean equals(Object other) { return Pojomatic.equals(this, other); } - @Override public int hashCode() { return Pojomatic.hashCode(this); } + @Override + public boolean equals(Object other) { + return Pojomatic.equals(this, other); + } - public boolean areEqual() { - return differences.isEmpty(); + @Override + public int hashCode() { + return Pojomatic.hashCode(this); } } Modified: trunk/Pojomatic/src/main/java/org/pojomatic/internal/PojomatorImpl.java =================================================================== --- trunk/Pojomatic/src/main/java/org/pojomatic/internal/PojomatorImpl.java 2009-08-14 22:58:29 UTC (rev 122) +++ trunk/Pojomatic/src/main/java/org/pojomatic/internal/PojomatorImpl.java 2009-08-14 23:02:37 UTC (rev 123) @@ -3,7 +3,6 @@ import java.lang.reflect.AnnotatedElement; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.List; import org.pojomatic.Pojomator; @@ -13,8 +12,10 @@ import org.pojomatic.annotations.Property; import org.pojomatic.annotations.PropertyFormat; import org.pojomatic.diff.Difference; +import org.pojomatic.diff.DifferenceFromNull; import org.pojomatic.diff.DifferenceToNull; import org.pojomatic.diff.Differences; +import org.pojomatic.diff.NoDifferences; import org.pojomatic.diff.PropertyDifferences; import org.pojomatic.formatter.DefaultPojoFormatter; import org.pojomatic.formatter.DefaultPropertyFormatter; @@ -257,15 +258,16 @@ } public Differences doDiff(T instance, T other) { - if (instance == null) { - throw new NullPointerException("instance is null"); + if (instance == other) { + return NoDifferences.getInstance(); } - if (other == null) { + else if (instance == null) { + return new DifferenceFromNull(other); + } + else if (other == null) { return new DifferenceToNull(instance); } - if (instance == other) { - return new PropertyDifferences(Collections.<Difference>emptyList()); - } + checkClass(instance, "instance"); checkClass(other, "other"); List<Difference> differences = new ArrayList<Difference>(); @@ -276,6 +278,10 @@ differences.add(new Difference(prop.getName(), instanceValue, otherValue)); } } + + if (differences.isEmpty()) { + return NoDifferences.getInstance(); + } return new PropertyDifferences(differences); } Modified: trunk/Pojomatic/src/test/java/org/pojomatic/PojomaticTest.java =================================================================== --- trunk/Pojomatic/src/test/java/org/pojomatic/PojomaticTest.java 2009-08-14 22:58:29 UTC (rev 122) +++ trunk/Pojomatic/src/test/java/org/pojomatic/PojomaticTest.java 2009-08-14 23:02:37 UTC (rev 123) @@ -2,12 +2,10 @@ import static org.junit.Assert.*; -import java.util.Collections; - import org.junit.Test; import org.pojomatic.annotations.Property; -import org.pojomatic.diff.Difference; -import org.pojomatic.diff.PropertyDifferences; +import org.pojomatic.diff.DifferenceFromNull; +import org.pojomatic.diff.NoDifferences; import org.pojomatic.internal.PojomatorImpl; public class PojomaticTest { @@ -32,11 +30,25 @@ @Test public void testDiff() { - assertEquals( - new PropertyDifferences(Collections.<Difference>emptyList()), Pojomatic.diff(BEAN, BEAN)); + assertEquals(NoDifferences.getInstance(), Pojomatic.diff(BEAN, BEAN)); } @Test + public void testDiffBothNull() { + assertEquals(NoDifferences.getInstance(), Pojomatic.diff(null, null)); + } + + @Test + public void testDiffNullFirst() { + assertEquals(new DifferenceFromNull(BEAN), Pojomatic.diff(null, BEAN)); + } + + @Test + public void testDiffNullSecond() { + assertEquals(BEAN_POJOMATOR.doDiff(BEAN, null), Pojomatic.diff(BEAN, null)); + } + + @Test public void testHashCode() { assertEquals(BEAN_POJOMATOR.doHashCode(BEAN), Pojomatic.hashCode(BEAN)); } Added: trunk/Pojomatic/src/test/java/org/pojomatic/diff/DifferenceFromNullTest.java =================================================================== --- trunk/Pojomatic/src/test/java/org/pojomatic/diff/DifferenceFromNullTest.java (rev 0) +++ trunk/Pojomatic/src/test/java/org/pojomatic/diff/DifferenceFromNullTest.java 2009-08-14 23:02:37 UTC (rev 123) @@ -0,0 +1,23 @@ +package org.pojomatic.diff; + +import static org.junit.Assert.*; + +import org.junit.Test; + +public class DifferenceFromNullTest { + + @Test(expected=NullPointerException.class) + public void testConstructorNullPointerException() { + new DifferenceFromNull(null); + } + + @Test + public void testToString() { + assertEquals("null is different than the object {3}", new DifferenceFromNull(3).toString()); + } + + @Test + public void testAreEqual() { + assertFalse(new DifferenceFromNull(3).areEqual()); + } +} Added: trunk/Pojomatic/src/test/java/org/pojomatic/diff/NoDifferencesTest.java =================================================================== --- trunk/Pojomatic/src/test/java/org/pojomatic/diff/NoDifferencesTest.java (rev 0) +++ trunk/Pojomatic/src/test/java/org/pojomatic/diff/NoDifferencesTest.java 2009-08-14 23:02:37 UTC (rev 123) @@ -0,0 +1,19 @@ +package org.pojomatic.diff; + +import static org.junit.Assert.*; + +import org.junit.Test; + +public class NoDifferencesTest { + + @Test + public void testAreEqual() { + assertTrue(NoDifferences.getInstance().areEqual()); + } + + @Test + public void testToString() { + assertEquals("no differences", NoDifferences.getInstance().toString()); + } + +} Modified: trunk/Pojomatic/src/test/java/org/pojomatic/diff/PropertyDifferencesTest.java =================================================================== --- trunk/Pojomatic/src/test/java/org/pojomatic/diff/PropertyDifferencesTest.java 2009-08-14 22:58:29 UTC (rev 122) +++ trunk/Pojomatic/src/test/java/org/pojomatic/diff/PropertyDifferencesTest.java 2009-08-14 23:02:37 UTC (rev 123) @@ -13,10 +13,10 @@ public void testConstructorNullPointerException() { new PropertyDifferences(null); } - @Test - public void testEmptyToString() { - assertEquals( - "no differences", new PropertyDifferences(Collections.<Difference>emptyList()).toString()); + + @Test(expected=IllegalArgumentException.class) + public void testEmptyDifferences() { + new PropertyDifferences(Collections.<Difference>emptyList()); } @Test @@ -39,7 +39,6 @@ @Test public void testAreEqual() { - assertTrue(new PropertyDifferences(Collections.<Difference>emptyList()).areEqual()); assertFalse(new PropertyDifferences(Arrays.asList(new Difference("foo", 3, 4))).areEqual()); } } Modified: trunk/Pojomatic/src/test/java/org/pojomatic/internal/PojomatorImplTest.java =================================================================== --- trunk/Pojomatic/src/test/java/org/pojomatic/internal/PojomatorImplTest.java 2009-08-14 22:58:29 UTC (rev 122) +++ trunk/Pojomatic/src/test/java/org/pojomatic/internal/PojomatorImplTest.java 2009-08-14 23:02:37 UTC (rev 123) @@ -15,6 +15,7 @@ import org.pojomatic.annotations.Property; import org.pojomatic.annotations.PropertyFormat; import org.pojomatic.diff.Difference; +import org.pojomatic.diff.DifferenceFromNull; import org.pojomatic.diff.DifferenceToNull; import org.pojomatic.diff.Differences; import org.pojomatic.diff.PropertyDifferences; @@ -220,10 +221,22 @@ makePojomatorImpl(FormattedObject.class).doToString(new FormattedObject("x"))); } - @Test(expected=NullPointerException.class) public void testDiffNullInstance() { - OBJECT_PAIR_PROPERTY_POJOMATOR.doDiff(null, new ObjectPairProperty("this", "that")); + @Test public void testDiffNullInstance() { + ObjectPairProperty other = new ObjectPairProperty("this", "that"); + Differences actual = OBJECT_PAIR_PROPERTY_POJOMATOR.doDiff(null, other); + assertTrue(actual instanceof DifferenceFromNull); } + @Test public void testDiffNullOther() { + ObjectPairProperty instance = new ObjectPairProperty("this", "that"); + Differences actual = OBJECT_PAIR_PROPERTY_POJOMATOR.doDiff(instance, null); + assertTrue(actual instanceof DifferenceToNull); + } + + @Test public void testDiffNulls() { + assertTrue(OBJECT_PAIR_PROPERTY_POJOMATOR.doDiff(null, null).areEqual()); + } + @Test public void testDiffSameObject() { ObjectPairProperty objectPairProperty = new ObjectPairProperty("this", "that"); assertTrue( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-08-14 22:58:47
|
Revision: 122 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=122&view=rev Author: chriswhansen Date: 2009-08-14 22:58:29 +0000 (Fri, 14 Aug 2009) Log Message: ----------- Clear up intent to throw an exception Modified Paths: -------------- trunk/Pojomatic/src/test/java/org/pojomatic/internal/SelfPopulatingMapTest.java Modified: trunk/Pojomatic/src/test/java/org/pojomatic/internal/SelfPopulatingMapTest.java =================================================================== --- trunk/Pojomatic/src/test/java/org/pojomatic/internal/SelfPopulatingMapTest.java 2009-08-07 02:43:26 UTC (rev 121) +++ trunk/Pojomatic/src/test/java/org/pojomatic/internal/SelfPopulatingMapTest.java 2009-08-14 22:58:29 UTC (rev 122) @@ -57,7 +57,8 @@ return new String(key); } else { - throw new RuntimeException("failing on first attempt"); + //first time through, throw an exception + throw new RuntimeException("This is expected: failing on first attempt"); } } }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-08-07 02:43:34
|
Revision: 121 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=121&view=rev Author: chriswhansen Date: 2009-08-07 02:43:26 +0000 (Fri, 07 Aug 2009) Log Message: ----------- Added a test for properties on a private class. Modified Paths: -------------- trunk/Pojomatic/src/test/java/org/pojomatic/internal/PojomatorImplTest.java Modified: trunk/Pojomatic/src/test/java/org/pojomatic/internal/PojomatorImplTest.java =================================================================== --- trunk/Pojomatic/src/test/java/org/pojomatic/internal/PojomatorImplTest.java 2009-08-05 05:30:17 UTC (rev 120) +++ trunk/Pojomatic/src/test/java/org/pojomatic/internal/PojomatorImplTest.java 2009-08-07 02:43:26 UTC (rev 121) @@ -10,6 +10,7 @@ import org.junit.Test; import org.pojomatic.Pojomator; +import org.pojomatic.annotations.AutoProperty; import org.pojomatic.annotations.PojoFormat; import org.pojomatic.annotations.Property; import org.pojomatic.annotations.PropertyFormat; @@ -293,6 +294,11 @@ makePojomatorImpl(String.class); } + @Test public void testPrivateClass() { + Pojomator<PrivateClass> pojomator = makePojomatorImpl(PrivateClass.class); + assertTrue(pojomator.doToString(new PrivateClass()).contains("number")); + } + @PojoFormat(SimplePojoFormatter.class) public static class FormattedObject { public FormattedObject(Object s) { @@ -374,6 +380,12 @@ private boolean getBCalled; } + @AutoProperty + private static class PrivateClass { + @SuppressWarnings("unused") + private int number; + } + private static <T> Pojomator<T> makePojomatorImpl(Class<T> clazz) { return new PojomatorImpl<T>(clazz); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-08-05 05:30:23
|
Revision: 120 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=120&view=rev Author: chriswhansen Date: 2009-08-05 05:30:17 +0000 (Wed, 05 Aug 2009) Log Message: ----------- Fix unused warnings which show up in Eclipse 3.5 Modified Paths: -------------- trunk/Pojomatic/src/test/java/org/pojomatic/internal/ClassPropertiesTest.java trunk/Pojomatic/src/test/java/org/pojomatic/internal/PojomatorImplTest.java Modified: trunk/Pojomatic/src/test/java/org/pojomatic/internal/ClassPropertiesTest.java =================================================================== --- trunk/Pojomatic/src/test/java/org/pojomatic/internal/ClassPropertiesTest.java 2009-08-05 05:13:23 UTC (rev 119) +++ trunk/Pojomatic/src/test/java/org/pojomatic/internal/ClassPropertiesTest.java 2009-08-05 05:30:17 UTC (rev 120) @@ -262,7 +262,7 @@ public abstract int getFoo(); } - private static class ChildPojo extends ParentPojo { + public static class ChildPojo extends ParentPojo { @Property public String other; @@ -270,7 +270,7 @@ } @AutoProperty(autoDetect=AutoDetectPolicy.METHOD) - private static class ChildExtendsAnnotatedPojo extends ParentPojo { + public static class ChildExtendsAnnotatedPojo extends ParentPojo { @Override public int getFoo() { return 0; } @@ -283,13 +283,13 @@ } @AutoProperty(autoDetect=AutoDetectPolicy.FIELD, policy=DefaultPojomaticPolicy.TO_STRING) - private static class ChildAutoPojo extends ParentAutoPojo { + public static class ChildAutoPojo extends ParentAutoPojo { public String other; @Override public int getFoo() { return 2; } } - private static class ChildExtendsAutoPojo extends ParentAutoPojo { + public static class ChildExtendsAutoPojo extends ParentAutoPojo { @Property public String other; Modified: trunk/Pojomatic/src/test/java/org/pojomatic/internal/PojomatorImplTest.java =================================================================== --- trunk/Pojomatic/src/test/java/org/pojomatic/internal/PojomatorImplTest.java 2009-08-05 05:13:23 UTC (rev 119) +++ trunk/Pojomatic/src/test/java/org/pojomatic/internal/PojomatorImplTest.java 2009-08-05 05:30:17 UTC (rev 120) @@ -294,7 +294,7 @@ } @PojoFormat(SimplePojoFormatter.class) - private static class FormattedObject { + public static class FormattedObject { public FormattedObject(Object s) { this.s = s; } @@ -318,14 +318,14 @@ } } - private static class ObjectProperty { + public static class ObjectProperty { public ObjectProperty(Object s) { this.s = s; } @Property public Object s; } - private static class ObjectPairProperty { + public static class ObjectPairProperty { public ObjectPairProperty(Object s, Object t) { this.s = s; this.t = t; @@ -334,14 +334,14 @@ @Property public Object t; } - private static class IntProperty { + public static class IntProperty { public IntProperty(int i) { this.i = i; } @Property int i; } - private static class StringArrayProperty { + public static class StringArrayProperty { public StringArrayProperty(String... strings) { this.strings = strings; } @@ -349,7 +349,7 @@ @Property String[] strings; } - private static class ExceptionThrowingProperty { + public static class ExceptionThrowingProperty { @Property public int bomb() { throw new RuntimeException(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-08-05 05:13:37
|
Revision: 119 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=119&view=rev Author: chriswhansen Date: 2009-08-05 05:13:23 +0000 (Wed, 05 Aug 2009) Log Message: ----------- Upgraded to Eclipse IAM Added a basic performance test for profiling Pojomatic.equals() Modified Paths: -------------- branches/performance-RC2/Pojomatic/.classpath branches/performance-RC2/Pojomatic/.project Added Paths: ----------- branches/performance-RC2/Pojomatic/src/performance/ branches/performance-RC2/Pojomatic/src/performance/java/ branches/performance-RC2/Pojomatic/src/performance/java/org/ branches/performance-RC2/Pojomatic/src/performance/java/org/pojomatic/ branches/performance-RC2/Pojomatic/src/performance/java/org/pojomatic/performance/ branches/performance-RC2/Pojomatic/src/performance/java/org/pojomatic/performance/PerformanceTest.java Modified: branches/performance-RC2/Pojomatic/.classpath =================================================================== --- branches/performance-RC2/Pojomatic/.classpath 2009-07-30 03:38:04 UTC (rev 118) +++ branches/performance-RC2/Pojomatic/.classpath 2009-08-05 05:13:23 UTC (rev 119) @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry including="**/*.java" kind="src" path="src/main/java"/> - <classpathentry including="**/*.java" kind="src" path="src/test/java"/> - <classpathentry kind="con" path="org.devzuz.q.maven.jdt.core.mavenClasspathContainer"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="output" path="bin"/> + <classpathentry including="**/*.java" kind="src" path="src/main/java"/> + <classpathentry including="**/*.java" kind="src" path="src/test/java"/> + <classpathentry including="**/*.java" kind="src" path="src/performance/java"/> + <classpathentry kind="con" path="org.eclipse.iam.jdt.core.mavenClasspathContainer"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.launching.macosx.MacOSXType/JVM 1.5"/> + <classpathentry kind="output" path="bin"/> </classpath> Modified: branches/performance-RC2/Pojomatic/.project =================================================================== --- branches/performance-RC2/Pojomatic/.project 2009-07-30 03:38:04 UTC (rev 118) +++ branches/performance-RC2/Pojomatic/.project 2009-08-05 05:13:23 UTC (rev 119) @@ -15,9 +15,15 @@ <arguments> </arguments> </buildCommand> + <buildCommand> + <name>org.eclipse.iam.jdt.core.mavenIncrementalBuilder</name> + <arguments> + </arguments> + </buildCommand> </buildSpec> <natures> <nature>org.devzuz.q.maven.jdt.core.mavenNature</nature> + <nature>org.eclipse.iam.jdt.core.mavenNature</nature> <nature>org.eclipse.jdt.core.javanature</nature> </natures> </projectDescription> Added: branches/performance-RC2/Pojomatic/src/performance/java/org/pojomatic/performance/PerformanceTest.java =================================================================== --- branches/performance-RC2/Pojomatic/src/performance/java/org/pojomatic/performance/PerformanceTest.java (rev 0) +++ branches/performance-RC2/Pojomatic/src/performance/java/org/pojomatic/performance/PerformanceTest.java 2009-08-05 05:13:23 UTC (rev 119) @@ -0,0 +1,47 @@ +package org.pojomatic.performance; + +import static org.junit.Assert.*; + +import org.pojomatic.Pojomatic; + +import examples.Common; + +public class PerformanceTest { + + public static void main(String[] args) { + long beginTime = System.currentTimeMillis(); + int iterations = 10000000; + testEquals(iterations); + System.out.println(""); + + long endTime = System.currentTimeMillis(); + System.out.println("Done in " + (endTime - beginTime) / 1000 + " seconds"); + } + + private static void testEquals(int iterations) { + for (int i=0; i < iterations; ++i) { + Common a1 = new Common(); + a1.setAnInt(i); + a1.setMyString(String.valueOf(i)); + Common a2 = new Common(); + a2.setAnInt(i); + a2.setMyString(String.valueOf(i)); + + assertTrue(Pojomatic.equals(a1, a2)); + assertTrue(Pojomatic.equals(a2, a1)); + + Common b = new Common(); + assertFalse(Pojomatic.equals(a1, b)); + assertFalse(Pojomatic.equals(a2, b)); + + assertFalse(Pojomatic.equals(b, a1)); + assertFalse(Pojomatic.equals(b, a2)); + + if (i % 100000 == 0) { + System.out.print('.'); + System.out.flush(); + } + } + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-07-30 03:38:12
|
Revision: 118 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=118&view=rev Author: chriswhansen Date: 2009-07-30 03:38:04 +0000 (Thu, 30 Jul 2009) Log Message: ----------- Creating branch to try out some performance tweeks. Added Paths: ----------- branches/performance-RC2/ branches/performance-RC2/Pojomatic/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <iro...@us...> - 2009-04-08 03:27:11
|
Revision: 117 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=117&view=rev Author: iroberts Date: 2009-04-08 03:27:10 +0000 (Wed, 08 Apr 2009) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/Pojomatic/pom.xml Modified: trunk/Pojomatic/pom.xml =================================================================== --- trunk/Pojomatic/pom.xml 2009-04-08 03:27:02 UTC (rev 116) +++ trunk/Pojomatic/pom.xml 2009-04-08 03:27:10 UTC (rev 117) @@ -3,7 +3,7 @@ <groupId>org.pojomatic</groupId> <artifactId>pojomatic</artifactId> <packaging>jar</packaging> - <version>1.0-RC2</version> + <version>trunk-SNAPSHOT</version> <name>Pojomatic</name> <description> Automatically provides configurable implementations of the @@ -12,9 +12,9 @@ <url>http://www.pojomatic.org</url> <inceptionYear>2008</inceptionYear> <scm> - <connection>scm:svn:https://pojomatic.svn.sourceforge.net/svnroot/pojomatic/tags/pojomatic-1.0-RC2</connection> - <developerConnection>scm:svn:https://pojomatic.svn.sourceforge.net/svnroot/pojomatic/tags/pojomatic-1.0-RC2</developerConnection> - <url>https://pojomatic.svn.sourceforge.net/svnroot/pojomatic/tags/pojomatic-1.0-RC2</url> + <connection>scm:svn:https://pojomatic.svn.sourceforge.net/svnroot/pojomatic/trunk/Pojomatic</connection> + <developerConnection>scm:svn:https://pojomatic.svn.sourceforge.net/svnroot/pojomatic/trunk/Pojomatic</developerConnection> + <url>https://pojomatic.svn.sourceforge.net/svnroot/pojomatic/trunk/Pojomatic</url> </scm> <developers> <developer> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <iro...@us...> - 2009-04-08 03:27:03
|
Revision: 116 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=116&view=rev Author: iroberts Date: 2009-04-08 03:27:02 +0000 (Wed, 08 Apr 2009) Log Message: ----------- [maven-scm] copy for tag pojomatic-1.0-RC2 Added Paths: ----------- tags/pojomatic-1.0-RC2/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <iro...@us...> - 2009-04-08 03:26:43
|
Revision: 115 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=115&view=rev Author: iroberts Date: 2009-04-08 03:26:42 +0000 (Wed, 08 Apr 2009) Log Message: ----------- [maven-release-plugin] prepare release pojomatic-1.0-RC2 Modified Paths: -------------- trunk/Pojomatic/pom.xml Modified: trunk/Pojomatic/pom.xml =================================================================== --- trunk/Pojomatic/pom.xml 2009-04-08 03:25:21 UTC (rev 114) +++ trunk/Pojomatic/pom.xml 2009-04-08 03:26:42 UTC (rev 115) @@ -3,7 +3,7 @@ <groupId>org.pojomatic</groupId> <artifactId>pojomatic</artifactId> <packaging>jar</packaging> - <version>trunk-SNAPSHOT</version> + <version>1.0-RC2</version> <name>Pojomatic</name> <description> Automatically provides configurable implementations of the @@ -12,9 +12,9 @@ <url>http://www.pojomatic.org</url> <inceptionYear>2008</inceptionYear> <scm> - <connection>scm:svn:https://pojomatic.svn.sourceforge.net/svnroot/pojomatic/trunk/Pojomatic</connection> - <developerConnection>scm:svn:https://pojomatic.svn.sourceforge.net/svnroot/pojomatic/trunk/Pojomatic</developerConnection> - <url>https://pojomatic.svn.sourceforge.net/svnroot/pojomatic/trunk/Pojomatic</url> + <connection>scm:svn:https://pojomatic.svn.sourceforge.net/svnroot/pojomatic/tags/pojomatic-1.0-RC2</connection> + <developerConnection>scm:svn:https://pojomatic.svn.sourceforge.net/svnroot/pojomatic/tags/pojomatic-1.0-RC2</developerConnection> + <url>https://pojomatic.svn.sourceforge.net/svnroot/pojomatic/tags/pojomatic-1.0-RC2</url> </scm> <developers> <developer> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |