Make cnf/ext/*.bnd properties referenceable from build.bnd
mistake
reformat
Made template function optional, so now the object
does not have to exist
Type handling of attributes was majorly screwed up
Ensure full drain
Coverage had TreeMap and used MethodDef as key but
MethodDef is not comparable. Added comparator to the
construction of the TreeMap
There was a problem that the ZipInputStream did not
fully read the InputStream. When the InputStream came
from a PipedInputStream then this caused the PipedOutputStream to be closed
before it was fully written. Now drains the stream, though
have to think about a better method. Maybe subclass the PipedInputStream
and drain on close? Whatever ...
fix FB warning: Dead store

Dead store to cmd in aQute.bnd.maven.MavenDeployCmd.run(String[], int)

This instruction assigns a value to a local variable, but the value is
not read or used in any subsequent instruction. Often, this indicates
an error, because the value computed is never used.

Note that Sun's javac compiler often generates dead stores for final
local variables. Because FindBugs is a bytecode-based tool, there is
no easy way to eliminate these false positives.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
fix FB warning: next() can't throw NoSuchElementException

aQute.lib.collections.SortedList$It.next() can't throw NoSuchElementException

This class implements the java.util.Iterator interface.
However, its next() method is not capable of throwing
java.util.NoSuchElementException.  The next() method should
be changed so it throws NoSuchElementException if is called
when there are no more elements to return.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
fix FB warning: may fail to close stream

aQute.bnd.main.DiffCommand.diff(DiffCommand$diffOptions)
may fail to close stream

The method creates an IO stream object, does not assign it
to any fields, pass it to other methods that might close it,
or return it, and does not appear to close the stream on all
paths out of the method.  This may result in a file descriptor
leak.  It is generally a good idea to use a finally block to
ensure that streams are closed.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
DiffCommand: refactor to have a single finally clause

The finally closes all open resources.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
fix FB warning: may fail to close stream

aQute.lib.osgi.PreprocessResource.getBytes() may fail to close stream

The method creates an IO stream object, does not assign it
to any fields, pass it to other methods that might close it,
or return it, and does not appear to close the stream on all
paths out of the method.  This may result in a file descriptor
leak.  It is generally a good idea to use a finally block to
ensure that streams are closed.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
fix FB warning: may fail to close stream

aQute.bnd.maven.MavenCommand.bundle(String[], int) may fail to close stream

The method creates an IO stream object, does not assign it
to any fields, pass it to other methods that might close it,
or return it, and does not appear to close the stream on all
paths out of the method.  This may result in a file descriptor
leak.  It is generally a good idea to use a finally block to
ensure that streams are closed.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
fix #174: HttpConnectorTest needs to use a free (non-fixed) port

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
fix FB warning: Write to static field from instance method

Write to static field aQute.jpm.service.ServiceMain.trace
from instance method aQute.jpm.service.ServiceMain.run()

This instance method writes to a static field. This is tricky
to get correct if multiple instances are being manipulated, and
generally bad practice.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
fix FB warning: isn't final but should be

aQute.libg.header.Attrs.TYPED isn't final but should be

A mutable static field could be changed by malicious code
or by accident from another package. The field could be made
final to avoid this vulnerability.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
fix FB warning: Write to static field from instance method

Write to static field aQute.jpm.service.ServiceMain.last
from instance method aQute.jpm.service.ServiceMain.setMessage(String)

This instance method writes to a static field. This is tricky
to get correct if multiple instances are being manipulated, and
generally bad practice.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
bnd: make out and err final

They were never assigned (except in the unused method setOut,
which is removed here)

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
jpm: Main: make out and err final

They were never assigned elsewhere

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>