felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mccu...@apache.org
Subject svn commit: r1354104 [2/4] - in /felix/trunk/bundleplugin: ./ src/main/java/aQute/bnd/annotation/ src/main/java/aQute/bnd/annotation/metatype/ src/main/java/aQute/bnd/build/ src/main/java/aQute/bnd/build/model/ src/main/java/aQute/bnd/build/model/claus...
Date Tue, 26 Jun 2012 16:34:43 GMT
Added: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/ClauseListConverter.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/ClauseListConverter.java?rev=1354104&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/ClauseListConverter.java (added)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/ClauseListConverter.java Tue Jun 26 16:34:24 2012
@@ -0,0 +1,31 @@
+package aQute.bnd.build.model.conversions;
+
+import java.util.*;
+import java.util.Map.Entry;
+
+import aQute.lib.osgi.*;
+import aQute.libg.header.*;
+import aQute.libg.tuple.*;
+
+public class ClauseListConverter<R> implements Converter<List<R>,String> {
+
+	private final Converter< ? extends R, ? super Pair<String,Attrs>>	itemConverter;
+
+	public ClauseListConverter(Converter< ? extends R, ? super Pair<String,Attrs>> itemConverter) {
+		this.itemConverter = itemConverter;
+	}
+
+	public List<R> convert(String input) throws IllegalArgumentException {
+		List<R> result = new ArrayList<R>();
+
+		Parameters header = new Parameters(input);
+		for (Entry<String,Attrs> entry : header.entrySet()) {
+			String key = Processor.removeDuplicateMarker(entry.getKey());
+			Pair<String,Attrs> pair = Pair.newInstance(key, entry.getValue());
+			result.add(itemConverter.convert(pair));
+		}
+
+		return result;
+	}
+
+}

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/ClauseListConverter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/ClauseListConverter.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/CollectionFormatter.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/CollectionFormatter.java?rev=1354104&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/CollectionFormatter.java (added)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/CollectionFormatter.java Tue Jun 26 16:34:24 2012
@@ -0,0 +1,47 @@
+package aQute.bnd.build.model.conversions;
+
+import java.util.*;
+
+public class CollectionFormatter<T> implements Converter<String,Collection< ? extends T>> {
+
+	private final String						separator;
+	private final Converter<String, ? super T>	itemFormatter;
+	private final String						emptyOutput;
+
+	public CollectionFormatter(String separator) {
+		this(separator, (String) null);
+	}
+
+	public CollectionFormatter(String separator, String emptyOutput) {
+		this(separator, new DefaultFormatter(), emptyOutput);
+	}
+
+	public CollectionFormatter(String separator, Converter<String, ? super T> itemFormatter) {
+		this(separator, itemFormatter, null);
+	}
+
+	public CollectionFormatter(String separator, Converter<String, ? super T> itemFormatter, String emptyOutput) {
+		this.separator = separator;
+		this.itemFormatter = itemFormatter;
+		this.emptyOutput = emptyOutput;
+	}
+
+	public String convert(Collection< ? extends T> input) throws IllegalArgumentException {
+		String result = null;
+		if (input != null) {
+			if (input.isEmpty()) {
+				result = emptyOutput;
+			} else {
+				StringBuilder buffer = new StringBuilder();
+				for (Iterator< ? extends T> iter = input.iterator(); iter.hasNext();) {
+					T item = iter.next();
+					buffer.append(itemFormatter.convert(item));
+					if (iter.hasNext())
+						buffer.append(separator);
+				}
+				result = buffer.toString();
+			}
+		}
+		return result;
+	}
+}
\ No newline at end of file

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/CollectionFormatter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/CollectionFormatter.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/Converter.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/Converter.java?rev=1354104&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/Converter.java (added)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/Converter.java Tue Jun 26 16:34:24 2012
@@ -0,0 +1,5 @@
+package aQute.bnd.build.model.conversions;
+
+public interface Converter<R, T> {
+	R convert(T input) throws IllegalArgumentException;
+}
\ No newline at end of file

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/Converter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/Converter.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/DefaultBooleanFormatter.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/DefaultBooleanFormatter.java?rev=1354104&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/DefaultBooleanFormatter.java (added)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/DefaultBooleanFormatter.java Tue Jun 26 16:34:24 2012
@@ -0,0 +1,26 @@
+package aQute.bnd.build.model.conversions;
+
+/**
+ * Formatter for booleans with a default value; if the input value matches the
+ * default then it is formatted to <code>null</code>.
+ * 
+ * @author Neil Bartlett
+ */
+public class DefaultBooleanFormatter implements Converter<String,Boolean> {
+
+	private final boolean	defaultValue;
+
+	public DefaultBooleanFormatter(boolean defaultValue) {
+		this.defaultValue = defaultValue;
+	}
+
+	public String convert(Boolean input) throws IllegalArgumentException {
+		String result = null;
+
+		if (input != null && input.booleanValue() != defaultValue)
+			result = input.toString();
+
+		return result;
+	}
+
+}

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/DefaultBooleanFormatter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/DefaultBooleanFormatter.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/DefaultFormatter.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/DefaultFormatter.java?rev=1354104&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/DefaultFormatter.java (added)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/DefaultFormatter.java Tue Jun 26 16:34:24 2012
@@ -0,0 +1,9 @@
+package aQute.bnd.build.model.conversions;
+
+public class DefaultFormatter implements Converter<String,Object> {
+
+	public String convert(Object input) throws IllegalArgumentException {
+		return input == null ? null : input.toString();
+	}
+
+}

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/DefaultFormatter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/DefaultFormatter.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/EnumConverter.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/EnumConverter.java?rev=1354104&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/EnumConverter.java (added)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/EnumConverter.java Tue Jun 26 16:34:24 2012
@@ -0,0 +1,27 @@
+package aQute.bnd.build.model.conversions;
+
+public class EnumConverter<E extends Enum<E>> implements Converter<E,String> {
+
+	private final Class<E>	enumType;
+	private final E			defaultValue;
+
+	public static <E extends Enum<E>> EnumConverter<E> create(Class<E> enumType) {
+		return new EnumConverter<E>(enumType, null);
+	}
+
+	public static <E extends Enum<E>> EnumConverter<E> create(Class<E> enumType, E defaultValue) {
+		return new EnumConverter<E>(enumType, defaultValue);
+	}
+
+	private EnumConverter(Class<E> enumType, E defaultValue) {
+		this.enumType = enumType;
+		this.defaultValue = defaultValue;
+	}
+
+	public E convert(String input) throws IllegalArgumentException {
+		if (input == null)
+			return defaultValue;
+		return Enum.valueOf(enumType, input);
+	}
+
+}

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/EnumConverter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/EnumConverter.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/EnumFormatter.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/EnumFormatter.java?rev=1354104&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/EnumFormatter.java (added)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/EnumFormatter.java Tue Jun 26 16:34:24 2012
@@ -0,0 +1,53 @@
+package aQute.bnd.build.model.conversions;
+
+/**
+ * Formats an enum type. Outputs {@code null} when the value of the enum is
+ * equal to a default value.
+ * 
+ * @param <E>
+ * @author Neil Bartlett
+ */
+public class EnumFormatter<E extends Enum<E>> implements Converter<String,E> {
+
+	private final E			defaultValue;
+
+	/**
+	 * Construct a new formatter with no default value, i.e. any non-null value
+	 * of the enum will print that value.
+	 * 
+	 * @param enumType
+	 *            The enum type.
+	 * @return
+	 */
+	public static <E extends Enum<E>> EnumFormatter<E> create(Class<E> enumType) {
+		return new EnumFormatter<E>(null);
+	}
+
+	/**
+	 * Construct a new formatter with the specified default value.
+	 * 
+	 * @param enumType
+	 *            The enum type.
+	 * @param defaultValue
+	 *            The default value, which will never be output.
+	 * @return
+	 */
+	public static <E extends Enum<E>> EnumFormatter<E> create(Class<E> enumType, E defaultValue) {
+		return new EnumFormatter<E>(defaultValue);
+	}
+
+	private EnumFormatter(E defaultValue) {
+		this.defaultValue = defaultValue;
+	}
+
+	public String convert(E input) throws IllegalArgumentException {
+		String result;
+		if (input == defaultValue || input == null)
+			result = null;
+		else {
+			result = input.toString();
+		}
+		return result;
+	}
+
+}

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/EnumFormatter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/EnumFormatter.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/HeaderClauseConverter.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/HeaderClauseConverter.java?rev=1354104&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/HeaderClauseConverter.java (added)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/HeaderClauseConverter.java Tue Jun 26 16:34:24 2012
@@ -0,0 +1,13 @@
+package aQute.bnd.build.model.conversions;
+
+import aQute.bnd.build.model.clauses.*;
+import aQute.libg.header.*;
+import aQute.libg.tuple.*;
+
+public class HeaderClauseConverter implements Converter<HeaderClause,Pair<String,Attrs>> {
+
+	public HeaderClause convert(Pair<String,Attrs> input) throws IllegalArgumentException {
+		return new HeaderClause(input.getFirst(), input.getSecond());
+	}
+
+}

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/HeaderClauseConverter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/HeaderClauseConverter.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/HeaderClauseFormatter.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/HeaderClauseFormatter.java?rev=1354104&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/HeaderClauseFormatter.java (added)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/HeaderClauseFormatter.java Tue Jun 26 16:34:24 2012
@@ -0,0 +1,11 @@
+package aQute.bnd.build.model.conversions;
+
+import aQute.bnd.build.model.clauses.*;
+
+public class HeaderClauseFormatter implements Converter<String,HeaderClause> {
+	public String convert(HeaderClause input) throws IllegalArgumentException {
+		StringBuilder buffer = new StringBuilder();
+		input.formatTo(buffer);
+		return buffer.toString();
+	}
+}
\ No newline at end of file

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/HeaderClauseFormatter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/HeaderClauseFormatter.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/HeaderClauseListConverter.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/HeaderClauseListConverter.java?rev=1354104&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/HeaderClauseListConverter.java (added)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/HeaderClauseListConverter.java Tue Jun 26 16:34:24 2012
@@ -0,0 +1,11 @@
+package aQute.bnd.build.model.conversions;
+
+import aQute.bnd.build.model.clauses.*;
+
+public class HeaderClauseListConverter extends ClauseListConverter<HeaderClause> {
+
+	public HeaderClauseListConverter() {
+		super(new HeaderClauseConverter());
+	}
+
+}

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/HeaderClauseListConverter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/HeaderClauseListConverter.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/MapFormatter.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/MapFormatter.java?rev=1354104&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/MapFormatter.java (added)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/MapFormatter.java Tue Jun 26 16:34:24 2012
@@ -0,0 +1,18 @@
+package aQute.bnd.build.model.conversions;
+
+import java.util.*;
+import java.util.Map.Entry;
+
+public class MapFormatter implements Converter<String,Map<String,String>> {
+
+	private CollectionFormatter<Entry<String,String>>	entrySetFormatter;
+
+	public MapFormatter(String listSeparator, Converter<String, ? super Entry<String,String>> entryFormatter,
+			String emptyOutput) {
+		entrySetFormatter = new CollectionFormatter<Entry<String,String>>(listSeparator, entryFormatter, emptyOutput);
+	}
+
+	public String convert(Map<String,String> input) throws IllegalArgumentException {
+		return entrySetFormatter.convert(input.entrySet());
+	}
+}

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/MapFormatter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/MapFormatter.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/NewlineEscapedStringFormatter.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/NewlineEscapedStringFormatter.java?rev=1354104&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/NewlineEscapedStringFormatter.java (added)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/NewlineEscapedStringFormatter.java Tue Jun 26 16:34:24 2012
@@ -0,0 +1,33 @@
+package aQute.bnd.build.model.conversions;
+
+import aQute.bnd.build.model.*;
+
+public class NewlineEscapedStringFormatter implements Converter<String,String> {
+
+	public String convert(String input) throws IllegalArgumentException {
+		if (input == null)
+			return null;
+
+		// Shortcut the result for the majority of cases where there is no
+		// newline
+		if (input.indexOf('\n') == -1)
+			return input;
+
+		// Build a new string with newlines escaped
+		StringBuilder result = new StringBuilder();
+		int position = 0;
+		while (position < input.length()) {
+			int newlineIndex = input.indexOf('\n', position);
+			if (newlineIndex == -1) {
+				result.append(input.substring(position));
+				break;
+			}
+			result.append(input.substring(position, newlineIndex));
+			result.append(BndEditModel.LINE_SEPARATOR);
+			position = newlineIndex + 1;
+		}
+
+		return result.toString();
+	}
+
+}

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/NewlineEscapedStringFormatter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/NewlineEscapedStringFormatter.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/NoopConverter.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/NoopConverter.java?rev=1354104&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/NoopConverter.java (added)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/NoopConverter.java Tue Jun 26 16:34:24 2012
@@ -0,0 +1,7 @@
+package aQute.bnd.build.model.conversions;
+
+public class NoopConverter<T> implements Converter<T,T> {
+	public T convert(T input) throws IllegalArgumentException {
+		return input;
+	}
+}
\ No newline at end of file

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/NoopConverter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/NoopConverter.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/PropertiesConverter.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/PropertiesConverter.java?rev=1354104&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/PropertiesConverter.java (added)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/PropertiesConverter.java Tue Jun 26 16:34:24 2012
@@ -0,0 +1,13 @@
+package aQute.bnd.build.model.conversions;
+
+import java.util.*;
+
+import aQute.libg.header.*;
+
+public class PropertiesConverter implements Converter<Map<String,String>,String> {
+
+	public Map<String,String> convert(String input) throws IllegalArgumentException {
+		return OSGiHeader.parseProperties(input);
+	}
+
+}

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/PropertiesConverter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/PropertiesConverter.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/PropertiesEntryFormatter.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/PropertiesEntryFormatter.java?rev=1354104&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/PropertiesEntryFormatter.java (added)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/PropertiesEntryFormatter.java Tue Jun 26 16:34:24 2012
@@ -0,0 +1,26 @@
+package aQute.bnd.build.model.conversions;
+
+import java.util.Map.Entry;
+
+public class PropertiesEntryFormatter implements Converter<String,Entry<String,String>> {
+	public String convert(Entry<String,String> entry) {
+		StringBuilder buffer = new StringBuilder();
+
+		String name = entry.getKey();
+		buffer.append(name).append('=');
+
+		String value = entry.getValue();
+		if (value != null && value.length() > 0) {
+			int quotableIndex = value.indexOf(',');
+			if (quotableIndex == -1)
+				quotableIndex = value.indexOf('=');
+
+			if (quotableIndex >= 0) {
+				buffer.append('\'').append(value).append('\'');
+			} else {
+				buffer.append(value);
+			}
+		}
+		return buffer.toString();
+	}
+}
\ No newline at end of file

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/PropertiesEntryFormatter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/PropertiesEntryFormatter.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/SimpleListConverter.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/SimpleListConverter.java?rev=1354104&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/SimpleListConverter.java (added)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/SimpleListConverter.java Tue Jun 26 16:34:24 2012
@@ -0,0 +1,41 @@
+package aQute.bnd.build.model.conversions;
+
+import java.util.*;
+
+import aQute.lib.osgi.*;
+import aQute.libg.qtokens.*;
+
+public class SimpleListConverter<R> implements Converter<List<R>,String> {
+
+	private Converter< ? extends R, ? super String>	itemConverter;
+
+	public static <R> Converter<List<R>,String> create(Converter<R, ? super String> itemConverter) {
+		return new SimpleListConverter<R>(itemConverter);
+	}
+
+	public static Converter<List<String>,String> create() {
+		return new SimpleListConverter<String>(new NoopConverter<String>());
+	}
+
+	private SimpleListConverter(Converter< ? extends R, ? super String> itemConverter) {
+		this.itemConverter = itemConverter;
+	}
+
+	public List<R> convert(String input) throws IllegalArgumentException {
+		List<R> result = new ArrayList<R>();
+
+		if (Constants.EMPTY_HEADER.equalsIgnoreCase(input.trim()))
+			return result;
+
+		QuotedTokenizer qt = new QuotedTokenizer(input, ",");
+		String token = qt.nextToken();
+
+		while (token != null) {
+			result.add(itemConverter.convert(token.trim()));
+			token = qt.nextToken();
+		}
+
+		return result;
+	}
+
+}

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/SimpleListConverter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/SimpleListConverter.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/StringEntryConverter.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/StringEntryConverter.java?rev=1354104&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/StringEntryConverter.java (added)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/StringEntryConverter.java Tue Jun 26 16:34:24 2012
@@ -0,0 +1,11 @@
+package aQute.bnd.build.model.conversions;
+
+import java.util.Map.Entry;
+
+public class StringEntryConverter implements Converter<String,Entry<String, ? >> {
+
+	public String convert(Entry<String, ? > input) throws IllegalArgumentException {
+		return input.getKey();
+	}
+
+}

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/StringEntryConverter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/StringEntryConverter.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/VersionedClauseConverter.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/VersionedClauseConverter.java?rev=1354104&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/VersionedClauseConverter.java (added)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/VersionedClauseConverter.java Tue Jun 26 16:34:24 2012
@@ -0,0 +1,11 @@
+package aQute.bnd.build.model.conversions;
+
+import aQute.bnd.build.model.clauses.*;
+import aQute.libg.header.*;
+import aQute.libg.tuple.*;
+
+public class VersionedClauseConverter implements Converter<VersionedClause,Pair<String,Attrs>> {
+	public VersionedClause convert(Pair<String,Attrs> input) throws IllegalArgumentException {
+		return new VersionedClause(input.getFirst(), input.getSecond());
+	}
+}
\ No newline at end of file

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/VersionedClauseConverter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/VersionedClauseConverter.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/packageinfo
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/packageinfo?rev=1354104&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/packageinfo (added)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/conversions/packageinfo Tue Jun 26 16:34:24 2012
@@ -0,0 +1 @@
+version 2
\ No newline at end of file

