From 6b0554b658d656aa2fb7d3696dd2f75ca25304d3 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 14 May 2014 01:07:50 +0200 Subject: Bump semver to 9ec2e5329780214d317b026f7c0b086972a94a5c - Using Dumper.dumpFullStats(..) --- make/lib/semantic-versioning/VERSION | 6 +- make/lib/semantic-versioning/semver-src.zip | Bin 41030 -> 41840 bytes make/lib/semantic-versioning/semver.jar | Bin 295478 -> 297781 bytes .../jogamp/junit/util/VersionSemanticsUtil.java | 99 ++------------------- 4 files changed, 8 insertions(+), 97 deletions(-) diff --git a/make/lib/semantic-versioning/VERSION b/make/lib/semantic-versioning/VERSION index df65470..baf61e3 100644 --- a/make/lib/semantic-versioning/VERSION +++ b/make/lib/semantic-versioning/VERSION @@ -3,11 +3,11 @@ https://github.com/sgothel/semantic-versioning 0.9.25-SNAPSHOT -commit 174953022b62681653db1f57b087581e29313f5b +commit 9ec2e5329780214d317b026f7c0b086972a94a5c Author: Sven Gothel -Date: Wed May 14 00:18:52 2014 +0200 +Date: Wed May 14 01:04:14 2014 +0200 - Dumper: Add dump method for sorted List (refactored) allowing dumping separate diff-types + Dump: Add dumpFullStats(..) producing diff stat per-class w/ diff-type-count and dump all diffs separated by diff-type branch jogamp diff --git a/make/lib/semantic-versioning/semver-src.zip b/make/lib/semantic-versioning/semver-src.zip index 68cb09b..a1a6fe2 100644 Binary files a/make/lib/semantic-versioning/semver-src.zip and b/make/lib/semantic-versioning/semver-src.zip differ diff --git a/make/lib/semantic-versioning/semver.jar b/make/lib/semantic-versioning/semver.jar index eab1cfe..1e82a32 100644 Binary files a/make/lib/semantic-versioning/semver.jar and b/make/lib/semantic-versioning/semver.jar differ diff --git a/src/junit/com/jogamp/junit/util/VersionSemanticsUtil.java b/src/junit/com/jogamp/junit/util/VersionSemanticsUtil.java index 786164e..953c795 100644 --- a/src/junit/com/jogamp/junit/util/VersionSemanticsUtil.java +++ b/src/junit/com/jogamp/junit/util/VersionSemanticsUtil.java @@ -31,20 +31,13 @@ import java.io.File; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; import java.util.Set; import org.junit.Assert; import org.osjava.jardiff.DiffCriteria; import org.semver.Comparer; import org.semver.Delta; -import org.semver.Delta.Difference; import org.semver.Dumper; import com.jogamp.common.util.IOUtil; @@ -108,82 +101,13 @@ public class VersionSemanticsUtil { resS = "Current version "+curVersionNumber+" is not "+expectedCompatibilityType+" to previous version "+preVersionNumber+", but "+detectedCompatibilityType; } System.err.println(resS); - System.err.println("--------------------------------------------------------------------------------------------------------------"); + System.err.printf("%n%n"); - final Set diffs = delta.getDifferences(); + Dumper.dumpFullStats(delta, 4, System.err); - final List diffsAdd = new ArrayList(); - final List diffsChange = new ArrayList(); - final List diffsDeprecate = new ArrayList(); - final List diffsRemove = new ArrayList(); - final Map className2DiffCount = new HashMap(); - - int maxClassNameLen = 0; - - for(final Iterator iter = diffs.iterator(); iter.hasNext(); ) { - final Difference diff = iter.next(); - final String className = diff.getClassName(); - maxClassNameLen = Math.max(maxClassNameLen, className.length()); - - DiffCount dc = className2DiffCount.get(className); - if( null == dc ) { - dc = new DiffCount(className); - className2DiffCount.put(className, dc); - } - - if( diff instanceof Delta.Add ) { - diffsAdd.add(diff); - dc.additions++; - } else if( diff instanceof Delta.Change ) { - diffsChange.add(diff); - dc.changes++; - } else if( diff instanceof Delta.Deprecate ) { - diffsDeprecate.add(diff); - dc.deprecates++; - } else if( diff instanceof Delta.Remove ) { - diffsRemove.add(diff); - dc.removes++; - } - } - Collections.sort(diffsAdd); - Collections.sort(diffsChange); - Collections.sort(diffsDeprecate); - Collections.sort(diffsRemove); - - final List classNames = new ArrayList(className2DiffCount.keySet()); - Collections.sort(classNames); - - System.err.println("Summary: "+diffs.size()+" differences in "+classNames.size()+" classes:"); - System.err.println(" Remove "+diffsRemove.size()+ - ", Change "+diffsChange.size()+ - ", Deprecate "+diffsDeprecate.size()+ - ", Add "+diffsAdd.size()); - System.err.println("--------------------------------------------------------------------------------------------------------------"); - - int iterI = 0; - for(final Iterator iter = classNames.iterator(); iter.hasNext(); iterI++) { - final String className = iter.next(); - final DiffCount dc = className2DiffCount.get(className); - System.err.printf("%4d/%4d: %-"+maxClassNameLen+"s: %s%n", iterI, classNames.size(), className, dc.format(4)); - } - - System.err.println("--------------------------------------------------------------------------------------------------------------"); - System.err.println("Removes"); - System.err.println("--------------------------------------------------------------------------------------------------------------"); - Dumper.dump(diffsRemove, System.err); - System.err.println("--------------------------------------------------------------------------------------------------------------"); - System.err.println("Changes"); - System.err.println("--------------------------------------------------------------------------------------------------------------"); - Dumper.dump(diffsChange, System.err); - System.err.println("--------------------------------------------------------------------------------------------------------------"); - System.err.println("Deprecates"); - System.err.println("--------------------------------------------------------------------------------------------------------------"); - Dumper.dump(diffsDeprecate, System.err); - System.err.println("--------------------------------------------------------------------------------------------------------------"); - System.err.println("Additions"); - System.err.println("--------------------------------------------------------------------------------------------------------------"); - Dumper.dump(diffsAdd, System.err); - System.err.println("=============================================================================================================="); + // Also dump sorted by class name + System.err.printf("%n%nClass Order%n%n"); + Dumper.dump(delta, System.err); Assert.assertTrue(resS, compOK); @@ -196,17 +120,4 @@ public class VersionSemanticsUtil { final boolean compatible = delta.validate(previous, current); */ } - static class DiffCount { - public DiffCount(String name) { this.name = name; } - public final String name; - public int removes; - public int changes; - public int deprecates; - public int additions; - public String toString() { return name+": Remove "+removes+", Change "+changes+", Deprecate "+deprecates+", Add "+additions; } - public String format(final int digits) { - return String.format("Remove %"+digits+"d, Change %"+digits+"d, Deprecate %"+digits+"d, Add %"+digits+"d", - removes, changes, deprecates, additions); - } - } } -- cgit v1.2.3