felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsav...@apache.org
Subject svn commit: r814023 [2/2] - in /felix/trunk/sigil: ./ bldcommon/ common/core.tests/ common/core.tests/src/org/apache/felix/sigil/core/ common/core/ common/core/src/org/apache/felix/sigil/bnd/ common/core/src/org/apache/felix/sigil/config/ common/core/s...
Date Fri, 11 Sep 2009 20:51:13 GMT
Added: felix/trunk/sigil/common/osgi/src/org/apache/felix/sigil/common/osgi/VersionRange.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/common/osgi/src/org/apache/felix/sigil/common/osgi/VersionRange.java?rev=814023&view=auto
==============================================================================
--- felix/trunk/sigil/common/osgi/src/org/apache/felix/sigil/common/osgi/VersionRange.java
(added)
+++ felix/trunk/sigil/common/osgi/src/org/apache/felix/sigil/common/osgi/VersionRange.java
Fri Sep 11 20:50:48 2009
@@ -0,0 +1,303 @@
+/*
+ * 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.felix.sigil.common.osgi;
+
+
+import java.io.Serializable;
+
+import org.osgi.framework.Version;
+
+
+public class VersionRange implements Serializable
+{
+
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 1L;
+    public static final Version INFINITE_VERSION = new Version( Integer.MAX_VALUE, Integer.MAX_VALUE,
+        Integer.MAX_VALUE, "" );
+    public static final VersionRange ANY_VERSION = new VersionRange( false, Version.emptyVersion,
INFINITE_VERSION,
+        true );
+
+    private boolean openFloor;
+    private Version floor;
+    private Version ceiling;
+    private boolean openCeiling;
+
+
+    /**
+     * Interval constructor
+     * 
+     * @param openFloor Whether the lower bound of the range is inclusive (false) or exclusive
(true).
+     * @param floor The lower bound version of the range.
+     * @param ceiling The upper bound version of the range.
+     * @param openCeiling Whether the upper bound of the range is inclusive (false) or exclusive
(true).
+     */
+    public VersionRange( boolean openFloor, Version floor, Version ceiling, boolean openCeiling
)
+    {
+        this.openFloor = openFloor;
+        this.floor = floor;
+        this.ceiling = ceiling;
+        this.openCeiling = openCeiling;
+    }
+
+
+    /**
+     * atLeast constructor
+     * 
+     * @param openFloor
+     * @param floor
+     */
+    public VersionRange( Version atLeast )
+    {
+        this.openFloor = false;
+        this.floor = atLeast;
+        this.ceiling = INFINITE_VERSION;
+        this.openCeiling = true;
+    }
+
+
+    public static VersionRange parseVersionRange( String val ) throws IllegalArgumentException,
NumberFormatException
+    {
+        if ( val == null || val.trim().length() == 0 )
+        {
+            return ANY_VERSION;
+        }
+
+        boolean openFloor;
+        boolean openCeiling;
+        val = val.replaceAll( "\\s", "" );
+        val = val.replaceAll( "\"", "" );
+        int fst = val.charAt( 0 );
+        if ( fst == '[' )
+        {
+            openFloor = false;
+        }
+        else if ( fst == '(' )
+        {
+            openFloor = true;
+        }
+        else
+        {
+            Version atLeast = Version.parseVersion( val );
+            return new VersionRange( atLeast );
+        }
+
+        int lst = val.charAt( val.length() - 1 );
+        if ( lst == ']' )
+        {
+            openCeiling = false;
+        }
+        else if ( lst == ')' )
+        {
+            openCeiling = true;
+        }
+        else
+        {
+            throw new IllegalArgumentException( "illegal version range syntax " + val
+                + ": range must end in ')' or ']'" );
+        }
+
+        String inner = val.substring( 1, val.length() - 1 );
+        String[] floorCeiling = inner.split( "," );
+        if ( floorCeiling.length != 2 )
+        {
+            throw new IllegalArgumentException( "illegal version range syntax " + "too many
commas" );
+        }
+        Version floor = Version.parseVersion( floorCeiling[0] );
+        Version ceiling = "*".equals( floorCeiling[1] ) ? INFINITE_VERSION : Version.parseVersion(
floorCeiling[1] );
+        return new VersionRange( openFloor, floor, ceiling, openCeiling );
+    }
+
+
+    public Version getCeiling()
+    {
+        return ceiling;
+    }
+
+
+    public Version getFloor()
+    {
+        return floor;
+    }
+
+
+    public boolean isOpenCeiling()
+    {
+        return openCeiling;
+    }
+
+
+    public boolean isOpenFloor()
+    {
+        return openFloor;
+    }
+
+
+    public boolean isPointVersion()
+    {
+        return !openFloor && !openCeiling && floor.equals( ceiling );
+    }
+
+
+    /**
+     * test a version to see if it falls in the range
+     * 
+     * @param version
+     * @return
+     */
+    public boolean contains( Version version )
+    {
+        if ( version.equals( INFINITE_VERSION ) )
+        {
+            return ceiling.equals( INFINITE_VERSION );
+        }
+        else
+        {
+            return ( version.compareTo( floor ) > 0 && version.compareTo( ceiling
) < 0 )
+                || ( !openFloor && version.equals( floor ) ) || ( !openCeiling &&
version.equals( ceiling ) );
+        }
+    }
+
+
+    @Override
+    public int hashCode()
+    {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ( ( ceiling == null ) ? 0 : ceiling.hashCode() );
+        result = prime * result + ( ( floor == null ) ? 0 : floor.hashCode() );
+        result = prime * result + ( openCeiling ? 1231 : 1237 );
+        result = prime * result + ( openFloor ? 1231 : 1237 );
+        return result;
+    }
+
+
+    @Override
+    public boolean equals( Object obj )
+    {
+        if ( this == obj )
+            return true;
+        if ( obj == null )
+            return false;
+        if ( getClass() != obj.getClass() )
+            return false;
+        final VersionRange other = ( VersionRange ) obj;
+        if ( ceiling == null )
+        {
+            if ( other.ceiling != null )
+                return false;
+        }
+        else if ( !ceiling.equals( other.ceiling ) )
+            return false;
+        if ( floor == null )
+        {
+            if ( other.floor != null )
+                return false;
+        }
+        else if ( !floor.equals( other.floor ) )
+            return false;
+        if ( openCeiling != other.openCeiling )
+            return false;
+        if ( openFloor != other.openFloor )
+            return false;
+        return true;
+    }
+
+
+    @Override
+    public String toString()
+    {
+        if ( ANY_VERSION.equals( this ) )
+        {
+            return makeString( openFloor, Version.emptyVersion, INFINITE_VERSION, openCeiling
);
+        }
+        return makeString( openFloor, floor, ceiling, openCeiling );
+    }
+
+
+    private String makeString( boolean openFloor, Version floor, Version ceiling, boolean
openCeiling )
+    {
+        StringBuffer vr = new StringBuffer( 32 );
+        if ( INFINITE_VERSION.equals( ceiling ) )
+        {
+            vr.append( Version.emptyVersion.equals( floor ) ? "0" : floor.toString() );
+        }
+        else
+        {
+            vr.append( openFloor ? "(" : "[" );
+            String floorStr = Version.emptyVersion.equals( floor ) ? "0" : floor.toString();
+            String ceilingStr = ceiling.toString();
+            vr.append( floorStr ).append( "," ).append( ceilingStr );
+            vr.append( openCeiling ? ")" : "]" );
+        }
+        return vr.toString();
+    }
+
+
+    public static VersionRange newInstance( Version pointVersion, VersionRangeBoundingRule
lowerBoundRule,
+        VersionRangeBoundingRule upperBoundRule )
+    {
+        Version floor = null;
+        switch ( lowerBoundRule )
+        {
+            case Any:
+                floor = new Version( 0, 0, 0 );
+                break;
+            case Major:
+                floor = new Version( pointVersion.getMajor(), 0, 0 );
+                break;
+            case Minor:
+                floor = new Version( pointVersion.getMajor(), pointVersion.getMinor(), 0
);
+                break;
+            case Micro:
+                floor = new Version( pointVersion.getMajor(), pointVersion.getMinor(), pointVersion.getMicro()
);
+                break;
+            case Exact:
+                floor = pointVersion;
+                break;
+        }
+
+        Version ceiling = null;
+        boolean openCeiling = true;
+        switch ( upperBoundRule )
+        {
+            case Any:
+                ceiling = INFINITE_VERSION;
+                break;
+            case Major:
+                ceiling = new Version( pointVersion.getMajor() + 1, 0, 0 );
+                break;
+            case Minor:
+                ceiling = new Version( pointVersion.getMajor(), pointVersion.getMinor() +
1, 0 );
+                break;
+            case Micro:
+                ceiling = new Version( pointVersion.getMajor(), pointVersion.getMinor(),
pointVersion.getMicro() + 1 );
+                break;
+            case Exact:
+                ceiling = pointVersion;
+                openCeiling = false;
+                break;
+        }
+
+        return new VersionRange( false, floor, ceiling, openCeiling );
+    }
+}