Added: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/packageinfo
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/packageinfo?rev=1354104&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/packageinfo (added)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/model/packageinfo Tue Jun 26 16:34:24 2012
@@ -0,0 +1 @@
+version 2
\ No newline at end of file

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/packageinfo
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/packageinfo?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/packageinfo (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/packageinfo Tue Jun 26 16:34:24 2012
@@ -1 +1 @@
-version 1.44.0
+version 1.45.0

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/compatibility/GenericType.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/compatibility/GenericType.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/compatibility/GenericType.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/compatibility/GenericType.java Tue Jun 26 16:34:24 2012
@@ -1,7 +1,7 @@
 package aQute.bnd.compatibility;
 
 public class GenericType {
-	public GenericType(Class<Object> class1) {
+	public GenericType(@SuppressWarnings("unused") Class<Object> class1) {
 		// TODO Auto-generated constructor stub
 	}
 

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/compatibility/Signatures.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/compatibility/Signatures.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/compatibility/Signatures.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/compatibility/Signatures.java Tue Jun 26 16:34:24 2012
@@ -530,11 +530,9 @@ public class Signatures {
 	private String assign(Map<String,String> map, String name) {
 		if (map.containsKey(name))
 			return map.get(name);
-		else {
-			int n = map.size();
-			map.put(name, "_" + n);
-			return "_" + n;
-		}
+		int n = map.size();
+		map.put(name, "_" + n);
+		return "_" + n;
 	}
 
 	private boolean isInstance(Class< ? > type, String string) {

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/component/ReferenceDef.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/component/ReferenceDef.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/component/ReferenceDef.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/component/ReferenceDef.java Tue Jun 26 16:34:24 2012
@@ -85,8 +85,7 @@ class ReferenceDef {
 		int n = a.compareTo(b);
 		if (n >= 0)
 			return a;
-		else
-			return b;
+		return b;
 	}
 
 	public String toString() {

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/differ/DiffImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/differ/DiffImpl.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/differ/DiffImpl.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/differ/DiffImpl.java Tue Jun 26 16:34:24 2012
@@ -200,10 +200,10 @@ public class DiffImpl implements Diff, C
 		if (getDelta() == other.getDelta()) {
 			if (getType() == other.getType()) {
 				return getName().compareTo(other.getName());
-			} else
-				return getType().compareTo(other.getType());
-		} else
-			return getDelta().compareTo(other.getDelta());
+			}
+			return getType().compareTo(other.getType());
+		}
+		return getDelta().compareTo(other.getDelta());
 	}
 
 	public Diff get(String name) {

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/differ/Element.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/differ/Element.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/differ/Element.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/differ/Element.java Tue Jun 26 16:34:24 2012
@@ -97,8 +97,7 @@ class Element implements Tree {
 	public int compareTo(Tree other) {
 		if (type == other.getType())
 			return name.compareTo(other.getName());
-		else
-			return type.compareTo(other.getType());
+		return type.compareTo(other.getType());
 	}
 
 	public boolean equals(Object other) {
@@ -125,7 +124,7 @@ class Element implements Tree {
 	}
 
 	public Diff diff(Tree older) {
-		return new DiffImpl(this, (Element) older);
+		return new DiffImpl(this, older);
 	}
 
 	public Element get(String name) {

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/differ/JavaElement.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/differ/JavaElement.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/differ/JavaElement.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/differ/JavaElement.java Tue Jun 26 16:34:24 2012
@@ -297,12 +297,11 @@ class JavaElement {
 					Clazz c = analyzer.findClass(name);
 					if (c == null) {
 						return "Cannot load " + name;
-					} else {
-						Element s = classElement(c);
-						for (Element child : s.children) {
-							if (INHERITED.contains(child.type) && !child.name.startsWith("<")) {
-								members.add(child);
-							}
+					}
+					Element s = classElement(c);
+					for (Element child : s.children) {
+						if (INHERITED.contains(child.type) && !child.name.startsWith("<")) {
+							members.add(child);
 						}
 					}
 				}
@@ -629,7 +628,7 @@ class JavaElement {
 		elements.addAll(set);
 	}
 
-	private static void access(Collection<Element> children, int access, boolean deprecated) {
+	private static void access(Collection<Element> children, int access, @SuppressWarnings("unused") boolean deprecated) {
 		if (!isPublic(access))
 			children.add(PROTECTED);
 		if (isAbstract(access))

Added: felix/trunk/bundleplugin/src/main/java/aQute/bnd/differ/packageinfo
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/differ/packageinfo?rev=1354104&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/differ/packageinfo (added)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/differ/packageinfo Tue Jun 26 16:34:24 2012
@@ -0,0 +1 @@
+version 1.0
\ No newline at end of file

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/help/Syntax.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/help/Syntax.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/help/Syntax.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/help/Syntax.java Tue Jun 26 16:34:24 2012
@@ -38,7 +38,6 @@ public class Syntax implements Constants
 																							+ Verifier.VERSIONRANGE
 																									.toString()));
 
-	@SuppressWarnings("deprecation")
 	static Syntax[]							syntaxes				= new Syntax[] {
 			new Syntax(
 					BUNDLE_ACTIVATIONPOLICY,
@@ -287,8 +286,6 @@ public class Syntax implements Constants
 			new Syntax(NOUSES, "Do not calculate the uses: directive on exports", "-nouses=true", "true,false",
 					Verifier.TRUEORFALSEPATTERN),
 
-			new Syntax(NOPE, "Deprecated, use -nobundles. ", "-nope=true", "true,false", Verifier.TRUEORFALSEPATTERN),
-
 			new Syntax(PEDANTIC, "Warn about things that are not really wrong but still not right", "-nope=true",
 					"true,false", Verifier.TRUEORFALSEPATTERN),
 
@@ -331,10 +328,7 @@ public class Syntax implements Constants
 			new Syntax(
 					RUNVM,
 					"Additional arguments for the VM invokation. Keys that start with a - are added as options, otherwise they are treated as -D properties for the VM",
-					"-runvm=-Xmax=30", null, null),
-			new Syntax(VERSIONPOLICY, "Provides a version policy to imports that are calculated from exports",
-					"-versionpolicy = \"[${version;==;${@}},${version;+;${@}})\"", null, null)
-
+					"-runvm=-Xmax=30", null, null)
 																	};
 
 	public final static Map<String,Syntax>	HELP					= new HashMap<String,Syntax>();

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/MakeBnd.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/MakeBnd.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/MakeBnd.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/MakeBnd.java Tue Jun 26 16:34:24 2012
@@ -56,8 +56,8 @@ public class MakeBnd implements MakePlug
 				}
 			}
 			return new JarResource(jar);
-		} else
-			return null;
+		}
+		return null;
 	}
 
 }

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/MakeCopy.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/MakeCopy.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/MakeCopy.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/MakeCopy.java Tue Jun 26 16:34:24 2012
@@ -20,23 +20,19 @@ public class MakeCopy implements MakePlu
 			if (content == null)
 				throw new IllegalArgumentException("No 'from' or 'content' field in copy " + argumentsOnMake);
 			return new EmbeddedResource(content.getBytes("UTF-8"), 0);
-		} else {
-
-			File f = builder.getFile(from);
-			if (f.isFile())
-				return new FileResource(f);
-			else {
-				try {
-					URL url = new URL(from);
-					return new URLResource(url);
-				}
-				catch (MalformedURLException mfue) {
-					// We ignore this
-				}
-				throw new IllegalArgumentException("Copy source does not exist " + from + " for destination "
-						+ destination);
-			}
 		}
+		File f = builder.getFile(from);
+		if (f.isFile())
+			return new FileResource(f);
+		try {
+			URL url = new URL(from);
+			return new URLResource(url);
+		}
+		catch (MalformedURLException mfue) {
+			// We ignore this
+		}
+		throw new IllegalArgumentException("Copy source does not exist " + from + " for destination "
+				+ destination);
 	}
 
 }

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/component/ServiceComponent.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/component/ServiceComponent.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/component/ServiceComponent.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/make/component/ServiceComponent.java Tue Jun 26 16:34:24 2012
@@ -169,11 +169,11 @@ public class ServiceComponent implements
 			Collection<Clazz> not = analyzer.getClasses("", QUERY.NAMED.toString(), name //
 					);
 
