sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1635918 - /sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/APIVerifier.java
Date Sat, 01 Nov 2014 10:50:15 GMT
Author: desruisseaux
Date: Sat Nov  1 10:50:15 2014
New Revision: 1635918

URL: http://svn.apache.org/r1635918
Log:
Need to use a different ClassLoader than the APIVerifier one,
because we do not want to inherit its GeoAPI dependency in this case.

Modified:
    sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/APIVerifier.java

Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/APIVerifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/APIVerifier.java?rev=1635918&r1=1635917&r2=1635918&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/APIVerifier.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/APIVerifier.java
[UTF-8] Sat Nov  1 10:50:15 2014
@@ -149,20 +149,22 @@ public final strictfp class APIVerifier 
      *
      * @param  releasedJAR Path to the JAR file of the GeoAPI interfaces implemented by the
stable version of Apache SIS.
      * @param  snapshotJAR Path to the JAR file of the GeoAPI interfaces that we would implement
if it was released.
+     * @param  unitsJAR    Path to the JAR file containing the {@code Unit} class. This is
a GeoAPI dependency.
      * @param  out Where to write the API differences between {@code releasedJAR} and {@code
snapshotJAR}.
      * @throws ReflectiveOperationException if an error occurred while processing the JAR
file content.
      * @throws IOException if an error occurred while reading the JAR files or writing to
{@code out}.
      */
-    public static void listAPIChanges(final File releasedJAR, final File snapshotJAR, final
Appendable out)
-            throws ReflectiveOperationException, IOException
+    public static void listAPIChanges(final File releasedJAR, final File snapshotJAR, final
File unitsJAR,
+            final Appendable out) throws ReflectiveOperationException, IOException
     {
         final String lineSeparator = System.lineSeparator();
         final Map<String,Boolean> methodChanges = new TreeMap<>();
         final List<String> incompatibleChanges = new ArrayList<>();
-        final ClassLoader parent = APIVerifier.class.getClassLoader();
+        final ClassLoader parent = APIVerifier.class.getClassLoader().getParent();
+        final URL dependency = unitsJAR.toURI().toURL();
         try (final JarFile newJARContent = new JarFile(snapshotJAR);
-             final URLClassLoader oldAPI = new URLClassLoader(new URL[] {releasedJAR.toURI().toURL()},
parent);
-             final URLClassLoader newAPI = new URLClassLoader(new URL[] {snapshotJAR.toURI().toURL()},
parent))
+             final URLClassLoader oldAPI = new URLClassLoader(new URL[] {releasedJAR.toURI().toURL(),
dependency}, parent);
+             final URLClassLoader newAPI = new URLClassLoader(new URL[] {snapshotJAR.toURI().toURL(),
dependency}, parent))
         {
             final Class<? extends Annotation> newUML = Class.forName("org.opengis.annotation.UML",
false, newAPI).asSubclass(Annotation.class);
             final Method newIdentifier = newUML.getMethod("identifier", (Class[]) null);



Mime
View raw message