Added: felix/trunk/sigil/common/osgi/src/org/apache/felix/sigil/common/osgi/VersionRangeBoundingRule.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/common/osgi/src/org/apache/felix/sigil/common/osgi/VersionRangeBoundingRule.java?rev=814023&view=auto
==============================================================================
--- felix/trunk/sigil/common/osgi/src/org/apache/felix/sigil/common/osgi/VersionRangeBoundingRule.java
(added)
+++ felix/trunk/sigil/common/osgi/src/org/apache/felix/sigil/common/osgi/VersionRangeBoundingRule.java
Fri Sep 11 20:50:48 2009
@@ -0,0 +1,26 @@
+/*
+ * 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.felix.sigil.common.osgi;
+
+
+public enum VersionRangeBoundingRule
+{
+    Exact, Micro, Minor, Major, Any
+}
\ No newline at end of file

Modified: felix/trunk/sigil/eclipse/core/sigil.properties
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/core/sigil.properties?rev=814023&r1=814022&r2=814023&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/core/sigil.properties (original)
+++ felix/trunk/sigil/eclipse/core/sigil.properties Fri Sep 11 20:50:48 2009
@@ -3,6 +3,8 @@
 
 -activator: org.apache.felix.sigil.eclipse.SigilCore
 
+-singleton: true
+
 -bundles: \
 	org.apache.felix.sigil.eclipse.core, \
 
@@ -28,6 +30,7 @@
 	org.apache.commons.lang, \
 	org.apache.commons.lang.text, \
 	org.apache.felix.sigil.bnd, \
+	org.apache.felix.sigil.common.osgi;version=0.9.0, \
 	org.apache.felix.sigil.config, \
 	org.apache.felix.sigil.core, \
 	org.apache.felix.sigil.core.repository, \
@@ -39,7 +42,6 @@
 	org.apache.felix.sigil.eclipse.model.util, \
 	org.apache.felix.sigil.eclipse.preferences, \
 	org.apache.felix.sigil.model, \
-	org.apache.felix.sigil.model.common, \
 	org.apache.felix.sigil.model.eclipse, \
 	org.apache.felix.sigil.model.osgi, \
 	org.apache.felix.sigil.repository, \
@@ -76,6 +78,4 @@
 
 option;addMissingImports: false
 
--singleton: true
-
 # end

Modified: felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/util/JavaHelper.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/util/JavaHelper.java?rev=814023&r1=814022&r2=814023&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/util/JavaHelper.java
(original)
+++ felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/util/JavaHelper.java
Fri Sep 11 20:50:48 2009
@@ -41,13 +41,13 @@
 import java.util.jar.JarInputStream;
 import java.util.regex.Pattern;
 
+import org.apache.felix.sigil.common.osgi.VersionRange;
+import org.apache.felix.sigil.common.osgi.VersionRangeBoundingRule;
 import org.apache.felix.sigil.eclipse.SigilCore;
 import org.apache.felix.sigil.eclipse.model.project.ISigilProjectModel;
 import org.apache.felix.sigil.model.IModelElement;
 import org.apache.felix.sigil.model.IModelWalker;
 import org.apache.felix.sigil.model.ModelElementFactory;
-import org.apache.felix.sigil.model.common.VersionRange;
-import org.apache.felix.sigil.model.common.VersionRangeBoundingRule;
 import org.apache.felix.sigil.model.eclipse.ISigilBundle;
 import org.apache.felix.sigil.model.osgi.IBundleModelElement;
 import org.apache.felix.sigil.model.osgi.IPackageExport;

Modified: felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/preferences/SigilPreferencesInitializer.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/preferences/SigilPreferencesInitializer.java?rev=814023&r1=814022&r2=814023&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/preferences/SigilPreferencesInitializer.java
(original)
+++ felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/preferences/SigilPreferencesInitializer.java
Fri Sep 11 20:50:48 2009
@@ -20,9 +20,9 @@
 package org.apache.felix.sigil.eclipse.preferences;
 
 
+import org.apache.felix.sigil.common.osgi.VersionRangeBoundingRule;
 import org.apache.felix.sigil.eclipse.SigilCore;
 import org.apache.felix.sigil.eclipse.internal.model.repository.RepositoryConfiguration;
-import org.apache.felix.sigil.model.common.VersionRangeBoundingRule;
 import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
 import org.eclipse.jface.preference.IPreferenceStore;
 

Modified: felix/trunk/sigil/eclipse/search/sigil.properties
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/search/sigil.properties?rev=814023&r1=814022&r2=814023&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/search/sigil.properties (original)
+++ felix/trunk/sigil/eclipse/search/sigil.properties Fri Sep 11 20:50:48 2009
@@ -3,10 +3,10 @@
 
 -activator: org.apache.felix.sigil.search.SigilSearch
 
+-singleton: true
+
 -bundles: \
 	org.apache.felix.sigil.eclipse.search, \
-	
--singleton: true
 
 -sourcedirs: \
 	src, \
@@ -15,11 +15,11 @@
 	org.apache.felix.sigil.search, \
 
 -imports: \
+	org.apache.felix.sigil.common.osgi, \
 	org.apache.felix.sigil.eclipse, \
 	org.apache.felix.sigil.eclipse.model.project, \
 	org.apache.felix.sigil.eclipse.model.util, \
 	org.apache.felix.sigil.model, \
-	org.apache.felix.sigil.model.common, \
 	org.apache.felix.sigil.model.eclipse, \
 	org.apache.felix.sigil.model.osgi, \
 	org.apache.felix.sigil.repository, \
@@ -34,7 +34,7 @@
 
 -requires: \
 	org.eclipse.core.runtime;version=3.4.0, \
-	
+
 header;Bundle-ActivationPolicy: lazy	
 
 # end

Modified: felix/trunk/sigil/eclipse/search/src/org/apache/felix/sigil/search/index/Index.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/search/src/org/apache/felix/sigil/search/index/Index.java?rev=814023&r1=814022&r2=814023&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/search/src/org/apache/felix/sigil/search/index/Index.java (original)
+++ felix/trunk/sigil/eclipse/search/src/org/apache/felix/sigil/search/index/Index.java Fri
Sep 11 20:50:48 2009
@@ -32,8 +32,8 @@
 import java.util.regex.Pattern;
 
 import org.apache.bcel.classfile.JavaClass;
+import org.apache.felix.sigil.common.osgi.VersionRange;
 import org.apache.felix.sigil.model.ModelElementFactory;
-import org.apache.felix.sigil.model.common.VersionRange;
 import org.apache.felix.sigil.model.eclipse.ISigilBundle;
 import org.apache.felix.sigil.model.osgi.IPackageExport;
 import org.apache.felix.sigil.model.osgi.IRequiredBundle;

Modified: felix/trunk/sigil/eclipse/ui/sigil.properties
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/sigil.properties?rev=814023&r1=814022&r2=814023&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/sigil.properties (original)
+++ felix/trunk/sigil/eclipse/ui/sigil.properties Fri Sep 11 20:50:48 2009
@@ -3,6 +3,8 @@
 
 -activator: org.apache.felix.sigil.ui.eclipse.ui.SigilUI
 
+-singleton: true
+
 -bundles: \
 	org.apache.felix.sigil.eclipse.ui, \
 
@@ -21,6 +23,7 @@
 	org.apache.felix.sigil.ui.eclipse.ui.wizard.repository, \
 
 -imports: \
+	org.apache.felix.sigil.common.osgi, \
 	org.apache.felix.sigil.eclipse, \
 	org.apache.felix.sigil.eclipse.install, \
 	org.apache.felix.sigil.eclipse.job, \
@@ -29,7 +32,6 @@
 	org.apache.felix.sigil.eclipse.model.util, \
 	org.apache.felix.sigil.eclipse.preferences, \
 	org.apache.felix.sigil.model, \
-	org.apache.felix.sigil.model.common, \
 	org.apache.felix.sigil.model.eclipse, \
 	org.apache.felix.sigil.model.osgi, \
 	org.apache.felix.sigil.repository, \
@@ -99,6 +101,4 @@
 
 option;addMissingImports: false
 
--singleton: true
-
 # end

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/DependencyManagementSection.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/DependencyManagementSection.java?rev=814023&r1=814022&r2=814023&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/DependencyManagementSection.java
(original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/DependencyManagementSection.java
Fri Sep 11 20:50:48 2009
@@ -26,11 +26,11 @@
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.felix.sigil.common.osgi.VersionRange;
+import org.apache.felix.sigil.common.osgi.VersionRangeBoundingRule;
 import org.apache.felix.sigil.eclipse.SigilCore;
 import org.apache.felix.sigil.eclipse.model.project.ISigilProjectModel;
 import org.apache.felix.sigil.model.ModelElementFactory;
-import org.apache.felix.sigil.model.common.VersionRange;
-import org.apache.felix.sigil.model.common.VersionRangeBoundingRule;
 import org.apache.felix.sigil.model.osgi.IBundleModelElement;
 import org.apache.felix.sigil.model.osgi.IPackageExport;
 import org.apache.felix.sigil.model.osgi.IPackageImport;

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ExportPackagesSection.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ExportPackagesSection.java?rev=814023&r1=814022&r2=814023&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ExportPackagesSection.java
(original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ExportPackagesSection.java
Fri Sep 11 20:50:48 2009
@@ -23,12 +23,12 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.felix.sigil.common.osgi.VersionRange;
+import org.apache.felix.sigil.common.osgi.VersionRangeBoundingRule;
 import org.apache.felix.sigil.eclipse.SigilCore;
 import org.apache.felix.sigil.eclipse.model.project.ISigilProjectModel;
 import org.apache.felix.sigil.model.ModelElementFactory;
 import org.apache.felix.sigil.model.ModelElementFactoryException;
-import org.apache.felix.sigil.model.common.VersionRange;
-import org.apache.felix.sigil.model.common.VersionRangeBoundingRule;
 import org.apache.felix.sigil.model.eclipse.ISigilBundle;
 import org.apache.felix.sigil.model.osgi.IPackageExport;
 import org.apache.felix.sigil.model.osgi.IPackageImport;

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/NewResourceSelectionDialog.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/NewResourceSelectionDialog.java?rev=814023&r1=814022&r2=814023&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/NewResourceSelectionDialog.java
(original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/NewResourceSelectionDialog.java
Fri Sep 11 20:50:48 2009
@@ -20,9 +20,9 @@
 package org.apache.felix.sigil.ui.eclipse.ui.editors.project;
 
 
+import org.apache.felix.sigil.common.osgi.VersionRange;
+import org.apache.felix.sigil.common.osgi.VersionRangeBoundingRule;
 import org.apache.felix.sigil.eclipse.SigilCore;
-import org.apache.felix.sigil.model.common.VersionRange;
-import org.apache.felix.sigil.model.common.VersionRangeBoundingRule;
 import org.apache.felix.sigil.model.osgi.IVersionedModelElement;
 import org.apache.felix.sigil.ui.eclipse.ui.util.BackgroundLoadingSelectionDialog;
 import org.apache.felix.sigil.ui.eclipse.ui.util.IValidationListener;

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ResourceImportDialog.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ResourceImportDialog.java?rev=814023&r1=814022&r2=814023&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ResourceImportDialog.java
(original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ResourceImportDialog.java
Fri Sep 11 20:50:48 2009
@@ -20,8 +20,8 @@
 package org.apache.felix.sigil.ui.eclipse.ui.editors.project;
 
 
+import org.apache.felix.sigil.common.osgi.VersionRange;
 import org.apache.felix.sigil.model.ModelElementFactory;
-import org.apache.felix.sigil.model.common.VersionRange;
 import org.apache.felix.sigil.model.osgi.IPackageImport;
 import org.eclipse.jface.viewers.IContentProvider;
 import org.eclipse.jface.viewers.SelectionChangedEvent;

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/SigilProjectEditorPart.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/SigilProjectEditorPart.java?rev=814023&r1=814022&r2=814023&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/SigilProjectEditorPart.java
(original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/SigilProjectEditorPart.java
Fri Sep 11 20:50:48 2009
@@ -26,11 +26,11 @@
 import java.util.Iterator;
 import java.util.Set;
 
+import org.apache.felix.sigil.common.osgi.VersionRange;
 import org.apache.felix.sigil.eclipse.SigilCore;
 import org.apache.felix.sigil.eclipse.model.project.ISigilProjectModel;
 import org.apache.felix.sigil.model.IModelElement;
 import org.apache.felix.sigil.model.ModelElementFactory;
-import org.apache.felix.sigil.model.common.VersionRange;
 import org.apache.felix.sigil.model.osgi.IPackageImport;
 import org.apache.felix.sigil.model.osgi.IRequiredBundle;
 import org.apache.felix.sigil.ui.eclipse.ui.SigilUI;

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/VersionRangeComponent.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/VersionRangeComponent.java?rev=814023&r1=814022&r2=814023&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/VersionRangeComponent.java
(original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/VersionRangeComponent.java
Fri Sep 11 20:50:48 2009
@@ -23,7 +23,7 @@
 import java.util.HashSet;
 import java.util.Set;
 
-import org.apache.felix.sigil.model.common.VersionRange;
+import org.apache.felix.sigil.common.osgi.VersionRange;
 import org.apache.felix.sigil.ui.eclipse.ui.util.IValidationListener;
 import org.eclipse.jface.dialogs.IMessageProvider;
 import org.eclipse.swt.SWT;

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/VersionsChangeListener.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/VersionsChangeListener.java?rev=814023&r1=814022&r2=814023&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/VersionsChangeListener.java
(original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/VersionsChangeListener.java
Fri Sep 11 20:50:48 2009
@@ -19,9 +19,7 @@
 
 package org.apache.felix.sigil.ui.eclipse.ui.editors.project;
 
-
-import org.apache.felix.sigil.model.common.VersionRange;
-
+import org.apache.felix.sigil.common.osgi.VersionRange;
 
 public interface VersionsChangeListener
 {

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/preferences/LibraryConfigurationDialog.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/preferences/LibraryConfigurationDialog.java?rev=814023&r1=814022&r2=814023&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/preferences/LibraryConfigurationDialog.java
(original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/preferences/LibraryConfigurationDialog.java
Fri Sep 11 20:50:48 2009
@@ -25,13 +25,9 @@
 import java.util.TreeSet;
 
 import org.apache.felix.sigil.model.ModelElementFactory;
-import org.apache.felix.sigil.model.common.VersionRange;
 import org.apache.felix.sigil.model.eclipse.ILibrary;
 import org.apache.felix.sigil.model.osgi.IPackageImport;
-import org.apache.felix.sigil.model.osgi.IPackageModelElement;
-import org.apache.felix.sigil.ui.eclipse.ui.editors.project.NewResourceSelectionDialog;
 import org.apache.felix.sigil.ui.eclipse.ui.util.DefaultTableProvider;
-import org.apache.felix.sigil.ui.eclipse.ui.util.ResourcesDialogHelper;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.dialogs.IMessageProvider;
 import org.eclipse.jface.dialogs.TitleAreaDialog;
@@ -40,7 +36,6 @@
 import org.eclipse.jface.viewers.LabelProvider;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.window.Window;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/preferences/VersionsPreferencePage.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/preferences/VersionsPreferencePage.java?rev=814023&r1=814022&r2=814023&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/preferences/VersionsPreferencePage.java
(original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/preferences/VersionsPreferencePage.java
Fri Sep 11 20:50:48 2009
@@ -20,9 +20,9 @@
 package org.apache.felix.sigil.ui.eclipse.ui.preferences;
 
 
+import org.apache.felix.sigil.common.osgi.VersionRange;
+import org.apache.felix.sigil.common.osgi.VersionRangeBoundingRule;
 import org.apache.felix.sigil.eclipse.SigilCore;
-import org.apache.felix.sigil.model.common.VersionRange;
-import org.apache.felix.sigil.model.common.VersionRangeBoundingRule;
 import org.apache.felix.sigil.ui.eclipse.ui.SigilUI;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.preference.PreferencePage;

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/quickfix/ImportPackageProposal.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/quickfix/ImportPackageProposal.java?rev=814023&r1=814022&r2=814023&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/quickfix/ImportPackageProposal.java
(original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/quickfix/ImportPackageProposal.java
Fri Sep 11 20:50:48 2009
@@ -20,12 +20,12 @@
 package org.apache.felix.sigil.ui.eclipse.ui.quickfix;
 
 
+import org.apache.felix.sigil.common.osgi.VersionRange;
+import org.apache.felix.sigil.common.osgi.VersionRangeBoundingRule;
 import org.apache.felix.sigil.eclipse.SigilCore;
 import org.apache.felix.sigil.eclipse.model.project.ISigilProjectModel;
 import org.apache.felix.sigil.model.ModelElementFactory;
 import org.apache.felix.sigil.model.ModelElementFactoryException;
-import org.apache.felix.sigil.model.common.VersionRange;
-import org.apache.felix.sigil.model.common.VersionRangeBoundingRule;
 import org.apache.felix.sigil.model.osgi.IPackageExport;
 import org.apache.felix.sigil.model.osgi.IPackageImport;
 import org.apache.felix.sigil.ui.eclipse.ui.SigilUI;

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/quickfix/ImportSearchResultProposal.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/quickfix/ImportSearchResultProposal.java?rev=814023&r1=814022&r2=814023&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/quickfix/ImportSearchResultProposal.java
(original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/quickfix/ImportSearchResultProposal.java
Fri Sep 11 20:50:48 2009
@@ -20,12 +20,12 @@
 package org.apache.felix.sigil.ui.eclipse.ui.quickfix;
 
 
+import org.apache.felix.sigil.common.osgi.VersionRange;
+import org.apache.felix.sigil.common.osgi.VersionRangeBoundingRule;
 import org.apache.felix.sigil.eclipse.SigilCore;
 import org.apache.felix.sigil.eclipse.model.project.ISigilProjectModel;
 import org.apache.felix.sigil.model.ModelElementFactory;
 import org.apache.felix.sigil.model.ModelElementFactoryException;
-import org.apache.felix.sigil.model.common.VersionRange;
-import org.apache.felix.sigil.model.common.VersionRangeBoundingRule;
 import org.apache.felix.sigil.model.osgi.IPackageExport;
 import org.apache.felix.sigil.model.osgi.IPackageImport;
 import org.apache.felix.sigil.search.ISearchResult;

Modified: felix/trunk/sigil/ivy/resolver/sigil.properties
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/ivy/resolver/sigil.properties?rev=814023&r1=814022&r2=814023&view=diff
==============================================================================
--- felix/trunk/sigil/ivy/resolver/sigil.properties (original)
+++ felix/trunk/sigil/ivy/resolver/sigil.properties Fri Sep 11 20:50:48 2009
@@ -5,18 +5,18 @@
 	org.apache.felix.sigil.ivy.resolver, \
 
 -contents: \
-  org.apache.felix.sigil.*, \
-  profiles.*, \
-  org.osgi.framework, \
+	profiles.*, \
+	org.osgi.framework, \
+	org.apache.felix.sigil.*, \
 
 -imports: \
 	org.apache.felix.sigil.bnd, \
+	org.apache.felix.sigil.common.osgi, \
 	org.apache.felix.sigil.config, \
 	org.apache.felix.sigil.core, \
 	org.apache.felix.sigil.core.licence, \
 	org.apache.felix.sigil.core.repository, \
 	org.apache.felix.sigil.model, \
-	org.apache.felix.sigil.model.common, \
 	org.apache.felix.sigil.model.eclipse, \
 	org.apache.felix.sigil.model.osgi, \
 	org.apache.felix.sigil.obr, \
@@ -37,6 +37,7 @@
 	org.apache.ivy.util, \
 	org.apache.tools.ant, \
 	org.apache.tools.ant.types, \
+	org.eclipse.core.runtime;version=3.4.0, \
 	org.osgi.framework, \
 
 -requires: \

Modified: felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/ProjectRepository.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/ProjectRepository.java?rev=814023&r1=814022&r2=814023&view=diff
==============================================================================
--- felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/ProjectRepository.java (original)
+++ felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/ProjectRepository.java Fri
Sep 11 20:50:48 2009
@@ -28,13 +28,13 @@
 import java.util.Collection;
 import java.util.List;
 
+import org.apache.felix.sigil.common.osgi.VersionRange;
 import org.apache.felix.sigil.config.BldFactory;
 import org.apache.felix.sigil.config.IBldProject;
 import org.apache.felix.sigil.config.IBldProject.IBldBundle;
 import org.apache.felix.sigil.core.internal.model.eclipse.SigilBundle;
 import org.apache.felix.sigil.core.internal.model.osgi.BundleModelElement;
 import org.apache.felix.sigil.core.licence.ILicensePolicy;
-import org.apache.felix.sigil.model.common.VersionRange;
 import org.apache.felix.sigil.model.eclipse.ISigilBundle;
 import org.apache.felix.sigil.model.osgi.IBundleModelElement;
 import org.apache.felix.sigil.model.osgi.IPackageExport;

Modified: felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/SigilParser.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/SigilParser.java?rev=814023&r1=814022&r2=814023&view=diff
==============================================================================
--- felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/SigilParser.java (original)
+++ felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/SigilParser.java Fri Sep
11 20:50:48 2009
@@ -31,10 +31,10 @@
 import java.util.Map;
 import java.util.regex.Pattern;
 
+import org.apache.felix.sigil.common.osgi.VersionRange;
 import org.apache.felix.sigil.config.BldFactory;
 import org.apache.felix.sigil.config.IBldProject;
 import org.apache.felix.sigil.model.IModelElement;
-import org.apache.felix.sigil.model.common.VersionRange;
 import org.apache.felix.sigil.model.eclipse.ISigilBundle;
 import org.apache.felix.sigil.model.osgi.IBundleModelElement;
 import org.apache.felix.sigil.model.osgi.IPackageImport;

Modified: felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/SigilResolver.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/SigilResolver.java?rev=814023&r1=814022&r2=814023&view=diff
==============================================================================
--- felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/SigilResolver.java (original)
+++ felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/SigilResolver.java Fri Sep
11 20:50:48 2009
@@ -37,10 +37,10 @@
 import java.util.jar.JarInputStream;
 import java.util.jar.Manifest;
 
+import org.apache.felix.sigil.common.osgi.VersionRange;
 import org.apache.felix.sigil.config.BldFactory;
 import org.apache.felix.sigil.core.internal.model.osgi.RequiredBundle;
 import org.apache.felix.sigil.model.IModelElement;
-import org.apache.felix.sigil.model.common.VersionRange;
 import org.apache.felix.sigil.model.eclipse.ISigilBundle;
 import org.apache.felix.sigil.model.osgi.IBundleModelElement;
 import org.apache.felix.sigil.repository.IResolution;
@@ -54,6 +54,7 @@
 import org.apache.ivy.plugins.resolver.BasicResolver;
 import org.apache.ivy.plugins.resolver.util.ResolvedResource;
 import org.apache.ivy.util.FileUtil;
+import org.eclipse.core.runtime.IPath;
 
 
 /**
@@ -386,11 +387,10 @@
 
         private boolean bundleContains( ISigilBundle bundle, String j )
         {
-            URI uri = bundle.getBundleInfo().getUpdateLocation();
             InputStream is = null;
             try
             {
-                URL url = ( uri != null ) ? uri.toURL() : bundle.getLocation().toFile().toURL();
+                URL url = getURL( bundle );
                 is = url.openStream();
                 JarInputStream js = new JarInputStream( is, false );
                 JarEntry entry;
@@ -427,11 +427,10 @@
             if ( bundle == null )
                 return null;
 
-            URI uri = bundle.getBundleInfo().getUpdateLocation();
             InputStream is = null;
             try
             {
-                URL url = ( uri != null ) ? uri.toURL() : bundle.getLocation().toFile().toURL();
+                URL url = getURL( bundle );
                 is = url.openStream();
                 JarInputStream js = new JarInputStream( is, false );
                 Manifest m = js.getManifest();
@@ -459,6 +458,22 @@
         }
 
 
+        private URL getURL( ISigilBundle bundle ) throws MalformedURLException
+        {
+            URI uri = bundle.getBundleInfo().getUpdateLocation();
+            if ( uri != null ) {
+                return uri.toURL();
+            }
+            else {
+                IPath path = bundle.getLocation();
+                if ( path == null ) {
+                    throw new NullPointerException( "Missing location for " + bundle.getSymbolicName()
);
+                }
+                return path.toFile().toURI().toURL();
+            }
+        }
+
+
         public String toString()
         {
             return "SigilIvy[" + name + "]";



Mime
View raw message