-			if (not.isEmpty())
+			if (not.isEmpty()) {
 				if ("*".equals(name))
 					return not;
-				else
-					error("Specified %s but could not find any class matching this pattern", name);
+				error("Specified %s but could not find any class matching this pattern", name);
+			}
 
 			for (Clazz c : not) {
 				if (c.getFormat().hasAnnotations())
@@ -432,7 +432,7 @@ public class ServiceComponent implements
 		 * @param pw
 		 * @param provides
 		 */
-		void provide(PrintWriter pw, String provides, boolean servicefactory, String impl) {
+		void provide(PrintWriter pw, String provides, boolean servicefactory, @SuppressWarnings("unused") String impl) {
 			if (provides != null) {
 				if (!servicefactory)
 					pw.println("  <service>");

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenDependencyGraph.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenDependencyGraph.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenDependencyGraph.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenDependencyGraph.java Tue Jun 26 16:34:24 2012
@@ -14,7 +14,7 @@ public class MavenDependencyGraph {
 	final List<Artifact>				dependencies	= new ArrayList<Artifact>();
 	final List<URL>						repositories	= new ArrayList<URL>();
 	final XPath							xpath			= xpathFactory.newXPath();
-	final Map<URL,Artifact>				cache			= new HashMap<URL,Artifact>();
+	final Map<URI,Artifact>				cache			= new HashMap<URI,Artifact>();
 	Artifact							root;
 
 	enum Scope {
@@ -89,12 +89,11 @@ public class MavenDependencyGraph {
 			String path = getPath(repository.toString(), groupId, artifactId, version);
 
 			try {
-				URL url = new URL(path + ".pom");
+				URI url = new URL(path + ".pom").toURI();
 				if (cache.containsKey(url)) {
 					return cache.get(url);
-				} else {
-					return new Artifact(url);
 				}
+				return new Artifact(url.toURL());
 			}
 			catch (Exception e) {
 				System.err.println("Failed to get " + artifactId + " from " + repository);

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenDeploy.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenDeploy.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenDeploy.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenDeploy.java Tue Jun 26 16:34:24 2012
@@ -138,7 +138,7 @@ public class MavenDeploy implements Depl
 		}
 	}
 
-	private void optional(Command command, String key, String value) {
+	private void optional(Command command, @SuppressWarnings("unused") String key, String value) {
 		if (value == null)
 			return;
 

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenDeployCmd.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenDeployCmd.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenDeployCmd.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenDeployCmd.java Tue Jun 26 16:34:24 2012
@@ -173,7 +173,7 @@ public class MavenDeployCmd extends Proc
 		}
 	}
 
-	private void optional(Command command, String key, String value) {
+	private void optional(Command command, @SuppressWarnings("unused") String key, String value) {
 		if (value == null)
 			return;
 

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenRepository.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenRepository.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenRepository.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenRepository.java Tue Jun 26 16:34:24 2012
@@ -25,7 +25,7 @@ public class MavenRepository implements 
 		return false;
 	}
 
-	public File[] get(String bsn, String version) throws Exception {
+	private File[] get(String bsn, String version) throws Exception {
 		VersionRange range = new VersionRange("0");
 		if (version != null)
 			range = new VersionRange(version);

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/support/MavenRemoteRepository.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/support/MavenRemoteRepository.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/support/MavenRemoteRepository.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/support/MavenRemoteRepository.java Tue Jun 26 16:34:24 2012
@@ -16,16 +16,6 @@ public class MavenRemoteRepository imple
 	Registry	registry;
 	Maven		maven;
 
-	public File[] get(String bsn, String range) throws Exception {
-		File f = get(bsn, range, Strategy.HIGHEST, null);
-		if (f == null)
-			return null;
-
-		return new File[] {
-			f
-		};
-	}
-
 	public File get(String bsn, String version, Strategy strategy, Map<String,String> properties) throws Exception {
 		String groupId = null;
 

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/repo/eclipse/EclipseRepo.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/repo/eclipse/EclipseRepo.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/repo/eclipse/EclipseRepo.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/repo/eclipse/EclipseRepo.java Tue Jun 26 16:34:24 2012
@@ -130,7 +130,7 @@ public class EclipseRepo implements Plug
 		return false;
 	}
 
-	public File[] get(String bsn, String range) throws Exception {
+	private File[] get(String bsn, String range) throws Exception {
 		VersionRange r = new VersionRange(range);
 		Map<String,String> instances = index.get(bsn);
 		if (instances == null)

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/BndListener.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/BndListener.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/BndListener.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/BndListener.java Tue Jun 26 16:34:24 2012
@@ -8,7 +8,7 @@ import aQute.libg.reporter.*;
 public class BndListener {
 	final AtomicInteger	inside	= new AtomicInteger();
 
-	public void changed(File file) {}
+	public void changed(@SuppressWarnings("unused") File file) {}
 
 	public void begin() {
 		inside.incrementAndGet();
@@ -22,7 +22,7 @@ public class BndListener {
 		return inside.get() != 0;
 	}
 
-	public void signal(Reporter reporter) {
+	public void signal(@SuppressWarnings("unused") Reporter reporter) {
 
 	}
 }

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/RepositoryPlugin.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/RepositoryPlugin.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/RepositoryPlugin.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/RepositoryPlugin.java Tue Jun 26 16:34:24 2012
@@ -19,22 +19,6 @@ public interface RepositoryPlugin {
 	 * @param range
 	 *            Version range for this bundle,"latest" if you only want the
 	 *            latest, or null when you want all.
-	 * @return A list of URLs sorted on version, lowest version is at index 0.
-	 *         null is returned when no files with the given bsn ould be found.
-	 * @throws Exception
-	 *             when anything goes wrong
-	 */
-	@Deprecated
-	File[] get(String bsn, String range) throws Exception;
-
-	/**
-	 * Return a URL to a matching version of the given bundle.
-	 * 
-	 * @param bsn
-	 *            Bundle-SymbolicName of the searched bundle
-	 * @param range
-	 *            Version range for this bundle,"latest" if you only want the
-	 *            latest, or null when you want all.
 	 * @param strategy
 	 *            Get the highest or the lowest
 	 * @return A list of URLs sorted on version, lowest version is at index 0.

Added: felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/diff/packageinfo
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/diff/packageinfo?rev=1354104&view=auto
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/diff/packageinfo (added)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/service/diff/packageinfo Tue Jun 26 16:34:24 2012
@@ -0,0 +1 @@
+version 1.0
\ No newline at end of file

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/settings/Settings.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/settings/Settings.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/settings/Settings.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/settings/Settings.java Tue Jun 26 16:34:24 2012
@@ -38,8 +38,8 @@ public class Settings {
 
 	private void generate() throws NoSuchAlgorithmException {
 		Pair< ? extends PrivateKey, ? extends RSAPublicKey> pair = RSA.generate();
-		prefs.put(KEY_PRIVATE, Crypto.toString(pair.a));
-		prefs.put(KEY_PUBLIC, Crypto.toString(pair.b));
+		prefs.put(KEY_PRIVATE, Crypto.toString(pair.getFirst()));
+		prefs.put(KEY_PUBLIC, Crypto.toString(pair.getSecond()));
 		prefs.putBoolean(KEY_SET, true);
 	}
 

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/signing/Signer.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/signing/Signer.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/signing/Signer.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/signing/Signer.java Tue Jun 26 16:34:24 2012
@@ -131,10 +131,10 @@ public class Signer extends Processor {
 		for (Map.Entry<String,Resource> entry : jar.getResources().entrySet()) {
 			String name = entry.getKey();
 			if (!METAINFDIR.matcher(name).matches()) {
-				out.write("\r\n".getBytes());
-				out.write("Name: ".getBytes());
+				out.write("\r\n".getBytes("UTF-8"));
+				out.write("Name: ".getBytes("UTF-8"));
 				out.write(name.getBytes("UTF-8"));
-				out.write("\r\n".getBytes());
+				out.write("\r\n".getBytes("UTF-8"));
 
 				digest(algorithms, entry.getValue());
 				for (int a = 0; a < algorithms.length; a++) {

Modified: felix/trunk/bundleplugin/src/main/java/aQute/configurable/Configurable.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/configurable/Configurable.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/configurable/Configurable.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/configurable/Configurable.java Tue Jun 26 16:34:24 2012
@@ -203,7 +203,6 @@ public class Configurable<T> {
 								"Unknown interface for a collection, no concrete class found: " + resultType);
 				}
 
-				@SuppressWarnings("unchecked")
 				Collection<Object> result = (Collection<Object>) resultType.newInstance();
 				Type componentType = pType.getActualTypeArguments()[0];
 
@@ -225,7 +224,6 @@ public class Configurable<T> {
 						throw new IllegalArgumentException(
 								"Unknown interface for a collection, no concrete class found: " + resultType);
 				}
-				@SuppressWarnings("unchecked")
 				Map<Object,Object> result = (Map<Object,Object>) resultType.newInstance();
 				Type keyType = pType.getActualTypeArguments()[0];
 				Type valueType = pType.getActualTypeArguments()[1];

Modified: felix/trunk/bundleplugin/src/main/java/aQute/lib/deployer/FileInstallRepo.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/lib/deployer/FileInstallRepo.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/lib/deployer/FileInstallRepo.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/lib/deployer/FileInstallRepo.java Tue Jun 26 16:34:24 2012
@@ -1,7 +1,6 @@
 package aQute.lib.deployer;
 
 import java.io.*;
-import java.net.*;
 import java.util.*;
 import java.util.jar.*;
 import java.util.regex.*;
@@ -79,8 +78,8 @@ public class FileInstallRepo extends Fil
 		if (dirty) {
 			dirty = false;
 			return true;
-		} else
-			return false;
+		}
+		return false;
 	}
 
 	@Override
@@ -102,48 +101,4 @@ public class FileInstallRepo extends Fil
 		}
 		return result;
 	}
-
-	@Override
-	public File[] get(String bsn, String versionRange) throws MalformedURLException {
-		// If the version is set to project, we assume it is not
-		// for us. A project repo will then get it.
-		if (versionRange != null && versionRange.equals("project"))
-			return null;
-
-		//
-		// The version range we are looking for can
-		// be null (for all) or a version range.
-		//
-		VersionRange range;
-		if (versionRange == null || versionRange.equals("latest")) {
-			range = new VersionRange("0");
-		} else
-			range = new VersionRange(versionRange);
-
-		//
-		// Iterator over all the versions for this BSN.
-		// Create a sorted map over the version as key
-		// and the file as URL as value. Only versions
-		// that match the desired range are included in
-		// this list.
-		//
-		File instances[] = getRoot().listFiles();
-		SortedMap<Version,File> versions = new TreeMap<Version,File>();
-		for (int i = 0; i < instances.length; i++) {
-			Matcher m = REPO_FILE.matcher(instances[i].getName());
-			if (m.matches() && m.group(1).equals(bsn)) {
-				String versionString = m.group(2);
-				Version version;
-				if (versionString.equals("latest"))
-					version = new Version(Integer.MAX_VALUE);
-				else
-					version = new Version(versionString);
-
-				if (range.includes(version))
-					versions.put(version, instances[i]);
-			}
-		}
-		return versions.values().toArray(new File[versions.size()]);
-	}
-
 }

Modified: felix/trunk/bundleplugin/src/main/java/aQute/lib/deployer/FileRepo.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/lib/deployer/FileRepo.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/lib/deployer/FileRepo.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/lib/deployer/FileRepo.java Tue Jun 26 16:34:24 2012
@@ -56,7 +56,7 @@ public class FileRepo implements Plugin,
 	 * Get a list of URLs to bundles that are constrained by the bsn and
 	 * versionRange.
 	 */
-	public File[] get(String bsn, String versionRange) throws Exception {
+	private File[] get(String bsn, String versionRange) throws Exception {
 		init();
 
 		// If the version is set to project, we assume it is not
@@ -259,8 +259,8 @@ public class FileRepo implements Plugin,
 		if (dirty) {
 			dirty = false;
 			return true;
-		} else
-			return false;
+		}
+		return false;
 	}
 
 	public String getName() {
@@ -276,8 +276,7 @@ public class FileRepo implements Plugin,
 		File version = new File(bsns, bsn + "-" + v.getMajor() + "." + v.getMinor() + "." + v.getMicro() + ".jar");
 		if (version.exists())
 			return new Jar(version);
-		else
-			return null;
+		return null;
 	}
 
 	public File get(String bsn, String version, Strategy strategy, Map<String,String> properties) throws Exception {
@@ -295,11 +294,9 @@ public class FileRepo implements Plugin,
 			File file = IO.getFile(root, bsn + "/" + bsn + "-" + version + ".jar");
 			if (file.isFile())
 				return file;
-			else {
-				file = IO.getFile(root, bsn + "/" + bsn + "-" + version + ".lib");
-				if (file.isFile())
-					return file;
-			}
+			file = IO.getFile(root, bsn + "/" + bsn + "-" + version + ".lib");
+			if (file.isFile())
+				return file;
 			return null;
 
 		}

Modified: felix/trunk/bundleplugin/src/main/java/aQute/lib/getopt/CommandLine.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/lib/getopt/CommandLine.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/lib/getopt/CommandLine.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/lib/getopt/CommandLine.java Tue Jun 26 16:34:24 2012
@@ -308,7 +308,7 @@ public class CommandLine {
 	 * Provide a help text.
 	 */
 
-	public void help(Formatter f, Object target, String cmd, Class< ? extends Options> specification) {
+	public void help(Formatter f, @SuppressWarnings("unused") Object target, String cmd, Class< ? extends Options> specification) {
 		Description descr = specification.getAnnotation(Description.class);
 		Arguments patterns = specification.getAnnotation(Arguments.class);
 		Map<String,Method> options = getOptions(specification);

Modified: felix/trunk/bundleplugin/src/main/java/aQute/lib/json/ArrayHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/lib/json/ArrayHandler.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/lib/json/ArrayHandler.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/lib/json/ArrayHandler.java Tue Jun 26 16:34:24 2012
@@ -7,7 +7,7 @@ import java.util.*;
 public class ArrayHandler extends Handler {
 	Type	componentType;
 
-	ArrayHandler(Class< ? > rawClass, Type componentType) {
+	ArrayHandler(@SuppressWarnings("unused") Class< ? > rawClass, Type componentType) {
 		this.componentType = componentType;
 	}
 

Modified: felix/trunk/bundleplugin/src/main/java/aQute/lib/json/CharacterHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/lib/json/CharacterHandler.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/lib/json/CharacterHandler.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/lib/json/CharacterHandler.java Tue Jun 26 16:34:24 2012
@@ -8,7 +8,7 @@ public class CharacterHandler extends Ha
 	@Override
 	void encode(Encoder app, Object object, Map<Object,Type> visited) throws Exception {
 		Character c = (Character) object;
-		int v = (int) c.charValue();
+		int v = c.charValue();
 		app.append(v + "");
 	}
 

Modified: felix/trunk/bundleplugin/src/main/java/aQute/lib/json/CollectionHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/lib/json/CollectionHandler.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/lib/json/CollectionHandler.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/lib/json/CollectionHandler.java Tue Jun 26 16:34:24 2012
@@ -48,7 +48,6 @@ public class CollectionHandler extends H
 		app.append("]");
 	}
 
-	@SuppressWarnings("unchecked")
 	@Override
 	Object decodeArray(Decoder r) throws Exception {
 		Collection<Object> c = (Collection<Object>) rawClass.newInstance();

Modified: felix/trunk/bundleplugin/src/main/java/aQute/lib/json/Decoder.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/lib/json/Decoder.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/lib/json/Decoder.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/lib/json/Decoder.java Tue Jun 26 16:34:24 2012
@@ -67,7 +67,6 @@ public class Decoder implements Closeabl
 		return digest.digest();
 	}
 
-	@SuppressWarnings("unchecked")
 	public <T> T get(Class<T> clazz) throws Exception {
 		return (T) codec.decode(clazz, this);
 	}
@@ -80,7 +79,6 @@ public class Decoder implements Closeabl
 		return codec.decode(null, this);
 	}
 
-	@SuppressWarnings("unchecked")
 	public <T> T get(TypeReference<T> ref) throws Exception {
 		return (T) codec.decode(ref.getType(), this);
 	}

Modified: felix/trunk/bundleplugin/src/main/java/aQute/lib/json/Handler.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/lib/json/Handler.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/lib/json/Handler.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/lib/json/Handler.java Tue Jun 26 16:34:24 2012
@@ -7,23 +7,23 @@ import java.util.*;
 abstract class Handler {
 	abstract void encode(Encoder app, Object object, Map<Object,Type> visited) throws IOException, Exception;
 
-	Object decodeObject(Decoder isr) throws Exception {
+	Object decodeObject(@SuppressWarnings("unused") Decoder isr) throws Exception {
 		throw new UnsupportedOperationException("Cannot be mapped to object " + this);
 	}
 
-	Object decodeArray(Decoder isr) throws Exception {
+	Object decodeArray(@SuppressWarnings("unused") Decoder isr) throws Exception {
 		throw new UnsupportedOperationException("Cannot be mapped to array " + this);
 	}
 
-	Object decode(String s) throws Exception {
+	Object decode(@SuppressWarnings("unused") String s) throws Exception {
 		throw new UnsupportedOperationException("Cannot be mapped to string " + this);
 	}
 
-	Object decode(Number s) throws Exception {
+	Object decode(@SuppressWarnings("unused") Number s) throws Exception {
 		throw new UnsupportedOperationException("Cannot be mapped to number " + this);
 	}
 
-	Object decode(boolean s) {
+	Object decode(@SuppressWarnings("unused") boolean s) {
 		throw new UnsupportedOperationException("Cannot be mapped to boolean " + this);
 	}
 

Modified: felix/trunk/bundleplugin/src/main/java/aQute/lib/json/MapHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/lib/json/MapHandler.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/lib/json/MapHandler.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/lib/json/MapHandler.java Tue Jun 26 16:34:24 2012
@@ -49,7 +49,6 @@ public class MapHandler extends Handler 
 		app.append("}");
 	}
 
-	@SuppressWarnings("unchecked")
 	@Override
 	Object decodeObject(Decoder r) throws Exception {
 		assert r.current() == '{';

Modified: felix/trunk/bundleplugin/src/main/java/aQute/lib/json/ObjectHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/lib/json/ObjectHandler.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/lib/json/ObjectHandler.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/lib/json/ObjectHandler.java Tue Jun 26 16:34:24 2012
@@ -11,7 +11,7 @@ public class ObjectHandler extends Handl
 	final Object	defaults[];
 	final Field		extra;
 
-	ObjectHandler(JSONCodec codec, Class< ? > c) throws Exception {
+	ObjectHandler(@SuppressWarnings("unused") JSONCodec codec, Class< ? > c) throws Exception {
 		rawClass = c;
 		fields = c.getFields();
 
@@ -74,7 +74,6 @@ public class ObjectHandler extends Handl
 		app.append("}");
 	}
 
-	@SuppressWarnings("unchecked")
 	@Override
 	Object decodeObject(Decoder r) throws Exception {
 		assert r.current() == '{';

Modified: felix/trunk/bundleplugin/src/main/java/aQute/lib/json/StringHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/lib/json/StringHandler.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/lib/json/StringHandler.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/lib/json/StringHandler.java Tue Jun 26 16:34:24 2012
@@ -103,7 +103,7 @@ public class StringHandler extends Handl
 	 * @return
 	 * @throws Exception
 	 */
-	private Object collect(Decoder isr, char close) throws Exception {
+	private Object collect(Decoder isr, @SuppressWarnings("unused") char close) throws Exception {
 		boolean instring = false;
 		int level = 1;
 		StringBuilder sb = new StringBuilder();

Modified: felix/trunk/bundleplugin/src/main/java/aQute/lib/justif/Justif.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/lib/justif/Justif.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/lib/justif/Justif.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/lib/justif/Justif.java Tue Jun 26 16:34:24 2012
@@ -5,7 +5,7 @@ import java.util.*;
 public class Justif {
 	int[]	tabs;
 
-	public Justif(int width, int... tabs) {
+	public Justif(@SuppressWarnings("unused") int width, int... tabs) {
 		this.tabs = tabs;
 	}
 

Modified: felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Analyzer.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Analyzer.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Analyzer.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Analyzer.java Tue Jun 26 16:34:24 2012
@@ -47,7 +47,7 @@ import aQute.libg.version.Version;
 
 public class Analyzer extends Processor {
 	private final SortedSet<Clazz.JAVA>				ees						= new TreeSet<Clazz.JAVA>();
-	static Manifest									bndInfo;
+	static Properties								bndInfo;
 
 	// Bundle parameters
 	private Jar										dot;
@@ -139,7 +139,7 @@ public class Analyzer extends Processor 
 				for (String dir : current.getDirectories().keySet()) {
 					PackageRef packageRef = getPackageRef(dir);
 					Resource resource = current.getResource(dir + "/packageinfo");
-					setPackageInfo(packageRef, resource, classpathExports);
+					getExportVersionsFromPackageInfo(packageRef, resource, classpathExports);
 				}
 			}
 
@@ -149,6 +149,7 @@ public class Analyzer extends Processor 
 			if (s != null) {
 				activator = getTypeRefFromFQN(s);
 				referTo(activator);
+				trace("activator %s %s", s, activator);
 			}
 
 			// Execute any plugins
@@ -560,7 +561,7 @@ public class Analyzer extends Processor 
 		return value.trim();
 	}
 
-	public String _bsn(String args[]) {
+	public String _bsn(@SuppressWarnings("unused") String args[]) {
 		return getBsn();
 	}
 
@@ -643,11 +644,11 @@ public class Analyzer extends Processor 
 	 * @return version or unknown.
 	 */
 	public String getBndVersion() {
-		return getBndInfo("Bundle-Version", "<unknown>");
+		return getBndInfo("version", "<unknown>");
 	}
 
 	public long getBndLastModified() {
-		String time = getBndInfo("Bnd-LastModified", "0");
+		String time = getBndInfo("lastmodified", "0");
 		try {
 			return Long.parseLong(time);
 		}
@@ -660,13 +661,25 @@ public class Analyzer extends Processor 
 	public String getBndInfo(String key, String defaultValue) {
 		if (bndInfo == null) {
 			try {
-				bndInfo = new Manifest(getClass().getResourceAsStream("META-INF/MANIFEST.MF"));
+				Properties bndInfoLocal = new Properties();
+				URL url = Analyzer.class.getResource("bnd.info");
+				if (url != null) {
+					InputStream in = url.openStream();
+					try {
+						bndInfoLocal.load(in);
+					}
+					finally {
+						in.close();
+					}
+				}
+				bndInfo = bndInfoLocal;
 			}
 			catch (Exception e) {
+				e.printStackTrace();
 				return defaultValue;
 			}
 		}
-		String value = bndInfo.getMainAttributes().getValue(key);
+		String value = bndInfo.getProperty(key);
 		if (value == null)
 			return defaultValue;
 		return value;
@@ -1345,39 +1358,44 @@ public class Analyzer extends Processor 
 	 * @param value
 	 * @throws Exception
 	 */
-	void setPackageInfo(PackageRef packageRef, Resource r, Packages classpathExports) throws Exception {
+	void getExportVersionsFromPackageInfo(PackageRef packageRef, Resource r, Packages classpathExports) throws Exception {
 		if (r == null)
 			return;
 
 		Properties p = new Properties();
-		InputStream in = r.openInputStream();
 		try {
-			p.load(in);
-		}
-		finally {
-			in.close();
-		}
-		Attrs map = classpathExports.get(packageRef);
-		if (map == null) {
-			classpathExports.put(packageRef, map = new Attrs());
-		}
-		for (Enumeration<String> t = (Enumeration<String>) p.propertyNames(); t.hasMoreElements();) {
-			String key = t.nextElement();
-			String value = map.get(key);
-			if (value == null) {
-				value = p.getProperty(key);
-
-				// Messy, to allow directives we need to
-				// allow the value to start with a ':' since we cannot
-				// encode this in a property name
-
-				if (value.startsWith(":")) {
-					key = key + ":";
-					value = value.substring(1);
+			InputStream in = r.openInputStream();
+			try {
+				p.load(in);
+			}
+			finally {
+				in.close();
+			}
+			Attrs map = classpathExports.get(packageRef);
+			if (map == null) {
+				classpathExports.put(packageRef, map = new Attrs());
+			}
+			for (Enumeration<String> t = (Enumeration<String>) p.propertyNames(); t.hasMoreElements();) {
+				String key = t.nextElement();
+				String value = map.get(key);
+				if (value == null) {
+					value = p.getProperty(key);
+
+					// Messy, to allow directives we need to
+					// allow the value to start with a ':' since we cannot
+					// encode this in a property name
+
+					if (value.startsWith(":")) {
+						key = key + ":";
+						value = value.substring(1);
+					}
+					map.put(key, value);
 				}
-				map.put(key, value);
 			}
 		}
+		catch (Exception e) {
+			msgs.NoSuchFile_(r);
+		}
 	}
 
 	public void close() {
@@ -1628,7 +1646,7 @@ public class Analyzer extends Processor 
 						// to overlap
 						if (!packageRef.isMetaData()) {
 							Resource pinfo = jar.getResource(prefix + packageRef.getPath() + "/packageinfo");
-							setPackageInfo(packageRef, pinfo, classpathExports);
+							getExportVersionsFromPackageInfo(packageRef, pinfo, classpathExports);
 						}
 					}
 				}
@@ -1677,7 +1695,7 @@ public class Analyzer extends Processor 
 							contained.put(packageRef);
 							if (!packageRef.isMetaData()) {
 								Resource pinfo = jar.getResource(prefix + packageRef.getPath() + "/packageinfo");
-								setPackageInfo(packageRef, pinfo, classpathExports);
+								getExportVersionsFromPackageInfo(packageRef, pinfo, classpathExports);
 							}
 						}
 						if (info != null)
@@ -1903,39 +1921,12 @@ public class Analyzer extends Processor 
 	final static String	DEFAULT_PROVIDER_POLICY	= "${range;[==,=+)}";
 	final static String	DEFAULT_CONSUMER_POLICY	= "${range;[==,+)}";
 
-	@SuppressWarnings("deprecation")
 	public String getVersionPolicy(boolean implemented) {
 		if (implemented) {
-			String s = getProperty(PROVIDER_POLICY);
-			if (s != null)
-				return s;
-
-			s = getProperty(VERSIONPOLICY_IMPL);
-			if (s != null)
-				return s;
-
-			return getProperty(VERSIONPOLICY, DEFAULT_PROVIDER_POLICY);
+			return getProperty(PROVIDER_POLICY, DEFAULT_PROVIDER_POLICY);
 		}
-		String s = getProperty(CONSUMER_POLICY);
-		if (s != null)
-			return s;
-
-		s = getProperty(VERSIONPOLICY_USES);
-		if (s != null)
-			return s;
-
-		return getProperty(VERSIONPOLICY, DEFAULT_CONSUMER_POLICY);
 
-		// String vp = implemented ? getProperty(VERSIONPOLICY_IMPL) :
-		// getProperty(VERSIONPOLICY_USES);
-		//
-		// if (vp != null)
-		// return vp;
-		//
-		// if (implemented)
-		// return getProperty(VERSIONPOLICY_IMPL, "{$range;[==,=+}");
-		// else
-		// return getProperty(VERSIONPOLICY, "${range;[==,+)}");
+		return getProperty(CONSUMER_POLICY, DEFAULT_CONSUMER_POLICY);
 	}
 
 	/**
@@ -2303,7 +2294,7 @@ public class Analyzer extends Processor 
 		return ees.first();
 	}
 
-	public String _ee(String args[]) {
+	public String _ee(@SuppressWarnings("unused") String args[]) {
 		return getLowestEE().getEE();
 	}
 

Modified: felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Builder.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Builder.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Builder.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Builder.java Tue Jun 26 16:34:24 2012
@@ -247,7 +247,7 @@ public class Builder extends Analyzer {
 		changedFile(f);
 	}
 
-	protected void changedFile(File f) {}
+	protected void changedFile(@SuppressWarnings("unused") File f) {}
 
 	/**
 	 * Sign the jar file. -sign : <alias> [ ';' 'password:=' <password> ] [ ';'
@@ -256,7 +256,7 @@ public class Builder extends Analyzer {
 	 * @return
 	 */
 
-	void sign(Jar jar) throws Exception {
+	void sign(@SuppressWarnings("unused") Jar jar) throws Exception {
 		String signing = getProperty("-sign");
 		if (signing == null)
 			return;
@@ -283,6 +283,7 @@ public class Builder extends Analyzer {
 		Parameters conditionals = getParameters(CONDITIONAL_PACKAGE);
 		if (conditionals.isEmpty())
 			return null;
+		trace("do Conditional Package %s", conditionals);
 		Instructions instructions = new Instructions(conditionals);
 
 		Collection<PackageRef> referred = instructions.select(getReferred().keySet(), false);
@@ -294,7 +295,10 @@ public class Builder extends Analyzer {
 			for (Jar cpe : getClasspath()) {
 				Map<String,Resource> map = cpe.getDirectories().get(pref.getPath());
 				if (map != null) {
-					jar.addDirectory(map, false);
+					copy(jar, cpe, pref.getPath(), false);
+// Now use copy so that bnd.info is processed, next line should be 
+// removed in the future TODO
+//					jar.addDirectory(map, false);
 					break;
 				}
 			}
@@ -429,7 +433,7 @@ public class Builder extends Analyzer {
 		return sourcePath;
 	}
 
-	private void doVerify(Jar dot) throws Exception {
+	private void doVerify(@SuppressWarnings("unused") Jar dot) throws Exception {
 		Verifier verifier = new Verifier(this);
 		// Give the verifier the benefit of our analysis
 		// prevents parsing the files twice
@@ -608,8 +612,18 @@ public class Builder extends Analyzer {
 	 * @param overwriteResource
 	 */
 	private void copy(Jar dest, Jar srce, String path, boolean overwrite) {
+		trace("copy d=" + dest + " s=" + srce +" p="+ path);
 		dest.copy(srce, path, overwrite);
-
+		
+		// bnd.info sources must be preprocessed
+		String bndInfoPath = path + "/bnd.info";
+		Resource r = dest.getResource(bndInfoPath);
+		if ( r != null && !(r instanceof PreprocessResource)) {
+			trace("preprocessing bnd.info");
+			PreprocessResource pp = new PreprocessResource(this, r);
+			dest.putResource(bndInfoPath, pp);
+		}
+		
 		if (hasSources()) {
 			String srcPath = "OSGI-OPT/src/" + path;
 			Map<String,Resource> srcContents = srce.getDirectories().get(srcPath);
@@ -926,7 +940,7 @@ public class Builder extends Analyzer {
 		}
 	}
 
-	private void noSuchFile(Jar jar, String clause, Map<String,String> extra, String source, String destinationPath)
+	private void noSuchFile(Jar jar, @SuppressWarnings("unused") String clause, Map<String,String> extra, String source, String destinationPath)
 			throws Exception {
 		Jar src = getJarFromName(source, "Include-Resource " + source);
 		if (src != null) {
@@ -1398,7 +1412,7 @@ public class Builder extends Analyzer {
 	 * @throws Exception
 	 */
 
-	public void doDiff(Jar dot) throws Exception {
+	public void doDiff(@SuppressWarnings("unused") Jar dot) throws Exception {
 		Parameters diffs = parseHeader(getProperty("-diff"));
 		if (diffs.isEmpty())
 			return;

Modified: felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/ClassDataCollector.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/ClassDataCollector.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/ClassDataCollector.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/ClassDataCollector.java Tue Jun 26 16:34:24 2012
@@ -3,30 +3,30 @@ package aQute.lib.osgi;
 import aQute.lib.osgi.Descriptors.TypeRef;
 
 public class ClassDataCollector {
-	public void classBegin(int access, TypeRef name) {}
+	public void classBegin(@SuppressWarnings("unused") int access, @SuppressWarnings("unused") TypeRef name) {}
 
 	public boolean classStart(int access, TypeRef className) {
 		classBegin(access, className);
 		return true;
 	}
 
-	public void extendsClass(TypeRef zuper) throws Exception {}
+	public void extendsClass(@SuppressWarnings("unused") TypeRef zuper) throws Exception {}
 
-	public void implementsInterfaces(TypeRef[] interfaces) throws Exception {}
+	public void implementsInterfaces(@SuppressWarnings("unused") TypeRef[] interfaces) throws Exception {}
 
-	public void addReference(TypeRef ref) {}
+	public void addReference(@SuppressWarnings("unused") TypeRef ref) {}
 
-	public void annotation(Annotation annotation) {}
+	public void annotation(@SuppressWarnings("unused") Annotation annotation) {}
 
-	public void parameter(int p) {}
+	public void parameter(@SuppressWarnings("unused") int p) {}
 
-	public void method(Clazz.MethodDef defined) {}
+	public void method(@SuppressWarnings("unused") Clazz.MethodDef defined) {}
 
-	public void field(Clazz.FieldDef defined) {}
+	public void field(@SuppressWarnings("unused") Clazz.FieldDef defined) {}
 
-	public void reference(Clazz.MethodDef referenced) {}
+	public void reference(@SuppressWarnings("unused") Clazz.MethodDef referenced) {}
 
-	public void reference(Clazz.FieldDef referenced) {}
+	public void reference(@SuppressWarnings("unused") Clazz.FieldDef referenced) {}
 
 	public void classEnd() throws Exception {}
 
@@ -61,21 +61,24 @@ public class ClassDataCollector {
 	 *            The access flags
 	 * @throws Exception
 	 */
-	public void innerClass(TypeRef innerClass, TypeRef outerClass, String innerName, int innerClassAccessFlags)
+	public void innerClass(TypeRef innerClass, TypeRef outerClass, String innerName, @SuppressWarnings("unused") int innerClassAccessFlags)
 			throws Exception {}
 
-	public void signature(String signature) {}
+	public void signature(@SuppressWarnings("unused") String signature) {}
 
-	public void constant(Object object) {}
+	public void constant(@SuppressWarnings("unused") Object object) {}
 
 	public void memberEnd() {}
 
-	public void version(int minor, int major) {
+	public void version(@SuppressWarnings("unused") int minor, @SuppressWarnings("unused") int major) {
 		// TODO Auto-generated method stub
 
 	}
 
-	public void referenceMethod(int access, TypeRef className, String method, String descriptor) {
+	public void referenceMethod(@SuppressWarnings("unused")
+	int access, @SuppressWarnings("unused")
+	TypeRef className, @SuppressWarnings("unused")
+	String method, @SuppressWarnings("unused") String descriptor) {
 		// TODO Auto-generated method stub
 
 	}

Modified: felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Clazz.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Clazz.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Clazz.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Clazz.java Tue Jun 26 16:34:24 2012
@@ -69,7 +69,7 @@ public class Clazz {
 			return major >= J2SE5.major;
 		}
 
-		public static JAVA getJava(int major, int minor) {
+		public static JAVA getJava(int major, @SuppressWarnings("unused") int minor) {
 			for (JAVA j : JAVA.values()) {
 				if (j.major == major)
 					return j;
@@ -629,7 +629,7 @@ public class Clazz {
 			pool[poolIndex] = intPool[poolIndex];
 	}
 
-	protected void pool(Object[] pool, int[] intPool) {}
+	protected void pool(@SuppressWarnings("unused") Object[] pool, @SuppressWarnings("unused") int[] intPool) {}
 
 	/**
 	 * @param in
@@ -1127,8 +1127,7 @@ public class Clazz {
 		}
 		if (collect)
 			return new Annotation(name, elements, member, policy);
-		else
-			return null;
+		return null;
 	}
 
 	private Object doElementValue(DataInputStream in, ElementType member, RetentionPolicy policy, boolean collect)
@@ -1572,8 +1571,7 @@ public class Clazz {
 	public int getAccess() {
 		if (innerAccess == -1)
 			return accessx;
-		else
-			return innerAccess;
+		return innerAccess;
 	}
 
 	public TypeRef getClassName() {

Modified: felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/CommandResource.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/CommandResource.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/CommandResource.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/CommandResource.java Tue Jun 26 16:34:24 2012
@@ -48,7 +48,7 @@ public class CommandResource extends Wri
 				cmd.var("PATH", path);
 				domain.trace("PATH: %s", path);
 			}
-			OutputStreamWriter osw = new OutputStreamWriter(out);
+			OutputStreamWriter osw = new OutputStreamWriter(out, "UTF-8");
 			int result = cmd.execute(command, stdout, errors);
 			osw.append(stdout);
 			osw.flush();

Modified: felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Constants.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Constants.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Constants.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Constants.java Tue Jun 26 16:34:24 2012
@@ -52,6 +52,11 @@ public interface Constants {
 	String							CREATED_BY									= "Created-By";
 	String							TOOL										= "Tool";
 	String							TESTCASES									= "Test-Cases";
+        /**
+         * @deprecated Use {@link Constants#TESTCASES}.
+         */
+        @Deprecated
+        String                                                  TESTSUITES                                                                      = "Test-Suites";
 	String							SIGNATURE_TEST								= "-signaturetest";
 
 	String							headers[]									= {
@@ -90,8 +95,6 @@ public interface Constants {
 	String							NOEXTRAHEADERS								= "-noextraheaders";
 	String							NOMANIFEST									= "-nomanifest";
 	String							NOUSES										= "-nouses";
-	@Deprecated
-	String							NOPE										= "-nope";
 	String							NOBUNDLES									= "-nobundles";
 	String							PEDANTIC									= "-pedantic";
 	String							PLUGIN										= "-plugin";
@@ -106,6 +109,7 @@ public interface Constants {
 	String							RUNPROPERTIES								= "-runproperties";
 	String							RUNSYSTEMPACKAGES							= "-runsystempackages";
 	String							RUNBUNDLES									= "-runbundles";
+	String							RUNREPOS									= "-runrepos";
 	String							RUNPATH										= "-runpath";
 	String							RUNSTORAGE									= "-runstorage";
 	String							RUNBUILDS									= "-runbuilds";
@@ -126,14 +130,8 @@ public interface Constants {
 	String							TESTCONTINUOUS								= "-testcontinuous";
 	String							UNDERTEST									= "-undertest";
 	String							VERBOSE										= "-verbose";
-	@Deprecated
-	String							VERSIONPOLICY_IMPL							= "-versionpolicy-impl";
-	@Deprecated
-	String							VERSIONPOLICY_USES							= "-versionpolicy-uses";
 	String							PROVIDER_POLICY								= "-provider-policy";
 	String							CONSUMER_POLICY								= "-consumer-policy";
-	@Deprecated
-	String							VERSIONPOLICY								= "-versionpolicy";
 	String							WAB											= "-wab";
 	String							WABLIB										= "-wablib";
 	String							REQUIRE_BND									= "-require-bnd";

Modified: felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Instruction.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Instruction.java?rev=1354104&r1=1354103&r2=1354104&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Instruction.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Instruction.java Tue Jun 26 16:34:24 2012
@@ -88,8 +88,8 @@ public class Instruction {
 							sb.append("(\\..*)?");
 							wildcards = true;
 							break loop;
-						} else
-							sb.append("\\.");
+						}
+						sb.append("\\.");
 
 						break;
 					case '*' :
@@ -130,8 +130,7 @@ public class Instruction {
 
 		if (literal)
 			return match.equals(value);
-		else
-			return getMatcher(value).matches();
+		return getMatcher(value).matches();
 	}
 
 	public boolean isNegated() {



Mime
View raw message