Return-Path: X-Original-To: apmail-geronimo-scm-archive@www.apache.org Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E5FF29676 for ; Fri, 18 May 2012 03:05:13 +0000 (UTC) Received: (qmail 17636 invoked by uid 500); 18 May 2012 03:05:13 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 17375 invoked by uid 500); 18 May 2012 03:05:07 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 17348 invoked by uid 99); 18 May 2012 03:05:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 May 2012 03:05:06 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 May 2012 03:05:02 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id BB6872388847; Fri, 18 May 2012 03:04:40 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1339960 - in /geronimo/bundles/trunk/axis2: pom.xml src/main/java/org/apache/axis2/description/Version.java Date: Fri, 18 May 2012 03:04:40 -0000 To: scm@geronimo.apache.org From: xuhaihong@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120518030440.BB6872388847@eris.apache.org> Author: xuhaihong Date: Fri May 18 03:04:39 2012 New Revision: 1339960 URL: http://svn.apache.org/viewvc?rev=1339960&view=rev Log: GERONIMO-6349 Follow Axis2 version convention in Geronimo Axis2 bundle Added: geronimo/bundles/trunk/axis2/src/main/java/org/apache/axis2/description/Version.java (with props) Modified: geronimo/bundles/trunk/axis2/pom.xml Modified: geronimo/bundles/trunk/axis2/pom.xml URL: http://svn.apache.org/viewvc/geronimo/bundles/trunk/axis2/pom.xml?rev=1339960&r1=1339959&r2=1339960&view=diff ============================================================================== --- geronimo/bundles/trunk/axis2/pom.xml (original) +++ geronimo/bundles/trunk/axis2/pom.xml Fri May 18 03:04:39 2012 @@ -310,11 +310,16 @@ org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl$5.class=target/classes/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl$5.class, org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl$6.class=target/classes/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl$6.class, org/apache/axis2/transport/http/AbstractHTTPSender.class=target/classes/org/apache/axis2/transport/http/AbstractHTTPSender.class, + + org/apache/axis2/transport/http/HTTPSender.class=target/classes/org/apache/axis2/transport/http/HTTPSender.class, + + org/apache/axis2/client/OperationClient.class=target/classes/org/apache/axis2/client/OperationClient.class, org/apache/axis2/jaxws/description/impl/PostRI216MethodRetrieverImpl.class=target/classes/org/apache/axis2/jaxws/description/impl/PostRI216MethodRetrieverImpl.class, org/apache/axis2/jaxws/client/dispatch/BaseDispatch.class=target/classes/org/apache/axis2/jaxws/client/dispatch/BaseDispatch.class, + org/apache/axis2/jaxws/message/Block.class=target/classes/org/apache/axis2/jaxws/message/Block.class, org/apache/axis2/jaxws/message/databinding/impl/XMLStringBlockImpl.class=target/classes/org/apache/axis2/jaxws/message/databinding/impl/XMLStringBlockImpl.class, org/apache/axis2/jaxws/message/databinding/impl/SourceBlockImpl.class=target/classes/org/apache/axis2/jaxws/message/databinding/impl/SourceBlockImpl.class, @@ -329,6 +334,7 @@ org/apache/axis2/jaxws/message/impl/XMLSpineImpl.class=target/classes/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.class, org/apache/axis2/jaxws/server/dispatcher/ProviderDispatcher.class=target/classes/org/apache/axis2/jaxws/server/dispatcher/ProviderDispatcher.class, + org/apache/axis2/jaxws/description/impl/EndpointInterfaceDescriptionImpl.class=target/classes/org/apache/axis2/jaxws/description/impl/EndpointInterfaceDescriptionImpl.class, org/apache/axis2/jaxws/description/impl/EndpointInterfaceDescriptionImpl$1.class=target/classes/org/apache/axis2/jaxws/description/impl/EndpointInterfaceDescriptionImpl$1.class, org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.class=target/classes/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.class, @@ -336,7 +342,10 @@ org/apache/axis2/jaxws/marshaller/impl/alt/LegacyExceptionUtil.class=target/classes/org/apache/axis2/jaxws/marshaller/impl/alt/LegacyExceptionUtil.class, - org/apache/axis2/jaxws/i18n/resource.properties=target/classes/org/apache/axis2/jaxws/i18n/resource.properties + org/apache/axis2/jaxws/i18n/resource.properties=target/classes/org/apache/axis2/jaxws/i18n/resource.properties, + + + org/apache/axis2/description/Version.class=target/classes/org/apache/axis2/description/Version.class true Added: geronimo/bundles/trunk/axis2/src/main/java/org/apache/axis2/description/Version.java URL: http://svn.apache.org/viewvc/geronimo/bundles/trunk/axis2/src/main/java/org/apache/axis2/description/Version.java?rev=1339960&view=auto ============================================================================== --- geronimo/bundles/trunk/axis2/src/main/java/org/apache/axis2/description/Version.java (added) +++ geronimo/bundles/trunk/axis2/src/main/java/org/apache/axis2/description/Version.java Fri May 18 03:04:39 2012 @@ -0,0 +1,175 @@ +/* + * 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. + */ + +package org.apache.axis2.description; + +import java.io.Serializable; +import java.text.ParseException; +import java.util.Arrays; + +/** + * Class representing a version number and implementing a comparison algorithm compatible + * with Maven. This class is primarily used for module versions. + */ +public class Version implements Serializable, Comparable { + private static final String S_SNAPSHOT = "SNAPSHOT"; + + public static final Version SNAPSHOT = new Version(null, S_SNAPSHOT); + + private final int[] components; + private final String qualifier; + + /** + * Constructor. + * + * @param components the numeric components of the version; may be null for SNAPSHOT version + * @param qualifier the qualifier + */ + public Version(int[] components, String qualifier) { + this.components = components == null ? null : components.clone(); + this.qualifier = qualifier; + } + + /** + * Constructor that parses the version from a string. The version must have the + * following format: + *
+     * integer ( "." integer )* ( "-" qualifier )?
+     * 
+ * + * @param versionString the string representation of the version + * @throws ParseException if the version is not in the correct format + */ + public Version(String versionString) throws ParseException { + if (versionString.equals(S_SNAPSHOT)) { + components = null; + qualifier = S_SNAPSHOT; + } else { + //GERONIMO-6349 Geronimo re-bundle Axis2 modules, and use versions like '1.6.1_1', while Axis2 does not support + //this kind of version string, the basic idea is to convert _ to -, then treat the following string as qulifier. + int middlelineIndex = versionString.indexOf('-'); + int underlineIndex = versionString.indexOf('_'); + if(middlelineIndex < underlineIndex) { + versionString = versionString.replaceFirst("[_]", "-"); + } + // + int dashIndex = versionString.indexOf('-'); + if (dashIndex != -1) { + qualifier = versionString.substring(dashIndex + 1); + versionString = versionString.substring(0, dashIndex); + } else if (versionString.endsWith(".SNAPSHOT")){ + qualifier = "SNAPSHOT"; + versionString = versionString.substring(0,versionString.indexOf(".SNAPSHOT")); + } else { + qualifier = null; + } + String[] componentStrings = versionString.split("\\."); + int l = componentStrings.length; + components = new int[l]; + for (int i=0; i0) { + buffer.append('.'); + } + buffer.append(components[i]); + } + } + if (qualifier != null) { + if (components != null) { + buffer.append('-'); + } + buffer.append(qualifier); + } + return buffer.toString(); + } + + public int compareTo(Version o) { + // components == null means SNAPSHOT and SNAPSHOT is always + // assumed to be the most recent version + if (components == null && o.components != null) { + return 1; + } else if (components != null && o.components == null) { + return -1; + } else if (components == null && o.components == null) { + return 0; + } + // Now compare version components + int l = Math.min(components.length, o.components.length); + for (int i=0; i