sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tlpin...@apache.org
Subject svn commit: r1517321 [2/16] - in /sis/branches/Shapefile: ./ application/ application/sis-console/ application/sis-console/src/main/artifact/ application/sis-console/src/main/java/org/apache/sis/console/ application/sis-console/src/main/resources/org/a...
Date Sun, 25 Aug 2013 15:49:59 GMT
Modified: sis/branches/Shapefile/application/sis-webapp/src/main/java/org/apache/sis/services/LocationServlet.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/application/sis-webapp/src/main/java/org/apache/sis/services/LocationServlet.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/application/sis-webapp/src/main/java/org/apache/sis/services/LocationServlet.java [UTF-8] (original)
+++ sis/branches/Shapefile/application/sis-webapp/src/main/java/org/apache/sis/services/LocationServlet.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -52,8 +52,8 @@ import org.w3c.dom.Text;
 import org.xml.sax.SAXException;
 
 //SIS imports
-import org.apache.sis.core.LatLon;
-import org.apache.sis.core.LatLonRect;
+import org.apache.sis.geometry.DirectPosition2D;
+import org.apache.sis.geometry.Envelope2D;
 import org.apache.sis.distance.DistanceUtils;
 import org.apache.sis.index.tree.GeoRSSData;
 import org.apache.sis.index.tree.QuadTree;
@@ -195,15 +195,15 @@ public class LocationServlet extends Htt
                 else
                   filename = cleanStr(item.getLink()) + ".txt";
 
-                GeoRSSData data = new GeoRSSData(filename, new LatLon(
-                    geoRSSModule.getPosition().getLatitude(), geoRSSModule
-                        .getPosition().getLongitude()));
+                GeoRSSData data = new GeoRSSData(filename, new DirectPosition2D(
+                    geoRSSModule.getPosition().getLongitude(),
+                    geoRSSModule.getPosition().getLatitude()));
                 if (this.tree.insert(data)) {
                   data.saveToFile(item, geoRSSModule, georssStoragePath);
                 } else {
                   System.out.println("[INFO] Unable to store data at location "
-                      + data.getLatLon().getLat() + ", "
-                      + data.getLatLon().getLon() + " under filename "
+                      + data.getLatLon().y + ", "
+                      + data.getLatLon().x + " under filename "
                       + data.getFileName());
                 }
               }
@@ -264,26 +264,22 @@ public class LocationServlet extends Htt
 
       if (llLat != null && llLon != null && urLat != null && urLon != null) {
         try {
-          LatLonRect bbox = new LatLonRect(new LatLon(
-              Double.parseDouble(llLat), Double.parseDouble(llLon)),
-              new LatLon(Double.parseDouble(urLat), Double.parseDouble(urLon)));
+          Envelope2D bbox = new Envelope2D(new DirectPosition2D(
+              Double.parseDouble(llLon), Double.parseDouble(llLat)),
+              new DirectPosition2D(Double.parseDouble(urLon), Double.parseDouble(urLat)));
 
           beforeTime = System.currentTimeMillis();
           results = tree.queryByBoundingBox(bbox);
           afterTime = System.currentTimeMillis();
           // get the polygon that approximates the region
-          Rectangle2D[] rects = bbox.getJavaRectangles();
+          Rectangle2D[] rects = bbox.toRectangles();
           for (int i = 0; i < rects.length; i++) {
-            String regionStr = (rects[i].getMinY() - 90) + ","
-                + (rects[i].getMinX() - 180) + ",";
-            regionStr += (rects[i].getMaxY() - 90) + ","
-                + (rects[i].getMinX() - 180) + ",";
-            regionStr += (rects[i].getMaxY() - 90) + ","
-                + (rects[i].getMaxX() - 180) + ",";
-            regionStr += (rects[i].getMinY() - 90) + ","
-                + (rects[i].getMaxX() - 180) + ",";
-            regionStr += (rects[i].getMinY() - 90) + ","
-                + (rects[i].getMinX() - 180);
+            final Rectangle2D r = rects[i];
+            String regionStr = (r.getMinY()) + "," + (r.getMinX()) + ",";
+            regionStr += (r.getMaxY()) + "," + (r.getMinX()) + ",";
+            regionStr += (r.getMaxY()) + "," + (r.getMaxX()) + ",";
+            regionStr += (r.getMinY()) + "," + (r.getMaxX()) + ",";
+            regionStr += (r.getMinY()) + "," + (r.getMinX());
             regions.add(regionStr);
           }
         } catch (NumberFormatException ex) {
@@ -299,9 +295,9 @@ public class LocationServlet extends Htt
 
       if (radius != null && lat != null && lon != null) {
 
-        LatLon point = null;
+        DirectPosition2D point = null;
         try {
-          point = new LatLon(Double.parseDouble(lat), Double.parseDouble(lon));
+          point = new DirectPosition2D(Double.parseDouble(lon), Double.parseDouble(lat));
         } catch (NumberFormatException ex) {
           System.out
               .println("{ERROR] Input parameters were not valid latitudes and longitudes");
@@ -312,13 +308,11 @@ public class LocationServlet extends Htt
         String regionStr = "";
 
         for (int i = 0; i < 360; i += 10) {
-          LatLon pt = DistanceUtils.getPointOnGreatCircle(point.getLat(), point
-              .getLon(), radiusKM, i);
-          regionStr += pt.toString() + ",";
+          DirectPosition2D pt = DistanceUtils.getPointOnGreatCircle(point.y, point.x, radiusKM, i);
+          regionStr += pt.y + "," + pt.x + ",";
         }
-        LatLon pt = DistanceUtils.getPointOnGreatCircle(point.getLat(), point
-            .getLon(), radiusKM, 0);
-        regionStr += pt.toString() + ",";
+        DirectPosition2D pt = DistanceUtils.getPointOnGreatCircle(point.y, point.x, radiusKM, 0);
+        regionStr += pt.y + "," + pt.x + ",";
         regions.add(regionStr.substring(0, regionStr.length() - 1));
 
         beforeTime = System.currentTimeMillis();
@@ -414,14 +408,12 @@ public class LocationServlet extends Htt
         item.appendChild(id);
 
         Element lat = doc.createElement("lat");
-        Text latText = doc.createTextNode(Double.toString(geo.getLatLon()
-            .getLat()));
+        Text latText = doc.createTextNode(Double.toString(geo.getLatLon().y));
         lat.appendChild(latText);
         item.appendChild(lat);
 
         Element lon = doc.createElement("lon");
-        Text lonText = doc.createTextNode(Double.toString(geo.getLatLon()
-            .getLon()));
+        Text lonText = doc.createTextNode(Double.toString(geo.getLatLon().x));
         lon.appendChild(lonText);
         item.appendChild(lon);
 

Modified: sis/branches/Shapefile/application/sis-webapp/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/application/sis-webapp/src/site/apt/index.apt?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/application/sis-webapp/src/site/apt/index.apt [UTF-8] (original)
+++ sis/branches/Shapefile/application/sis-webapp/src/site/apt/index.apt [UTF-8] Sun Aug 25 15:49:51 2013
@@ -1,3 +1,22 @@
+~~
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements.  See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership.  The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License.  You may obtain a copy of the License at
+~~
+~~   http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied.  See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+~~
+
                              ------------------------------
                                Apache SIS web application
                              ------------------------------

Modified: sis/branches/Shapefile/application/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/application/src/site/apt/index.apt?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/application/src/site/apt/index.apt [UTF-8] (original)
+++ sis/branches/Shapefile/application/src/site/apt/index.apt [UTF-8] Sun Aug 25 15:49:51 2013
@@ -1,3 +1,22 @@
+~~
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements.  See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership.  The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License.  You may obtain a copy of the License at
+~~
+~~   http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied.  See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+~~
+
                              ------------------------------
                              Apache SIS application modules
                              ------------------------------

Modified: sis/branches/Shapefile/core/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/pom.xml?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/pom.xml (original)
+++ sis/branches/Shapefile/core/pom.xml Sun Aug 25 15:49:51 2013
@@ -28,7 +28,7 @@
   <parent>
     <groupId>org.apache.sis</groupId>
     <artifactId>parent</artifactId>
-    <version>0.3-geoapi3.0-SNAPSHOT</version>
+    <version>0.4-SNAPSHOT</version>
   </parent>
 
 
@@ -66,6 +66,14 @@
         <role>developer</role>
       </roles>
     </developer>
+    <developer>
+      <name>Travis L. Pinney</name>
+      <id>tlpinney</id>
+      <email>travis.pinney@gmail.com</email>
+      <roles>
+        <role>developer</role>
+      </roles>
+    </developer>
   </developers>
   <contributors>
     <contributor>
@@ -124,6 +132,7 @@
     <module>sis-utility</module>
     <module>sis-metadata</module>
     <module>sis-referencing</module>
+    <module>sis-feature</module>
   </modules>
 
 </project>

Modified: sis/branches/Shapefile/core/sis-build-helper/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-build-helper/pom.xml?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-build-helper/pom.xml (original)
+++ sis/branches/Shapefile/core/sis-build-helper/pom.xml Sun Aug 25 15:49:51 2013
@@ -28,13 +28,14 @@
   <parent>
     <groupId>org.apache.sis</groupId>
     <artifactId>core</artifactId>
-    <version>0.3-geoapi3.0-SNAPSHOT</version>
+    <version>0.4-SNAPSHOT</version>
   </parent>
 
 
   <!-- ===========================================================
            Module Description
        =========================================================== -->
+  <groupId>org.apache.sis.core</groupId>
   <artifactId>sis-build-helper</artifactId>
   <packaging>maven-plugin</packaging>
   <name>Apache SIS build helper</name>
@@ -83,6 +84,10 @@ Define Maven Mojos and Javadoc taglets f
       <artifactId>maven-plugin-api</artifactId>
       <version>3.0.5</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-compress</artifactId>
+    </dependency>
   </dependencies>
 
 

Modified: sis/branches/Shapefile/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/BundleCreator.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/BundleCreator.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/BundleCreator.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/BundleCreator.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -20,20 +20,25 @@ import java.io.File;
 import java.io.IOException;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.project.MavenProject;
+
+import static org.apache.sis.internal.maven.Filenames.*;
 
 
 /**
  * Merges the binaries produced by <code>JarCollector</code> and compress them using Pack200.
- * This mojo delegates the work to <code>Packer</code>, which can be invoked from the command
- * line without Maven. Maven invocation syntax is:
+ * This mojo can be invoked from the command line as below:
  *
- * <blockquote><code>mvn org.apache.sis:sis-build-helper:pack --non-recursive</code></blockquote>
+ * <blockquote><code>mvn org.apache.sis.core:sis-build-helper:pack --non-recursive</code></blockquote>
  *
  * Do not forget the <code>--non-recursive</code> option, otherwise the Mojo will be executed many time.
  *
+ * <p><b>Current limitation:</b>
+ * The final name is hard coded to <code>apache-sis-&lt;version&gt;.pack.gz</code> for now.</p>
+ *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.00)
- * @version 0.3
+ * @version 0.4
  * @module
  *
  * @goal pack
@@ -41,16 +46,13 @@ import org.apache.maven.plugin.MojoExecu
  */
 public class BundleCreator extends AbstractMojo {
     /**
-     * The Apache SIS version, without branch name.
-     */
-    private static final String VERSION = "0.3";
-
-    /**
-     * The Apache SIS branch for which this plugin is creating a bundle.
-     * This is declared as a separated constant in order to make easier to update
-     * {@link #VERSION} without creating conflicts during branch merge.
+     * Project information (name, version, URL).
+     *
+     * @parameter default-value="${project}"
+     * @required
+     * @readonly
      */
-    private static final String BRANCH = "geoapi3.0";
+    private MavenProject project;
 
     /**
      * The root directory (without the "<code>target/binaries</code>" sub-directory) where JARs
@@ -62,26 +64,20 @@ public class BundleCreator extends Abstr
     private String rootDirectory;
 
     /**
-     * Creates the Pack200 files from the JAR files collected in the "<code>target/binaries</code>" directory.
+     * Creates the Pack200 file from the JAR files collected in the "<code>target/binaries</code>" directory.
      *
      * @throws MojoExecutionException if the plugin execution failed.
      */
     @Override
     public void execute() throws MojoExecutionException {
-        final File targetDirectory = new File(rootDirectory, JarCollector.TARGET_DIRECTORY);
+        final File targetDirectory = new File(rootDirectory, TARGET_DIRECTORY);
         if (!targetDirectory.isDirectory()) {
             throw new MojoExecutionException("Directory not found: " + targetDirectory);
         }
+        final String version = project.getVersion();
         try {
-            final String fullVersion = VERSION + '-' + BRANCH;
-            final Packer packer = new Packer(targetDirectory, fullVersion);
-            packer.addPack("sis-" + fullVersion + ".jar");
-            try {
-                packer.createJars();
-            } finally {
-                packer.close();
-            }
-            packer.pack();
+            final Packer packer = new Packer(project.getName(), project.getUrl(), version, targetDirectory);
+            packer.preparePack200(FINALNAME_PREFIX + version + ".jar").pack();
         } catch (IOException e) {
             throw new MojoExecutionException(e.getLocalizedMessage(), e);
         }

Modified: sis/branches/Shapefile/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/JarCollector.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/JarCollector.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/JarCollector.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/JarCollector.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -23,8 +23,6 @@ import java.io.FileWriter;
 import java.io.BufferedReader;
 import java.io.BufferedWriter;
 import java.io.IOException;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
 import java.util.Set;
 import java.util.LinkedHashSet;
 import org.apache.maven.plugin.AbstractMojo;
@@ -32,6 +30,8 @@ import org.apache.maven.plugin.MojoExecu
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.artifact.Artifact;
 
+import static org.apache.sis.internal.maven.Filenames.*;
+
 
 /**
  * Collects <code>.jar</code> files in a single "{@code target/binaries}" directory.
@@ -50,22 +50,6 @@ import org.apache.maven.artifact.Artifac
  */
 public final class JarCollector extends AbstractMojo implements FileFilter {
     /**
-     * The target directory.
-     */
-    static final String TARGET_DIRECTORY = "target";
-
-    /**
-     * The sub directory to create inside the "target" directory.
-     */
-    static final String SUB_DIRECTORY = "binaries";
-
-    /**
-     * The name of the file where to list SIS JAR files and their dependencies
-     * on platforms that do not support hard links.
-     */
-    static final String CONTENT_FILE = "content.txt";
-
-    /**
      * The Maven project running this plugin.
      *
      * @parameter property="project"
@@ -121,7 +105,7 @@ public final class JarCollector extends 
         File collect = new File(rootDirectory, TARGET_DIRECTORY);
         if (!collect.exists()) {
             if (!collect.mkdir()) {
-                throw new MojoExecutionException("Failed to create target directory.");
+                throw new MojoExecutionException("Failed to create \"" + TARGET_DIRECTORY + "\" directory.");
             }
         }
         if (collect.getCanonicalFile().equals(jarFile.getParentFile().getCanonicalFile())) {
@@ -137,10 +121,10 @@ public final class JarCollector extends 
          * Creates a "binaries" subdirectory inside the "target" directory, then copy the
          * JAR file compiled by Maven. If an JAR file already existed, it will be deleted.
          */
-        collect = new File(collect, SUB_DIRECTORY);
+        collect = new File(collect, BINARIES_DIRECTORY);
         if (!collect.exists()) {
             if (!collect.mkdir()) {
-                throw new MojoExecutionException("Failed to create binaries directory.");
+                throw new MojoExecutionException("Failed to create \"" + BINARIES_DIRECTORY + "\" directory.");
             }
         }
         File copy = new File(collect, jarFile.getName());

Modified: sis/branches/Shapefile/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/PackOutput.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/PackOutput.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/PackOutput.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/PackOutput.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -19,17 +19,19 @@ package org.apache.sis.internal.maven;
 import java.util.Map;
 import java.util.Set;
 import java.util.HashSet;
-import java.util.LinkedHashSet;
+import java.util.Iterator;
 import java.util.Enumeration;
 import java.util.jar.*;
 import java.io.File;
 import java.io.Closeable;
 import java.io.IOException;
+import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.FileOutputStream;
 import java.util.zip.GZIPOutputStream;
 
 import static java.util.jar.Pack200.Packer.*;
+import static org.apache.sis.internal.maven.Filenames.*;
 
 
 /**
@@ -37,7 +39,7 @@ import static java.util.jar.Pack200.Pack
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.00)
- * @version 0.3
+ * @version 0.4
  * @module
  */
 final class PackOutput implements Closeable {
@@ -47,21 +49,15 @@ final class PackOutput implements Closea
     private static final String CLASS = ".class";
 
     /**
-     * The packer that created this object. Will be used in order to fetch
-     * additional informations like the version to declare in the pom.xml file.
+     * The output file path.
      */
-    private final Packer packer;
+    private final File outputJAR;
 
     /**
-     * The output file.
+     * The stream where to write the JAR.
+     * Created only when {@link #open(File)} is invoked.
      */
-    private File file;
-
-    /**
-     * The stream where to write the JAR. Will be created
-     * only when {@link #open} will be invoked.
-     */
-    private JarOutputStream out;
+    private JarOutputStream outputStream;
 
     /**
      * The manifest attribute value, or {@code null} if none. We will set this field to the
@@ -71,88 +67,44 @@ final class PackOutput implements Closea
     private String mainClass, splashScreen;
 
     /**
-     * The JAR to be used as inputs.
-     */
-    private final Set<File> inputs;
-
-    /**
-     * The entries which were already done by previous invocation of {@link #getInputStream}.
+     * The JAR to be used as inputs. The elements in this map will be removed by the
+     * {@link #write()} method as we are done copying the content of JAR files.
      */
-    private final Set<String> entriesDone = new HashSet<String>();
+    private final Map<File,PackInput> inputJARs;
 
     /**
-     * Creates an output jar.
+     * The entries which were already written in the output JAR file.
+     * There is two kind of entries which need this check:
      *
-     * @param packer    The packer that created this object.
-     * @param parent    The parent, or {@code null} if none.
-     * @param jars      The JAR filenames.
-     */
-    PackOutput(final Packer packer, final PackOutput parent, final String[] jars) {
-        this.packer = packer;
-        if (parent != null) {
-            inputs = new LinkedHashSet<File>(parent.inputs);
-        } else {
-            inputs = new LinkedHashSet<File>(jars.length * 4/3);
-        }
-        for (final String jar : jars) {
-            File file = new File(jar);
-            if (!file.isAbsolute()) {
-                file = new File(packer.jarDirectory, jar);
-            }
-            if (!file.isFile()) {
-                throw new IllegalArgumentException("Not a file: " + file);
-            }
-            if (!inputs.add(file)) {
-                throw new IllegalArgumentException("Duplicated JAR: " + file);
-            }
-        }
-    }
-
-    /**
-     * Returns {@code true} if this pack contains the given JAR file.
+     * <ul>
+     *   <li>Directories, which may be duplicated in different JAR files.</li>
+     *   <li>{@code META-INF/services} files which were merged in a single file.</li>
+     * </ul>
      *
-     * @param  file The JAR file to check for inclusion.
-     * @return {@code true} if this pack contains the given JAR file.
+     * @see #isMergeAllowed(String)
      */
-    boolean contains(final File file) {
-        return inputs.contains(file);
-    }
+    private final Set<String> entriesDone = new HashSet<String>();
 
     /**
-     * Copies the entries from the given {@code mapping} to the given {@code actives} map, but
-     * only those having a key included in the set of input files used by this {@code PackOutput}.
+     * Returns {@code true} if entries of the given name are allowed to be concatenated
+     * when they appear in more than one input JAR files.
      *
-     * @param mapping The mapping from {@link File} to {@link PackInput}.
-     * @param actives Where to store the {@link PackInput} required for
-     *        input by this {@code PackOutput}.
-     */
-    void copyInputs(final Map<File,PackInput> mapping, final Map<File,PackInput> actives) {
-        for (final File file : inputs) {
-            final PackInput input = mapping.get(file);
-            if (input != null) {
-                final PackInput old = actives.put(file, input);
-                if (old != null && old != input) {
-                    throw new AssertionError("Inconsistent mapping.");
-                }
-            }
-        }
+     * @see #entriesDone
+     */
+    private static boolean isMergeAllowed(final String name) {
+        return name.startsWith(PackInput.SERVICES);
     }
 
     /**
-     * Opens the JAR files that were not already opens and store them in the given map.
+     * Creates an output jar.
      *
-     * @param  inputs The map where to store the opened JAR files.
-     * @throws IOException If a file can not be open.
+     * @param inputJARs The input JAR filenames together with their {@code PackInput} helpers.
+     * @param outputJAR The output JAR filename.
      */
-    void createPackInputs(final Map<File,PackInput> inputs) throws IOException {
-        for (final File jar : this.inputs) {
-            PackInput in = inputs.get(jar);
-            if (in == null) {
-                in = new PackInput(jar);
-                if (inputs.put(jar, in) != null) {
-                    throw new AssertionError(jar);
-                }
-            }
+    PackOutput(final Map<File,PackInput> inputJARs, final File outputJAR) {
+        this.inputJARs = inputJARs;
+        this.outputJAR = outputJAR;
+        for (final PackInput in : inputJARs.values()) {
             if (in.mainClass != null) {
                 mainClass = in.mainClass;
             }
@@ -163,23 +115,30 @@ final class PackOutput implements Closea
     }
 
     /**
-     * Opens the given JAR file for writing
+     * Opens the given JAR file for writing and creates its manifest.
      *
-     * @param  file The file to open.
+     * @param  projectName The project name, or {@code null} if none.
+     * @param  projectURL  The project URL, or {@code null} if none.
+     * @param  version     The project version, or {@code null} if none.
      * @throws IOException if the file can't be open.
      */
-    void open(final File file) throws IOException {
-        this.file = file;
+    void open(final String projectName, final String projectURL, final String version) throws IOException {
         final Manifest manifest = new Manifest();
         Attributes attributes = manifest.getMainAttributes();
-        attributes.put(Attributes.Name.MANIFEST_VERSION,       "1.0");
-        attributes.put(Attributes.Name.SPECIFICATION_TITLE,    "Apache SIS");
-        attributes.put(Attributes.Name.SPECIFICATION_VENDOR,   "Apache SIS");
-        attributes.put(Attributes.Name.SPECIFICATION_VERSION,  packer.version);
-        attributes.put(Attributes.Name.IMPLEMENTATION_TITLE,   "Apache SIS");
-        attributes.put(Attributes.Name.IMPLEMENTATION_VENDOR,  "Apache SIS");
-        attributes.put(Attributes.Name.IMPLEMENTATION_VERSION, packer.version);
-        attributes.put(Attributes.Name.IMPLEMENTATION_URL,     "http://sis.apache.org");
+        attributes.put(Attributes.Name.MANIFEST_VERSION, "1.0");
+        if (projectName != null) {
+            attributes.put(Attributes.Name.SPECIFICATION_TITLE,    projectName);
+            attributes.put(Attributes.Name.SPECIFICATION_VENDOR,   projectName);
+            attributes.put(Attributes.Name.IMPLEMENTATION_TITLE,   projectName);
+            attributes.put(Attributes.Name.IMPLEMENTATION_VENDOR,  projectName);
+        }
+        if (projectURL != null) {
+            attributes.put(Attributes.Name.IMPLEMENTATION_URL, projectURL);
+        }
+        if (version != null) {
+            attributes.put(Attributes.Name.SPECIFICATION_VERSION,  version);
+            attributes.put(Attributes.Name.IMPLEMENTATION_VERSION, version);
+        }
         if (mainClass != null) {
             attributes.put(Attributes.Name.MAIN_CLASS, mainClass);
         }
@@ -187,9 +146,9 @@ final class PackOutput implements Closea
             attributes.put(PackInput.SPLASH_SCREEN, splashScreen);
         }
         /*
-         * Add the manifest of every dependencies.
+         * Add the package-level manifest of every dependencies.
          */
-        for (final File input : inputs) {
+        for (final File input : inputJARs.keySet()) {
             if (!input.getName().startsWith("sis-")) {
                 String packageName = null;
                 final JarFile jar = new JarFile(input, false);
@@ -237,13 +196,15 @@ final class PackOutput implements Closea
         /*
          * Open the output stream for the big JAR file.
          */
-        out = new JarOutputStream(new FileOutputStream(file), manifest);
-        out.setLevel(1); // Use a cheap compression level since this JAR file is temporary.
+        outputStream = new JarOutputStream(new FileOutputStream(outputJAR), manifest);
+        outputStream.setLevel(1); // Use a cheap compression level since this JAR file is temporary.
     }
 
     /**
      * Copies the value of the given attribute from a source {@code Attributes} to a target
-     * {@code Attributes} object.
+     * {@code Attributes} object. This is used for copying the package-level attributes.
+     *
+     * @return {@code true} if the attribute has been copied.
      */
     private static boolean copy(final Attributes src, final Attributes dst, final Attributes.Name name) {
         String value = (String) src.get(name);
@@ -255,49 +216,60 @@ final class PackOutput implements Closea
     }
 
     /**
-     * Returns {@code true} if entries of the given name are allowed to be concatenated
-     * if they appear in more than one input JAR files.
+     * Iterates through the individual jars and merge them in single, bigger JAR file.
+     * This method closes the input JAR files as they are done.
      */
-    static boolean mergeAllowed(final String name) {
-        return name.startsWith(PackInput.SERVICES);
-    }
-
-    /**
-     * Begins writing a new JAR entry.
-     *
-     * @param  entry The new entry to write.
-     * @return {@code true} if the entry is ready to write, or {@code false} if it should be skipped.
-     * @throws IOException If a failure occurs while creating the entry.
-     */
-    boolean putNextEntry(final JarEntry entry) throws IOException {
-        final String name = entry.getName();
-        if (entry.isDirectory() || mergeAllowed(name)) {
-            if (!entriesDone.add(name)) {
-                return false;
+    final void writeContent() throws IOException {
+        final byte[] buffer = new byte[64 * 1024];
+        for (final Iterator<Map.Entry<File,PackInput>> it = inputJARs.entrySet().iterator(); it.hasNext();) {
+            final Map.Entry<File,PackInput> inputJAR = it.next();
+            it.remove(); // Needs to be removed before the inner loop below.
+            final PackInput input = inputJAR.getValue();
+            try {
+                for (JarEntry entry; (entry = input.nextEntry()) != null;) {
+                    final String name = entry.getName();
+                    boolean isMergeAllowed = false;
+                    if (entry.isDirectory() || (isMergeAllowed = isMergeAllowed(name))) {
+                        if (!entriesDone.add(name)) {
+                            continue;
+                        }
+                    }
+                    outputStream.putNextEntry(entry);
+                    copy(input.getInputStream(), buffer);
+                    /*
+                     * From that points, the entry has been copied to the target JAR. Now look in
+                     * following input JARs to see if there is some META-INF/services files to merge.
+                     */
+                    if (isMergeAllowed) {
+                        for (final Map.Entry<File,PackInput> continuing : inputJARs.entrySet()) {
+                            final InputStream in = continuing.getValue().getInputStream(name);
+                            if (in != null) {
+                                copy(in, buffer);
+                            }
+                        }
+                    }
+                    outputStream.closeEntry();
+                }
+            } finally {
+                input.close();
             }
         }
-        out.putNextEntry(entry);
-        return true;
-    }
-
-    /**
-     * Writes the given number of bytes.
-     *
-     * @param  buffer The buffer containing the bytes to write.
-     * @param  n The number of bytes to write.
-     * @throws IOException if an exception occurred while writing the bytes.
-     */
-    void write(final byte[] buffer, final int n) throws IOException {
-        out.write(buffer, 0, n);
     }
 
     /**
-     * Close the current entry.
+     * Copies fully the given input stream to the given destination.
+     * The given input stream is closed after the copy.
      *
-     * @throws IOException If an error occurred while closing the entry.
-     */
-    void closeEntry() throws IOException {
-        out.closeEntry();
+     * @param  in     The input stream from which to get the the content to copy.
+     * @param  buffer Temporary buffer to reuse at each method call.
+     * @throws IOException If an error occurred during the copy.
+     */
+    void copy(final InputStream in, final byte[] buffer) throws IOException {
+        int n;
+        while ((n = in.read(buffer)) >= 0) {
+            outputStream.write(buffer, 0, n);
+        }
+        in.close();
     }
 
     /**
@@ -307,35 +279,55 @@ final class PackOutput implements Closea
      */
     @Override
     public void close() throws IOException {
-        if (out != null) {
-            out.close();
+        for (final PackInput input : inputJARs.values()) {
+            /*
+             * The code in this loop is never executed in normal execution, since the map shall be empty after
+             * successful completion of 'writeContent()'. However the map may be non-empty if the above method
+             * threw an exception, in which case this 'close()' method will be invoked in a 'finally' block.
+             */
+            input.close();
         }
-        out = null;
+        inputJARs.clear();
+        if (outputStream != null) {
+            outputStream.close();
+        }
+        outputStream = null;
     }
 
     /**
-     * Packs the output JAR.
+     * Creates a Pack200 file from the output JAR, then delete the JAR.
      *
      * @throws IOException if an error occurred while packing the JAR.
      */
     void pack() throws IOException {
-        if (out != null) {
+        if (outputStream != null) {
             throw new IllegalStateException("JAR output stream not closed.");
         }
-        final File inputFile = file;
+        final File inputFile = outputJAR;
         String filename = inputFile.getName();
         final int ext = filename.lastIndexOf('.');
         if (ext > 0) {
             filename = filename.substring(0, ext);
         }
-        filename += ".pack.gz";
+        filename += PACK_EXTENSION;
         final File outputFile = new File(inputFile.getParent(), filename);
         if (outputFile.equals(inputFile)) {
-            throw new IOException("Input file is already a packed: " + inputFile);
+            throw new IOException("Input file is already packed: " + inputFile);
         }
-        /*
-         * Now process to the compression.
-         */
+        pack(new FileOutputStream(outputFile));
+    }
+
+    /**
+     * Creates a Pack200 file from the output JAR, then delete the JAR.
+     *
+     * @param  out Where to write the Pack200. This stream will be closed by this method.
+     * @throws IOException if an error occurred while packing the JAR.
+     */
+    void pack(final OutputStream out) throws IOException {
+        if (outputStream != null) {
+            throw new IllegalStateException("JAR output stream not closed.");
+        }
+        final File inputFile = outputJAR;
         final Pack200.Packer packer = Pack200.newPacker();
         final Map<String,String> p = packer.properties();
         p.put(EFFORT, String.valueOf(9));  // Maximum compression level.
@@ -345,11 +337,11 @@ final class PackOutput implements Closea
         p.put(UNKNOWN_ATTRIBUTE,  ERROR);  // Throw an error if an attribute is unrecognized
         final JarFile jarFile = new JarFile(inputFile);
         try {
-            final OutputStream out = new GZIPOutputStream(new FileOutputStream(outputFile));
+            final OutputStream deflater = new GZIPOutputStream(out);
             try {
-                packer.pack(jarFile, out);
+                packer.pack(jarFile, deflater);
             } finally {
-                out.close();
+                deflater.close();
             }
         } finally {
             jarFile.close();

Modified: sis/branches/Shapefile/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Packer.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Packer.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Packer.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Packer.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -19,311 +19,122 @@ package org.apache.sis.internal.maven;
 import java.util.Map;
 import java.util.Set;
 import java.util.Arrays;
-import java.util.Iterator;
 import java.util.LinkedHashMap;
-import java.util.jar.*;
 import java.io.File;
 import java.io.FilenameFilter;
 import java.io.FileNotFoundException;
 import java.io.IOException;
-import java.io.InputStream;
+
+import static org.apache.sis.internal.maven.Filenames.*;
 
 
 /**
- * Creates PAC200 files from the JAR builds by Maven. This tools needs the JAR files to be either provided
- * in the {@code target/binaries} directory, or listed in the {@code target/binaries/content.txt} file.
- *
- * <p><b>Usage:</b> If {@code rootDirectory} is the directory containing the root {@code pom.xml} file,
- * then this class can be used as below (replace {@code "1.0"} by the actual version number and
- * {@code "sis-1.0.jar"} by any filename of your choice):</p>
- *
- * <blockquote><pre> Packer packer = new Packer(new File(rootDirectory, "target"), "1.0");
- * packer.addPack("sis-1.0.jar");
- * packer.createJars();
- * packer.close();
- * packer.pack();</pre></blockquote>
+ * Creates a PACK200 files from the JAR in the {@code target/binaries} directory.
+ * This tools needs the JAR files to be either copied or linked in the {@code target/binaries} directory,
+ * or listed in the {@code target/binaries/content.txt} file.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.00)
- * @version 0.3
+ * @version 0.4
  * @module
  */
 final class Packer implements FilenameFilter {
     /**
-     * The sub-directory containing pack files. This directory
-     * will be automatically created if it doesn't already exist.
+     * The project name, URL and version to declare in the manifest file, or {@code null} if none.
      */
-    private static final String PACK_DIRECTORY = "bundles";
+    private final String projectName, projectURL, version;
 
     /**
-     * The Maven target directory. Should contains the {@code "binaries"} sub-directory,
-     * which should contains all JAR files collected by {@code sis-build-helper} plugin.
+     * The Maven target directory. Shall contain the {@code "binaries"} sub-directory,
+     * which shall contains all JAR files collected by {@code sis-build-helper} plugin.
      */
     private final File targetDirectory;
 
     /**
-     * The directory of JAR files. Shall be {@code "target/binaries"}.
-     */
-    final File jarDirectory;
-
-    /**
-     * The JAR files to read, by input filename.
-     */
-    private final Map<File,PackInput> inputs = new LinkedHashMap<File,PackInput>();
-
-    /**
-     * The JAR and PACK files to create, by output name.
+     * The directory of input JAR files. Shall be {@code "target/binaries"}.
      */
-    private final Map<String,PackOutput> outputs = new LinkedHashMap<String,PackOutput>();
-
-    /**
-     * The version to declare in the manifest file.
-     */
-    final String version;
+    private final File binariesDirectory;
 
     /**
      * Creates a packer.
      *
-     * @param targetDirectory The Maven target directory.
-     * @param version The version to declare in the manifest file.
+     * @param  projectName     The project name to declare in the manifest file, or {@code null} if none.
+     * @param  projectURL      The project URL to declare in the manifest file, or {@code null} if none.
+     * @param  version         The project version to declare in the manifest file, or {@code null} if none.
+     * @param  targetDirectory The Maven target directory.
+     * @throws FileNotFoundException if the {@code target/binaries} directory is not found.
      */
-    Packer(final File targetDirectory, final String version) throws FileNotFoundException {
-        this.version = version;
+    Packer(final String projectName, final String projectURL, final String version,
+           final File targetDirectory) throws FileNotFoundException
+    {
+        this.projectName = projectName;
+        this.projectURL  = projectURL;
+        this.version     = version;
         this.targetDirectory = targetDirectory;
-        this.jarDirectory = new File(targetDirectory, JarCollector.SUB_DIRECTORY);
-        if (!jarDirectory.isDirectory()) {
-            throw new FileNotFoundException("Directory not found: " + jarDirectory);
+        this.binariesDirectory = new File(targetDirectory, BINARIES_DIRECTORY);
+        if (!binariesDirectory.isDirectory()) {
+            throw new FileNotFoundException("Directory not found: " + binariesDirectory);
         }
     }
 
     /**
-     * Adds a pack which will contain every JAR files in the target directory.
-     * The given {@code pack} name is the name of the JAR file to create before to be packed.
-     * This filename shall ends with the "{@code .jar}" suffix. That suffix will be replaced
-     * by {@code ".pack.gz"} at Pack200 creation time.
+     * Filter the input JAR files. This is for internal usage by {@link #createOutputJAR(String)} only.
      *
-     * @param  pack The name of the JAR file to create before the Pack200 creation.
-     * @throws IOException If an error occurred while collecting the target directory content.
+     * @param  directory The directory (ignored).
+     * @param  name The filename.
+     * @return {@code true} if the given filename ends with {@code ".jar"}.
      */
-    public void addPack(final String pack) throws IOException {
-        final Set<String> list = JarCollector.loadDependencyList(new File(jarDirectory, JarCollector.CONTENT_FILE));
-        list.addAll(Arrays.asList(jarDirectory.list(this)));
-        addPack(null, pack, list.toArray(new String[list.size()]));
+    @Override
+    public boolean accept(final File directory, final String name) {
+        return name.endsWith(".jar");
     }
 
     /**
-     * Adds the given JAR files for the given pack. This method can be invoked when we want to
-     * create a Pack200 file containing only a subset of all available JAR files, or when some
-     * JAR files to include are specified by a previously created Pack200 file.
-     *
-     * <p>The filenames in the given {@code jars} array can contains the {@code '*'} wildcards.
-     * However at most one entry can match, otherwise an exception will be thrown. This limited
-     * wildcards support is mostly a convenience for avoiding to specify the version number of
-     * JAR files.</p>
-     *
-     * @param  parent The pack from which to inherit the JAR files, or {@code null} if none.
-     * @param  pack   The name of the JAR file to create before the Pack200 creation.
-     * @param  jars   The list of JAR files in this pack file. Filenames can contain the {@code '*'} wildcards.
-     * @throws IOException If an error occurred while collecting the target directory content.
+     * Returns the list of input JAR files, together with a helper class for copying the data in the Pack200 file.
+     * All input JAR files are opened by this method. They will need to be closed by {@link PackInput#close()}.
      */
-    public void addPack(final String parent, final String pack, final String[] jars) throws IOException {
-        PackOutput p = null;
-        if (parent != null) {
-            p = outputs.get(parent);
-            if (p == null) {
-                throw new IllegalArgumentException("Non-existant pack: " + parent);
+    private Map<File,PackInput> getInputJARs() throws IOException {
+        final Set<String> filenames = JarCollector.loadDependencyList(new File(binariesDirectory, CONTENT_FILE));
+        filenames.addAll(Arrays.asList(binariesDirectory.list(this)));
+        final Map<File,PackInput> inputJARs = new LinkedHashMap<File,PackInput>(filenames.size() * 4/3);
+        for (final String filename : filenames) {
+            File file = new File(filename);
+            if (!file.isAbsolute()) {
+                file = new File(binariesDirectory, filename);
             }
-        }
-        /*
-         * If there is wildcard, replace the wildcard by the full name.
-         * We allows only one name (the wildcard should be used for the
-         * version number only, and we don't allow many versions of the
-         * same file).
-         */
-        for (int i=0; i<jars.length; i++) {
-            final String jarFile = jars[i];
-            final int w = jarFile.lastIndexOf('*');
-            if (w >= 0) {
-                final String prefix = jarFile.substring(0, w);
-                final String suffix = jarFile.substring(w+1);
-                final String[] f = jarDirectory.list(new FilenameFilter() {
-                    @Override public boolean accept(final File directory, final String name) {
-                        return name.startsWith(prefix) && name.endsWith(suffix);
-                    }
-                });
-                if (f == null) {
-                    throw new FileNotFoundException("Directory not found: " + jarDirectory);
-                }
-                switch (f.length) {
-                    case 1:  jars[i] = f[0]; break;
-                    case 0:  throw new IllegalArgumentException("No file found for pattern: " + jarFile);
-                    default: throw new IllegalArgumentException("Duplicated files: " + f[0] + " and " + f[1]);
-                }
+            if (!file.isFile() || !file.canRead()) {
+                throw new IllegalArgumentException("Not a file or can not read: " + file);
+            }
+            if (inputJARs.put(file, new PackInput(file)) != null) {
+                throw new IllegalArgumentException("Duplicated JAR: " + file);
             }
         }
-        p = new PackOutput(this, p, jars);
-        if (outputs.put(pack, p) != null) {
-            throw new IllegalArgumentException("Duplicated pack: " + pack);
-        }
+        return inputJARs;
     }
 
     /**
-     * Creates the JAR files from the packages declared with {@link #addPack}.
+     * Prepares the Pack 200 file which will contain every JAR files in the {@code target/binaries} directory.
+     * The given {@code outputJAR} name is the name of the JAR file to create before to be packed.
+     * This filename shall end with the "{@code .jar}" suffix.
+     *
+     * <p>Callers needs to invoke one of the {@code PackOutput.pack(…)} methods on the returned object.</p>
      *
-     * @throws IOException if an error occurred while reading existing JAR files
-     *         or writing to the packed files.
+     * @param  outputJAR The name of the JAR file to create before the Pack200 creation.
+     * @throws IOException If an error occurred while collecting the target directory content.
      */
-    public void createJars() throws IOException {
+    PackOutput preparePack200(final String outputJAR) throws IOException {
         /*
          * Creates the output directory. We do that first in order to avoid the
          * costly opening of all JAR files if we can't create this directory.
          */
-        final File outDirectory = new File(targetDirectory, PACK_DIRECTORY);
-        if (!outDirectory.isDirectory()) {
-            if (!outDirectory.mkdir()) {
-                throw new IOException("Can't create the \"" + PACK_DIRECTORY + "\" directory.");
-            }
-        }
-        /*
-         * Opens all input JAR files in read-only mode, and create the initially empty output JAR
-         * file. We need to open all input files in order to check for duplicate entries before we
-         * start the writing process. Files in the META-INF/services directory need to be merged.
-         */
-        for (final Map.Entry<String,PackOutput> entry : outputs.entrySet()) {
-            final String name = entry.getKey();
-            final PackOutput pack = entry.getValue();
-            pack.createPackInputs(inputs);
-            pack.open(new File(outDirectory, name));
-        }
-        /*
-         * Iterates through the individual jars and merge them in single, bigger JAR file.
-         * During each iteration we get the array of output streams where a particular file
-         * need to be copied - all those "active" output streams will be filled in parallel.
-         */
-        final byte[] buffer = new byte[64*1024];
-        final Map<File,PackInput> activeInputs = new LinkedHashMap<File,PackInput>(inputs.size() * 4/3);
-        final PackOutput[] activesForFile      = new PackOutput[outputs.size()];
-        final PackOutput[] activesForEntry     = new PackOutput[activesForFile.length];
-        final PackOutput[] activesForFollow    = new PackOutput[activesForFile.length];
-        for (final Iterator<Map.Entry<File,PackInput>> it = inputs.entrySet().iterator(); it.hasNext();) {
-            final Map.Entry<File,PackInput> fileInputPair = it.next();
-            final File  inputFile = fileInputPair.getKey();
-            final PackInput input = fileInputPair.getValue();
-            try {
-                it.remove(); // Needs to be before next usage of "inputs" below.
-                int countForFile = 0;
-                for (final PackOutput candidate : outputs.values()) {
-                    if (candidate.contains(inputFile)) {
-                        activesForFile[countForFile++] = candidate;
-                        candidate.copyInputs(inputs, activeInputs);
-                    }
-                }
-                /*
-                 * "activesForFile" now contains the list of PackOutput we need to care about
-                 * for the current PackInput (i.e. a whole input JAR). Copies every entries
-                 * found in that JAR.
-                 */
-                for (JarEntry entry; (entry = input.nextEntry()) != null;) {
-                    int countForEntry = 0;
-                    for (int i=0; i<countForFile; i++) {
-                        final PackOutput candidate = activesForFile[i];
-                        if (candidate.putNextEntry(entry)) {
-                            activesForEntry[countForEntry++] = candidate;
-                        }
-                    }
-                    copy(input.getInputStream(), activesForEntry, countForEntry, buffer);
-                    /*
-                     * From that points, the entry has been copied to all target JARs. Now looks in
-                     * following input JARs to see if there is some META-INF/services files to merge.
-                     */
-                    final String name = entry.getName();
-                    if (PackOutput.mergeAllowed(name)) {
-                        for (final Map.Entry<File,PackInput> continuing : activeInputs.entrySet()) {
-                            final InputStream in = continuing.getValue().getInputStream(name);
-                            if (in != null) {
-                                final File file = continuing.getKey();
-                                int countForFollow = 0;
-                                for (int i=0; i<countForEntry; i++) {
-                                    final PackOutput candidate = activesForEntry[i];
-                                    if (candidate.contains(file)) {
-                                        activesForFollow[countForFollow++] = candidate;
-                                    }
-                                }
-                                copy(in, activesForFollow, countForFollow, buffer);
-                                Arrays.fill(activesForFollow, null);
-                            }
-                        }
-                    }
-                    for (int i=0; i<countForEntry; i++) {
-                        activesForEntry[i].closeEntry();
-                    }
-                    Arrays.fill(activesForEntry, null);
-                }
-                Arrays.fill(activesForFile, null);
-                activeInputs.clear();
-            } finally {
-                input.close();
-            }
-        }
-        close();
-    }
-
-    /**
-     * Copies fully the given input stream to the given destination.
-     * The given input stream is closed after the copy.
-     *
-     * @param  in     The input stream from which to get the the content to copy.
-     * @param  out    Where to copy the input stream content.
-     * @param  count  Number of valid entries in the {@code out} array.
-     * @param  buffer Temporary buffer to reuse at each method call.
-     * @throws IOException If an error occurred during the copy.
-     */
-    private static void copy(final InputStream in, final PackOutput[] out, final int count,
-                             final byte[] buffer) throws IOException
-    {
-        int n;
-        while ((n = in.read(buffer)) >= 0) {
-            for (int i=0; i<count; i++) {
-                out[i].write(buffer, n);
-            }
-        }
-        in.close();
-    }
-
-    /**
-     * Closes all streams.
-     *
-     * @throws IOException If an error occurred while closing the stream.
-     */
-    public void close() throws IOException {
-        for (final PackOutput jar : outputs.values()) {
-            jar.close();
-        }
-        for (final PackInput jar : inputs.values()) {
-            jar.close();
+        final File outDirectory = distributionDirectory(targetDirectory);
+        final PackOutput output = new PackOutput(getInputJARs(), new File(outDirectory, outputJAR));
+        try {
+            output.open(projectName, projectURL, version);
+            output.writeContent();
+        } finally {
+            output.close();
         }
-    }
-
-    /**
-     * Launch Pack200 after output JAR files have been created.
-     *
-     * @throws IOException If an error occurred while creating the PACK200 file.
-     */
-    public void pack() throws IOException {
-        for (final PackOutput jar : outputs.values()) {
-            jar.pack();
-        }
-    }
-
-    /**
-     * Filter the JAR files.
-     *
-     * @param  directory The directory (ignored).
-     * @param  name The filename.
-     * @return {@code true} if the given filename ends with {@code ".jar"}.
-     */
-    @Override
-    public boolean accept(final File directory, final String name) {
-        return name.endsWith(".jar");
+        return output;
     }
 }

Modified: sis/branches/Shapefile/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Module.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Module.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Module.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Module.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -19,8 +19,6 @@ package org.apache.sis.internal.taglet;
 import java.io.File;
 import java.util.Map;
 import com.sun.javadoc.Tag;
-import com.sun.javadoc.Doc;
-import com.sun.javadoc.ClassDoc;
 import com.sun.tools.doclets.Taglet;
 
 
@@ -34,11 +32,6 @@ import com.sun.tools.doclets.Taglet;
  */
 public final class Module implements Taglet {
     /**
-     * SIS version to be referenced by this taglet.
-     */
-    private static final String VERSION = "0.3-geoapi3.0-SNAPSHOT";
-
-    /**
      * Register this taglet.
      *
      * @param tagletMap the map to register this tag to.
@@ -54,13 +47,6 @@ public final class Module implements Tag
     private static final String MAVEN_REPORTS_BASE_URL = WebSite.URL + '/';
 
     /**
-     * The base URL for Maven repository, with a trailing slash.
-     * See <a href="http://www.apache.org/dev/repository-faq.html">ASF Jar Repositories</a>
-     * for more information.
-     */
-    private static final String MAVEN_REPOSITORY_BASE_URL = "http://repository.apache.org/snapshots/";
-
-    /**
      * The SIS module in which the <code>@module</code> taglet has been found.
      */
     private String module;
@@ -198,29 +184,6 @@ public final class Module implements Tag
              */
             buffer.append("Defined in the <a href=\"").append(MAVEN_REPORTS_BASE_URL).append(module)
                   .append("/index.html\">").append(module).append("</a> module");
-            /*
-             * Appends the "(download binary)" link.
-             */
-            buffer.append("\n<font size=\"-2\">(<a href=\"").append(MAVEN_REPOSITORY_BASE_URL)
-                  .append("org/apache/sis/").append(module).append('/').append(VERSION).append('/')
-                  .append("\">download</a>)</font>");
-            /*
-             * Appends the "View source code for this class" link.
-             */
-            final Doc holder = tag.holder();
-            if (holder instanceof ClassDoc) {
-                ClassDoc outer, doc = (ClassDoc) holder;
-                while ((outer = doc.containingClass()) != null) {
-                    doc = outer;
-                }
-                final String className = doc.qualifiedName();
-                buffer.append("<br><a href=\"");
-                for (int j=className.indexOf('.'); j>=0; j=className.indexOf('.', j+1)) {
-                    buffer.append("../");
-                }
-                buffer.append("../xref/").append(className.replace('.', '/'))
-                      .append(".html\">View source code for this class</a>");
-            }
         }
         return buffer.append("</font></p>\n").toString();
     }

Modified: sis/branches/Shapefile/core/sis-build-helper/src/main/javadoc/overview.html
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-build-helper/src/main/javadoc/overview.html?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-build-helper/src/main/javadoc/overview.html (original)
+++ sis/branches/Shapefile/core/sis-build-helper/src/main/javadoc/overview.html Sun Aug 25 15:49:51 2013
@@ -1,4 +1,24 @@
 <!DOCTYPE html>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
 <html>
   <head>
     <title>API Overview</title>

Modified: sis/branches/Shapefile/core/sis-build-helper/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-build-helper/src/site/apt/index.apt?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-build-helper/src/site/apt/index.apt [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-build-helper/src/site/apt/index.apt [UTF-8] Sun Aug 25 15:49:51 2013
@@ -1,3 +1,22 @@
+~~
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements.  See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership.  The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License.  You may obtain a copy of the License at
+~~
+~~   http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied.  See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+~~
+
                              ------------------------------
                                         Overview
                              ------------------------------
@@ -10,13 +29,7 @@ Building Apache SIS
 
   Content:
 
-  * Javadoc taglets
-
-  * Localized resources compiler
-
-  * JAR files collector
-
-  * Pack200 bundles
+%{toc|fromDepth=2|toDepth=2}
 
 
 * Javadoc taglets
@@ -26,21 +39,24 @@ Building Apache SIS
 *----------------------+-------------------------------------------------------------------------------------------+
 || Javadoc tag         || Description                                                                             ||
 *----------------------+-------------------------------------------------------------------------------------------+
-| <<<@module>>>        | Create links to the module where the class is defined, source code and Maven artifacts.   |
-*----------------------+-------------------------------------------------------------------------------------------+
-| <<<\{@website\}>>>   | An inline taglet for the URL to the Apache SIS web site (Maven reports).                  |
+| <<<\{@example\}>>>   | An inline taglet for an example.                                                          |
+|                      | Examples appear as indented paragraphs with a smaller font.                               |
 *----------------------+-------------------------------------------------------------------------------------------+
-| <<<\{@section\}>>>   | An inline taglet for the title of a new section in the javadoc.                           |
+| <<<@module>>>        | Create links to the module where the class is defined, source code and Maven artifacts.   |
 *----------------------+-------------------------------------------------------------------------------------------+
 | <<<\{@note\}>>>      | An inline taglet for a remark that readers can safely ignore.                             |
 |                      | Notes appear as indented paragraphs with a smaller font.                                  |
 *----------------------+-------------------------------------------------------------------------------------------+
-| <<<\{@example\}>>>   | An inline taglet for an example.                                                          |
-|                      | Examples appear as indented paragraphs with a smaller font.                               |
-*----------------------+-------------------------------------------------------------------------------------------+
 | <<<\{@preformat\}>>> | An inline taglet for pre-formatted text. The first word inside the taglet shall be one of |
 |                      | <<<java>>>, <<<xml>>>, <<<sql>>>, <<<wkt>>>, <<<text>>>, <<<math>>> or <<<shell>>>.       |
 *----------------------+-------------------------------------------------------------------------------------------+
+| <<<\{@scmUrl\}>>>    | An inline taglet for a URL to the source code repository. The only word inside the taglet |
+|                      | shall be <<<gmd-data>>>.                                                                  |
+*----------------------+-------------------------------------------------------------------------------------------+
+| <<<\{@section\}>>>   | An inline taglet for the title of a new section in the javadoc.                           |
+*----------------------+-------------------------------------------------------------------------------------------+
+| <<<\{@website\}>>>   | An inline taglet for the URL to the Apache SIS web site (Maven reports).                  |
+*----------------------+-------------------------------------------------------------------------------------------+
 
 
 * Localized resources compiler
@@ -69,7 +85,7 @@ Building Apache SIS
 <build>
   <plugins>
     <plugin>
-      <groupId>org.apache.sis</groupId>
+      <groupId>org.apache.sis.core</groupId>
       <artifactId>sis-build-helper</artifactId>
       <version>${sis.plugin.version}</version>
       <executions>
@@ -89,9 +105,9 @@ Building Apache SIS
   in the module containing the resources to recompile. This is sometime useful for regenerating
   the constants in the <<<Keys>>> inner class in a feaster way than building the project.
 
------------------------------------------------------------
-   mvn org.apache.sis:sis-build-helper:compile-resources
------------------------------------------------------------
+----------------------------------------------------------------
+   mvn org.apache.sis.core:sis-build-helper:compile-resources
+----------------------------------------------------------------
 
 
 * JAR files collector
@@ -107,7 +123,7 @@ Building Apache SIS
     so execution of this plugin should be very cheap and consume few disk space.
 
   * Dependencies already present in the <<<target/binaries>>> directory are presumed stables and
-    are not overwritten. Only artefacts produced by the Maven build are unconditionally overwritten.
+    are not overwritten. Only artifacts produced by the Maven build are unconditionally overwritten.
 
   This plugin can be activated by the following fragment in the parent <<<pom.xml>>> file:
 
@@ -115,7 +131,7 @@ Building Apache SIS
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.sis</groupId>
+        <groupId>org.apache.sis.core</groupId>
         <artifactId>sis-build-helper</artifactId>
         <version>${sis.plugin.version}</version>
         <executions>
@@ -131,15 +147,15 @@ Building Apache SIS
 +-----------------------------------------------------
 
 
-* Pack200 bundles
+* Pack200 bundle
 
   To merges the binaries produced by the above step and compress them using Pack200,
   invoke the following from the command line. Do not forget the <<<--non-recursive>>>
   option, otherwise the Mojo will waste CPU by executing itself many time.
 
-----------------------------------------------------------------
-   mvn org.apache.sis:sis-build-helper:pack --non-recursive
-----------------------------------------------------------------
+-------------------------------------------------------------------
+   mvn org.apache.sis.core:sis-build-helper:pack --non-recursive
+-------------------------------------------------------------------
 
   The above command should create a <<<target/binaries/sis-\<version\>.pack.gz>>> file.
   To uncompress that file, use the following command:
@@ -147,3 +163,17 @@ Building Apache SIS
 ----------------------------------------------------------------
    unpack200 --remove-pack-file sis-<version>.pack.gz sis.jar
 ----------------------------------------------------------------
+
+  The Pack200 bundle does not include the <<<sis-webapp>>> module because the later can be downloaded
+  as a <<<WAR>>> file from the Maven repository.
+
+
+* Distribution file
+
+  The distribution file is a ZIP file containing the same Pack200 bundle than above,
+  together with a <<<README>>> file, configuration files and convenience shell scripts.
+  The distribution file is generated as below:
+
+-------------------------------------------------------------------
+   mvn org.apache.sis.core:sis-build-helper:dist --non-recursive
+-------------------------------------------------------------------

Propchange: sis/branches/Shapefile/core/sis-feature/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Aug 25 15:49:51 2013
@@ -0,0 +1,10 @@
+.project
+.settings
+.classpath
+.jetproperties
+.wtpmodules
+target
+bin
+cobertura.ser
+nbproject
+nbactions.xml

Modified: sis/branches/Shapefile/core/sis-metadata/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/pom.xml?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/pom.xml (original)
+++ sis/branches/Shapefile/core/sis-metadata/pom.xml Sun Aug 25 15:49:51 2013
@@ -28,13 +28,14 @@
   <parent>
     <groupId>org.apache.sis</groupId>
     <artifactId>core</artifactId>
-    <version>0.3-geoapi3.0-SNAPSHOT</version>
+    <version>0.4-SNAPSHOT</version>
   </parent>
 
 
   <!-- ===========================================================
            Module Description
        =========================================================== -->
+  <groupId>org.apache.sis.core</groupId>
   <artifactId>sis-metadata</artifactId>
   <packaging>bundle</packaging>
   <name>Apache SIS metadata</name>
@@ -110,7 +111,7 @@ Implementations of metadata derived from
 
       <!-- Collect JAR files in <root>/target/binaries directory. -->
       <plugin>
-        <groupId>org.apache.sis</groupId>
+        <groupId>org.apache.sis.core</groupId>
         <artifactId>sis-build-helper</artifactId>
         <version>${sis.plugin.version}</version>
         <executions>
@@ -141,7 +142,7 @@ Implementations of metadata derived from
        =========================================================== -->
   <dependencies>
     <dependency>
-      <groupId>org.apache.sis</groupId>
+      <groupId>org.apache.sis.core</groupId>
       <artifactId>sis-utility</artifactId>
       <version>${project.version}</version>
     </dependency>
@@ -149,14 +150,14 @@ Implementations of metadata derived from
       <groupId>org.opengis</groupId>
       <artifactId>geoapi</artifactId>
     </dependency>
+
+    <!-- Test dependencies -->
     <dependency>
       <groupId>org.opengis</groupId>
       <artifactId>geoapi-conformance</artifactId>
     </dependency>
-
-    <!-- Test dependencies -->
     <dependency>
-      <groupId>org.apache.sis</groupId>
+      <groupId>org.apache.sis.core</groupId>
       <artifactId>sis-utility</artifactId>
       <version>${project.version}</version>
       <type>test-jar</type>

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/CI_DateTypeCode.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/CI_DateTypeCode.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/CI_DateTypeCode.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/CI_DateTypeCode.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -16,10 +16,10 @@
  */
 package org.apache.sis.internal.jaxb.code;
 
-import org.apache.sis.internal.jaxb.gmd.CodeListAdapter;
-import org.apache.sis.internal.jaxb.gmd.CodeListProxy;
 import javax.xml.bind.annotation.XmlElement;
 import org.opengis.metadata.citation.DateType;
+import org.apache.sis.internal.jaxb.gmd.CodeListAdapter;
+import org.apache.sis.internal.jaxb.gmd.CodeListProxy;
 
 
 /**
@@ -34,13 +34,6 @@ import org.opengis.metadata.citation.Dat
  */
 public final class CI_DateTypeCode extends CodeListAdapter<CI_DateTypeCode, DateType> {
     /**
-     * Ensures that the adapted code list class is loaded.
-     */
-    static {
-        ensureClassLoaded(DateType.class);
-    }
-
-    /**
      * Empty constructor for JAXB only.
      */
     public CI_DateTypeCode() {

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/CI_OnLineFunctionCode.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/CI_OnLineFunctionCode.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/CI_OnLineFunctionCode.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/CI_OnLineFunctionCode.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -16,10 +16,10 @@
  */
 package org.apache.sis.internal.jaxb.code;
 
-import org.apache.sis.internal.jaxb.gmd.CodeListAdapter;
-import org.apache.sis.internal.jaxb.gmd.CodeListProxy;
 import javax.xml.bind.annotation.XmlElement;
 import org.opengis.metadata.citation.OnLineFunction;
+import org.apache.sis.internal.jaxb.gmd.CodeListAdapter;
+import org.apache.sis.internal.jaxb.gmd.CodeListProxy;
 
 
 /**
@@ -36,13 +36,6 @@ public final class CI_OnLineFunctionCode
         extends CodeListAdapter<CI_OnLineFunctionCode, OnLineFunction>
 {
     /**
-     * Ensures that the adapted code list class is loaded.
-     */
-    static {
-        ensureClassLoaded(OnLineFunction.class);
-    }
-
-    /**
      * Empty constructor for JAXB only.
      */
     public CI_OnLineFunctionCode() {

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/CI_PresentationFormCode.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/CI_PresentationFormCode.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/CI_PresentationFormCode.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/CI_PresentationFormCode.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -16,10 +16,10 @@
  */
 package org.apache.sis.internal.jaxb.code;
 
-import org.apache.sis.internal.jaxb.gmd.CodeListAdapter;
-import org.apache.sis.internal.jaxb.gmd.CodeListProxy;
 import javax.xml.bind.annotation.XmlElement;
 import org.opengis.metadata.citation.PresentationForm;
+import org.apache.sis.internal.jaxb.gmd.CodeListAdapter;
+import org.apache.sis.internal.jaxb.gmd.CodeListProxy;
 
 
 /**
@@ -36,13 +36,6 @@ public final class CI_PresentationFormCo
         extends CodeListAdapter<CI_PresentationFormCode, PresentationForm>
 {
     /**
-     * Ensures that the adapted code list class is loaded.
-     */
-    static {
-        ensureClassLoaded(PresentationForm.class);
-    }
-
-    /**
      * Empty constructor for JAXB only.
      */
     public CI_PresentationFormCode() {

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/CI_RoleCode.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/CI_RoleCode.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/CI_RoleCode.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/CI_RoleCode.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -16,10 +16,10 @@
  */
 package org.apache.sis.internal.jaxb.code;
 
-import org.apache.sis.internal.jaxb.gmd.CodeListAdapter;
-import org.apache.sis.internal.jaxb.gmd.CodeListProxy;
 import javax.xml.bind.annotation.XmlElement;
 import org.opengis.metadata.citation.Role;
+import org.apache.sis.internal.jaxb.gmd.CodeListAdapter;
+import org.apache.sis.internal.jaxb.gmd.CodeListProxy;
 
 
 /**
@@ -34,13 +34,6 @@ import org.opengis.metadata.citation.Rol
  */
 public final class CI_RoleCode extends CodeListAdapter<CI_RoleCode, Role> {
     /**
-     * Ensures that the adapted code list class is loaded.
-     */
-    static {
-        ensureClassLoaded(Role.class);
-    }
-
-    /**
      * Empty constructor for JAXB only.
      */
     public CI_RoleCode() {

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/DQ_EvaluationMethodTypeCode.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/DQ_EvaluationMethodTypeCode.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/DQ_EvaluationMethodTypeCode.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/DQ_EvaluationMethodTypeCode.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -16,10 +16,10 @@
  */
 package org.apache.sis.internal.jaxb.code;
 
-import org.apache.sis.internal.jaxb.gmd.CodeListAdapter;
-import org.apache.sis.internal.jaxb.gmd.CodeListProxy;
 import javax.xml.bind.annotation.XmlElement;
 import org.opengis.metadata.quality.EvaluationMethodType;
+import org.apache.sis.internal.jaxb.gmd.CodeListAdapter;
+import org.apache.sis.internal.jaxb.gmd.CodeListProxy;
 
 
 /**
@@ -36,13 +36,6 @@ public final class DQ_EvaluationMethodTy
         extends CodeListAdapter<DQ_EvaluationMethodTypeCode, EvaluationMethodType>
 {
     /**
-     * Ensures that the adapted code list class is loaded.
-     */
-    static {
-        ensureClassLoaded(EvaluationMethodType.class);
-    }
-
-    /**
      * Empty constructor for JAXB only.
      */
     public DQ_EvaluationMethodTypeCode() {

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/DS_AssociationTypeCode.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/DS_AssociationTypeCode.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/DS_AssociationTypeCode.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/DS_AssociationTypeCode.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -16,10 +16,10 @@
  */
 package org.apache.sis.internal.jaxb.code;
 
-import org.apache.sis.internal.jaxb.gmd.CodeListAdapter;
-import org.apache.sis.internal.jaxb.gmd.CodeListProxy;
 import javax.xml.bind.annotation.XmlElement;
 import org.opengis.metadata.identification.AssociationType;
+import org.apache.sis.internal.jaxb.gmd.CodeListAdapter;
+import org.apache.sis.internal.jaxb.gmd.CodeListProxy;
 
 
 /**
@@ -34,13 +34,6 @@ import org.opengis.metadata.identificati
  */
 public final class DS_AssociationTypeCode extends CodeListAdapter<DS_AssociationTypeCode, AssociationType> {
     /**
-     * Ensures that the adapted code list class is loaded.
-     */
-    static {
-        ensureClassLoaded(AssociationType.class);
-    }
-
-    /**
      * Empty constructor for JAXB only.
      */
     public DS_AssociationTypeCode() {

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/DS_InitiativeTypeCode.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/DS_InitiativeTypeCode.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/DS_InitiativeTypeCode.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/DS_InitiativeTypeCode.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -16,10 +16,10 @@
  */
 package org.apache.sis.internal.jaxb.code;
 
-import org.apache.sis.internal.jaxb.gmd.CodeListAdapter;
-import org.apache.sis.internal.jaxb.gmd.CodeListProxy;
 import javax.xml.bind.annotation.XmlElement;
 import org.opengis.metadata.identification.InitiativeType;
+import org.apache.sis.internal.jaxb.gmd.CodeListAdapter;
+import org.apache.sis.internal.jaxb.gmd.CodeListProxy;
 
 
 /**
@@ -34,13 +34,6 @@ import org.opengis.metadata.identificati
  */
 public final class DS_InitiativeTypeCode extends CodeListAdapter<DS_InitiativeTypeCode, InitiativeType> {
     /**
-     * Ensures that the adapted code list class is loaded.
-     */
-    static {
-        ensureClassLoaded(InitiativeType.class);
-    }
-
-    /**
      * Empty constructor for JAXB only.
      */
     public DS_InitiativeTypeCode() {

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_CellGeometryCode.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_CellGeometryCode.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_CellGeometryCode.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_CellGeometryCode.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -16,10 +16,10 @@
  */
 package org.apache.sis.internal.jaxb.code;
 
-import org.apache.sis.internal.jaxb.gmd.CodeListAdapter;
-import org.apache.sis.internal.jaxb.gmd.CodeListProxy;
 import javax.xml.bind.annotation.XmlElement;
 import org.opengis.metadata.spatial.CellGeometry;
+import org.apache.sis.internal.jaxb.gmd.CodeListAdapter;
+import org.apache.sis.internal.jaxb.gmd.CodeListProxy;
 
 
 /**
@@ -34,13 +34,6 @@ import org.opengis.metadata.spatial.Cell
  */
 public final class MD_CellGeometryCode extends CodeListAdapter<MD_CellGeometryCode, CellGeometry> {
     /**
-     * Ensures that the adapted code list class is loaded.
-     */
-    static {
-        ensureClassLoaded(CellGeometry.class);
-    }
-
-    /**
      * Empty constructor for JAXB only.
      */
     public MD_CellGeometryCode() {

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_CharacterSetCode.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_CharacterSetCode.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_CharacterSetCode.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_CharacterSetCode.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -16,10 +16,10 @@
  */
 package org.apache.sis.internal.jaxb.code;
 
-import org.apache.sis.internal.jaxb.gmd.CodeListAdapter;
-import org.apache.sis.internal.jaxb.gmd.CodeListProxy;
 import javax.xml.bind.annotation.XmlElement;
 import org.opengis.metadata.identification.CharacterSet;
+import org.apache.sis.internal.jaxb.gmd.CodeListAdapter;
+import org.apache.sis.internal.jaxb.gmd.CodeListProxy;
 
 
 /**
@@ -34,13 +34,6 @@ import org.opengis.metadata.identificati
  */
 public final class MD_CharacterSetCode extends CodeListAdapter<MD_CharacterSetCode, CharacterSet> {
     /**
-     * Ensures that the adapted code list class is loaded.
-     */
-    static {
-        ensureClassLoaded(CharacterSet.class);
-    }
-
-    /**
      * Empty constructor for JAXB only.
      */
     public MD_CharacterSetCode() {

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_ClassificationCode.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_ClassificationCode.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_ClassificationCode.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_ClassificationCode.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -16,10 +16,10 @@
  */
 package org.apache.sis.internal.jaxb.code;
 
-import org.apache.sis.internal.jaxb.gmd.CodeListAdapter;
-import org.apache.sis.internal.jaxb.gmd.CodeListProxy;
 import javax.xml.bind.annotation.XmlElement;
 import org.opengis.metadata.constraint.Classification;
+import org.apache.sis.internal.jaxb.gmd.CodeListAdapter;
+import org.apache.sis.internal.jaxb.gmd.CodeListProxy;
 
 
 /**
@@ -34,13 +34,6 @@ import org.opengis.metadata.constraint.C
  */
 public final class MD_ClassificationCode extends CodeListAdapter<MD_ClassificationCode, Classification> {
     /**
-     * Ensures that the adapted code list class is loaded.
-     */
-    static {
-        ensureClassLoaded(Classification.class);
-    }
-
-    /**
      * Empty constructor for JAXB only.
      */
     public MD_ClassificationCode() {

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_CoverageContentTypeCode.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_CoverageContentTypeCode.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_CoverageContentTypeCode.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_CoverageContentTypeCode.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -16,10 +16,10 @@
  */
 package org.apache.sis.internal.jaxb.code;
 
-import org.apache.sis.internal.jaxb.gmd.CodeListAdapter;
-import org.apache.sis.internal.jaxb.gmd.CodeListProxy;
 import javax.xml.bind.annotation.XmlElement;
 import org.opengis.metadata.content.CoverageContentType;
+import org.apache.sis.internal.jaxb.gmd.CodeListAdapter;
+import org.apache.sis.internal.jaxb.gmd.CodeListProxy;
 
 
 /**
@@ -36,13 +36,6 @@ public final class MD_CoverageContentTyp
         extends CodeListAdapter<MD_CoverageContentTypeCode, CoverageContentType>
 {
     /**
-     * Ensures that the adapted code list class is loaded.
-     */
-    static {
-        ensureClassLoaded(CoverageContentType.class);
-    }
-
-    /**
      * Empty constructor for JAXB only.
      */
     public MD_CoverageContentTypeCode() {



Mime
View raw message